aboutsummaryrefslogtreecommitdiff
path: root/src/zen/trace/trace_analyze.h
blob: 7b6f4fccd9e9482a9c3b6d10c3be2076097dc10d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "symbol_resolver.h"
#include "trace_model.h"

#include <cstdint>
#include <filesystem>
#include <string>
#include <vector>

namespace zen::trace_detail {

struct AnalyzeOptions
{
	int					  LiveAllocsLimit		 = 50;				  // 0 = off
	int					  ChurnLimit			 = 0;				  // 0 = off; top N churny callstacks
	uint64_t			  ChurnDistanceThreshold = 1000;			  // event distance: allocs freed within N events are "churny"
	SymbolBackend		  Symbols				 = SymbolBackend(1);  // Pdb (default)
	std::filesystem::path HtmlReportPath;							  // empty = off; standalone offline memory HTML report
	bool				  NoCache = false;							  // skip reading/writing the .ucache_z cache
	bool EnableCallstackHeuristic = true;			 // skip leading low-level / third-party frames while keeping the boundary callsite
	std::vector<std::string> CallstackSkipPatterns;	 // wildcard patterns matched against symbol, module name, and module path
};

void RunAnalyze(const std::filesystem::path& FilePath, const AnalyzeOptions& Options = {});

}  // namespace zen::trace_detail