-
Notifications
You must be signed in to change notification settings - Fork 2
/
ProfilingDataParser.h
97 lines (87 loc) · 2.31 KB
/
ProfilingDataParser.h
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef _PROFILING_DATA_PARSER_
#define _PROFILING_DATA_PARSER_
#include <QJsonObject>
#include <QJsonArray>
#include <QString>
#include <QMap>
#include "RoutineListModel.h"
// for allocations only name will be filled
// I hope it doesn't fuck shit up
struct ThingData {
QString name;
QString file;
int line;
};
struct RoutineData {
int id;
int entries;
int speshEntries;
int JITEntries;
int inlinedEntries;
int exclusive;
int inclusive;
int deoptOnes;
int deoptAlls;
int OSR;
int recDepth;
QString name;
QString file;
int line;
RoutineData(int eye_dee)
{
id = eye_dee;
entries = speshEntries = JITEntries = inlinedEntries
= exclusive = inclusive
= deoptOnes = deoptAlls
= OSR = recDepth = line = 0;
}
};
struct GCData {
int gcNursery;
int gcNurseryTime;
int gcFull;
int gcFullTime;
GCData()
{
gcNursery = gcNurseryTime = gcFull = gcFullTime = 0;
}
};
class ProfilingDataParser {
QMap<int, RoutineData*> routines;
QMap<int, ThingData*> things;
int totalExclusive;
int totalInclusive;
GCData gcData;
int totalTime;
int speshTime;
int totalEntries;
int speshEntries;
int inlinedEntries;
int JITEntries;
int totalOSR;
int totalDeoptOnes;
int totalDeoptAlls;
public:
ProfilingDataParser(QJsonArray &root)
{
totalExclusive = totalInclusive = totalTime = speshTime
= totalEntries = speshEntries = inlinedEntries = JITEntries
= totalOSR = totalDeoptOnes = totalDeoptAlls = 0;
QJsonObject things = root[0].toObject();
QJsonObject rest = root[1].toObject();
walkThingsNode(things);
totalTime = rest["total_time"].toInt();
speshTime = rest["spesh_time"].toInt();
QJsonObject callGraph = rest["call_graph"].toObject();
totalInclusive = callGraph["inclusive_time"].toInt();
walkCallGraphNode(callGraph);
QJsonArray gcData = rest["gcs"].toArray();
walkGCNodes(gcData);
}
void walkThingsNode(QJsonObject&);
void walkCallGraphNode(QJsonObject&);
void walkGCNodes(QJsonArray&);
QVector<RoutineListEntry*> buildRoutineList();
QMap<QString, QVariant> buildOverviewData();
};
#endif