blob: 067985f25d923cec597a1f3bb3123c988bf576c3 (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "symbol_resolver.h"
#include "trace_model.h"
#include <string>
#include <vector>
ZEN_THIRD_PARTY_INCLUDES_START
#include <EASTL/hash_map.h>
#include <EASTL/vector.h>
ZEN_THIRD_PARTY_INCLUDES_END
namespace zen::trace_detail {
struct CallstackFilterOptions
{
bool EnableHeuristic = true;
std::vector<std::string> SkipPatterns;
};
struct FilteredCallstackFrame
{
size_t OriginalIndex = 0;
const ResolvedFrame* Frame = nullptr;
std::string Display;
};
struct FilteredCallstackView
{
eastl::vector<FilteredCallstackFrame> Frames;
uint32_t HiddenPrefixCount = 0;
bool IncludedThirdPartyBoundary = false;
};
class CallstackFormatter
{
public:
CallstackFormatter(const TraceModel& InModel, const SymbolResolver* InSymbols);
const eastl::hash_map<uint64_t, std::string>& GetResolvedCache() const { return m_Cache; }
const CallstackEntry* FindCallstackEntry(uint32_t CallstackId) const;
const std::string& Describe(const ResolvedFrame& Frame);
FilteredCallstackView BuildView(const CallstackEntry& Entry, const CallstackFilterOptions& Options);
private:
const TraceModel& m_Model;
const SymbolResolver* m_Symbols = nullptr;
eastl::hash_map<uint64_t, std::string> m_Cache;
};
} // namespace zen::trace_detail
|