-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathTraceData.h
More file actions
52 lines (36 loc) · 1.23 KB
/
TraceData.h
File metadata and controls
52 lines (36 loc) · 1.23 KB
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
#ifndef PROTON_DATA_TRACE_DATA_H_
#define PROTON_DATA_TRACE_DATA_H_
#include "Data.h"
#include <memory>
#include <unordered_map>
namespace proton {
class TraceData : public Data {
public:
TraceData(const std::string &path, ContextSource *contextSource = nullptr);
virtual ~TraceData();
std::string toJsonString(size_t phase) const override;
std::vector<uint8_t> toMsgPack(size_t phase) const override;
DataEntry addOp(size_t phase, size_t eventId,
const std::vector<Context> &contexts) override;
void
addMetrics(size_t scopeId,
const std::map<std::string, MetricValueType> &metrics) override;
class Trace;
protected:
// ScopeInterface
void enterScope(const Scope &scope) override final;
void exitScope(const Scope &scope) override final;
private:
// Data
void doDump(std::ostream &os, OutputFormat outputFormat,
size_t phase) const override;
OutputFormat getDefaultOutputFormat() const override {
return OutputFormat::ChromeTrace;
}
void dumpChromeTrace(std::ostream &os, size_t phase) const;
PhaseStore<Trace> tracePhases;
// ScopeId -> EventId
std::unordered_map<size_t, size_t> scopeIdToEventId;
};
} // namespace proton
#endif // PROTON_DATA_TRACE_DATA_H_