Commit Graph

24 Commits

Author SHA1 Message Date
ionut matasaru
4688b36357 [Insights] Added initial implementation for MetadataProvider.
#rb Johan.Berg
#preflight 62738e8e432d5c693e7bd2a3

[CL 20055895 by ionut matasaru in ue5-main branch]
2022-05-05 06:14:08 -04:00
Johan Berg
2954005ff2 [Insights] Hierarchical tag view in memory queries.
* Adds logic to sort tags into correct hierarchy in analysis, regardless if the tag was declared as an LLMTag enum, name based tag or declared before it's parent has been declared.
* Add new class to break down memory allocs into hiearchical tags tree.

#rb ionit.matasaru
#preflight 623866cd88538cd45ec5ccc1

[CL 19450624 by Johan Berg in ue5-main branch]
2022-03-21 08:09:19 -04:00
ionut matasaru
26f47b060b [Insights]
- Improved performance of memory analysis (processing of live allocations in AllocationsProvider) with up to 50% (i.e. twice as fast). This is achived by using a better hash for TMap for long living allocations. Also switched the short living allocations to use only the linked list, with a reduced size (64 allocs).
  - Delayed initialization of SystemMemory heap to when the allocations provider inits (to save memory usage when traces does not have mem alloc events).
  - Added option to enable an initial "reserve" number for TMap (one used for long living allocations). Benchmarks shows further performance increase when using large reserve numbers, but mem cost becomes too high. So kept this 0 (unset) by default.
  - Added error checking for very large mem traces (when total number of mem events could exceed 32 bit limit).

Benchmarks:
  * analysis of a 32s session: from 17.6s to 8.3s (-53%)
  * analysis of a 7min session: from 88s to 46s (-48%)

#jira UE-135890
#rb Johan.Berg
#preflight 620fab43a96c65b0d81a9566

[CL 19070177 by ionut matasaru in ue5-main branch]
2022-02-22 04:14:31 -05:00
ionut matasaru
d2f594bb15 [Insights]
- Memory Insights: Added analysis support for "free callstack" for an allocation (i.e. callstack when an allocation if freed).
  - Memory Insights: Switched CallstackId to 32 bit and moved the resolving of "id to pointer" outside of mem queries. This allows us to add the second callstack id and also ids for future metadata without increasing the size of FAllocationItem struct (from AllocationProvider).
  - Memory Insights: Refactored code re ThreadId and Tracker passed from AllocationAnalysis to AllocationProvider.
  - Memory Insights: Refactored code re CallstackProvider to map a CallstackId directly as an index into array of callstacks.

#rb Johan.Berg
#preflight 6201460a6773a3612898c4de

[CL 18886419 by ionut matasaru in ue5-main branch]
2022-02-07 11:28:45 -05:00
johan berg
7448df3e21 [Insights] Introduced Tag type alias
Introduced a type alias for Tag type id, abstracting how we represent tags internally. This doesn't represent a a functional change, as in practise existing instrumentation only emitted postive values and previously uint32 was used for storage.

#rb none

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 18308342 in //UE5/Release-5.0/... via CL 18308344
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18308390 by johan berg in ue5-release-engine-test branch]
2021-11-29 08:19:57 -05:00
ionut matasaru
15ff5417dc [Insights] Memory: Added Start Event Index, End Event Index and Event Distance columns to Mem Allocs table.
#rb Catalin.Dragoiu
#preflight 619e0d02b55894aa744b4c1e

#ROBOMERGE-AUTHOR: ionut.matasaru
#ROBOMERGE-SOURCE: CL 18282384 in //UE5/Release-5.0/... via CL 18282392
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18282401 by ionut matasaru in ue5-release-engine-test branch]
2021-11-24 07:21:25 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
ionut matasaru
8b6495fb7b [Insights] Fixed usage of UE_LOG.
#rb none
[FYI] Johan.Berg

#ROBOMERGE-AUTHOR: ionut.matasaru
#ROBOMERGE-SOURCE: CL 17676411 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v875-17642767)

[CL 17676424 by ionut matasaru in ue5-release-engine-test branch]
2021-09-30 07:50:05 -04:00
johan berg
2d72c34c45 Assertion should exlude system root heap which is automatically added.
#rb none
#rnx
#preflight 6151b261b830b20001fa29ac

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 17629521 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17629533 by johan berg in ue5-release-engine-test branch]
2021-09-27 08:49:44 -04:00
johan berg
184ac0c4f0 Fix backwards compatibility with older memory traces.
#rb ionut.matasaru
#rnx

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 17608069 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17608120 by johan berg in ue5-release-engine-test branch]
2021-09-23 10:34:18 -04:00
johan berg
09d6b9e867 Analyzer support for additional memory spaces
Changes to analysis wrt to the changelist "Memory tracing additional heaps".

#rb ionut.matasaru
#preflight 614b43594cff690001754450

#ROBOMERGE-AUTHOR: johan.berg
#ROBOMERGE-SOURCE: CL 17596772 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17596784 by johan berg in ue5-release-engine-test branch]
2021-09-22 12:25:29 -04:00
robert millar
eef73ebc8b Insights changes:
Make memory tag specs important so they don't get dropped before a trace connection is made.
Prevent Insights from crashing when opening a trace missing memory scopes or with missing scope specs.
Add a tooltip to symbol resolution noting the environment variable for symbol paths.
Allow Insights to capture full callstacks (including system modules) with the define UE_CALLSTACK_TRACE_FULL_CALLSTACKS or the command line argument -tracefullcallstacks on Windows.

#jira none
#rb ionut.matasaru, martin.ridgers

#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 17461782 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)
#ROBOMERGE[bot1]: Dev-EngineMerge

[CL 17461823 by robert millar in ue5-release-engine-test branch]
2021-09-08 15:02:01 -04:00
ionut matasaru
84150030be [Insights]
- TraceServices: Changed ReadNetProfilerProvider, ReadMemoryProvider, ReadDiagnosticsProvider to return a pointer to the respective provider (instead of a reference). Can return nullptr. The UI should not assume the provider exists.
  - TraceServices: Added GetNetProfilerProviderName, GetMemoryProviderName, GetDiagnosticsProviderName, GetAllocationsProviderName to return name of respective provider.
  - TraceServices: Added ReadModuleProvider + GetModuleProviderName, ReadCallstacksProvider + GetCallstacksProviderName to access respective providers.
  - TraceServices: Added a default empty implementation to IModule for GenerateReports, GetLoggers and GetCommandLineArgument.
  - TraceServices: Changed FAnalysisService::StartAnalysis to not create default providers for Memory (LLM Stats), NetProfiler and Diagnostics, but to allow the respective modules (FMemoryModule, FNetProfilerModule, FDiagnosticsModule) to create the providers.
  - TraceInsights: Fixed UI code to check if the Memory, NetProfiler and Diagnostics provider are available.

#rb Catalin.Dragoiu, Johan.Berg

#ROBOMERGE-SOURCE: CL 16967698 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16967704 by ionut matasaru in ue5-release-engine-test branch]
2021-07-27 08:19:49 -04:00
ionut matasaru
31203cc09d [Insights] Fixed false positive IncludeTool error.
#jira UE-111510
#rb none

[CL 15749382 by ionut matasaru in ue5-main branch]
2021-03-19 14:15:01 -04:00
ionut matasaru
6b51f90a4a [Insights]
- Memory: Improved speed of live allocs matching in memory analysis.
  - Memory: Fixed N/A callstacks in a query made before analysis is completed.

#jira UE-110125
#rb Catalin.Dragoiu

[CL 15736769 by ionut matasaru in ue5-main branch]
2021-03-18 08:11:50 -04:00
Johan Berg
b1ed7c68de Allocations use realloc scopes
Realloc scopes were not applied. Additionally we extracted incorrect information from the event and constructed the combined thread and tracker information wrong.

#rb ionut.matasaru
#jira UE-110014

[CL 15720460 by Johan Berg in ue5-main branch]
2021-03-17 09:37:09 -04:00
ionut matasaru
9f55391241 [Insights] Added log messages for errors detected by AllocationsProvider.
#rb Johan.Berg

[CL 15237688 by ionut matasaru in ue5-main branch]
2021-01-28 08:10:57 -04:00
Catalin Dragoiu
4020586159 Callstack resolving for Insights initial commit
#rb none

[CL 14998219 by Catalin Dragoiu in ue5-main branch]
2021-01-06 05:44:12 -04:00
ionut matasaru
fb6d992187 [Insights]
- Implemented mem alloc queries also for live allocs.
  - Implemented analysis for llm tags associated with allocations (based on initial work by Johan.Berg).
  - Changed granularity of memory allocations timelines to 0.1ms (from 1ms).
  - Fixed allotment of allocations in SbTree's offsetted cells.
  - Fixed queries to handle also cases where multiple cells have exact same timestamps.
  - Added more debug/validation code for AllocationsProvider.

#rb Catalin.Dragoiu

[CL 14938990 by ionut matasaru in ue5-main branch]
2020-12-16 10:26:59 -04:00
ionut matasaru
f90dba2e22 Fixed few build errors when -nopch -disableunity.
#rb none
#jira UE-104158

[CL 14871699 by ionut matasaru in ue5-main branch]
2020-12-07 14:21:21 -04:00
ionut matasaru
8691beb48e [Insights]
- Fixed the Allocations Analysis to process the updated alloc trace events.
  - Added timelines in the Allocations Provider with variation for several stats based on 1ms sample:
      * MinTotalAllocatedMemory
      * MaxTotalAllocatedMemory
      * MinLiveAllocationCount
      * MaxLiveAllocationCount
      * AllocEventCount
      * FreeEventCount
  - Added graph tracks and graph series for all above timelines in Memory Insights.

#rb Catalin.Dragoiu
#jira UECORE-635

[CL 14853556 by ionut matasaru in ue5-main branch]
2020-12-04 07:02:31 -04:00
ionut matasaru
0fe05296a9 [Insights]
- Added detection for AllocationsProvider availability to know when to enable the Memory Insights tab (in addition to detecting availability of the LLM tags memory provider).
  - Simplified the API for allocation queries (using A, B, C, D time markers).
  - Added initial AllocationsAnalysis that processes the allocation trace events and delegates them to AllocationsProvider.
  - Added initial AllocationsProvider. Uses a simple map for live allocations.
  - Added FSbTree ("SBIF with offsetted cells" data structure for storing the retired allocations in AllocationsProvider).
  - Added async allocation queries (based on A, B, C, D time markers). Currently it uses a single TaskGraph task.
  - Added "LogTraceServices" log category for general purpose logging in TraceServices module.

#rb Catalin.Dragoiu

[CL 14813195 by ionut matasaru in ue5-main branch]
2020-11-25 12:48:47 -04:00
Martin Ridgers
5208379ed7 Moved the TraceServices module into its own namespace.
#rb im
#rnx

[CL 14743799 by Martin Ridgers in ue5-main branch]
2020-11-13 05:29:37 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00