perf_tests: Add missing trace event "id"
This missing identifier is used to match async trace events. Its absence broke async trace events since their Begin/End could not be matched correctly. Bug: dawn:208 Change-Id: I0671af8c3cbb8ff6220adcb8ed5621b831e383c7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12760 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
04863c42be
commit
f6281a5530
|
@ -125,6 +125,7 @@ void DawnPerfTestEnvironment::DumpTraceEventsToJSONFile() const {
|
|||
value["name"] = traceEvent.name;
|
||||
value["cat"] = traceEvent.categoryName;
|
||||
value["ph"] = &phase[0];
|
||||
value["id"] = traceEvent.id;
|
||||
value["ts"] = microseconds;
|
||||
value["pid"] = "Dawn";
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ uint64_t DawnPerfTestPlatform::AddTraceEvent(char phase,
|
|||
"|enabled| must be the first field of the TraceCategory class.");
|
||||
const TraceCategory* category = reinterpret_cast<const TraceCategory*>(categoryGroupEnabled);
|
||||
|
||||
mTraceEventBuffer.emplace_back(phase, category->name, name, timestamp);
|
||||
mTraceEventBuffer.emplace_back(phase, category->name, name, id, timestamp);
|
||||
return static_cast<uint64_t>(mTraceEventBuffer.size());
|
||||
}
|
||||
|
||||
|
|
|
@ -32,13 +32,22 @@ class DawnPerfTestPlatform : public dawn_platform::Platform {
|
|||
struct TraceEvent final {
|
||||
TraceEvent() {
|
||||
}
|
||||
TraceEvent(char phaseIn, const char* categoryNameIn, const char* nameIn, double timestampIn)
|
||||
: phase(phaseIn), categoryName(categoryNameIn), name(nameIn), timestamp(timestampIn) {
|
||||
TraceEvent(char phaseIn,
|
||||
const char* categoryNameIn,
|
||||
const char* nameIn,
|
||||
uint64_t idIn,
|
||||
double timestampIn)
|
||||
: phase(phaseIn),
|
||||
categoryName(categoryNameIn),
|
||||
name(nameIn),
|
||||
id(idIn),
|
||||
timestamp(timestampIn) {
|
||||
}
|
||||
|
||||
char phase = 0;
|
||||
const char* categoryName = nullptr;
|
||||
const char* name = nullptr;
|
||||
uint64_t id = 0;
|
||||
double timestamp = 0;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue