Hash :
4024e217
Author :
Date :
2018-10-17T14:53:29
perftests: Record trace events to JSON file. This allows us to view the timeline of events in the trace event browser. We can extend this to do GPU timestamp queries and analyze when work is actually in flight. The trace is enabled in standalone ANGLE only using the flag --enable-trace with angle_perftests. You can also optionally specify the trace output file with --trace-file <blah>. The default file is ANGLETrace.json. Bug: angleproject:2781 Change-Id: I871f28545d9bf18220b55aaf69e9554dcb4c834d Reviewed-on: https://chromium-review.googlesource.com/c/1259763 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// angle_perftests_main.cpp
// Entry point for the gtest-based performance tests.
//
#include <gtest/gtest.h>
extern bool g_OnlyOneRunFrame;
extern bool gEnableTrace;
extern const char *gTraceFile;
int main(int argc, char **argv)
{
for (int i = 0; i < argc; ++i)
{
if (strcmp("--one-frame-only", argv[i]) == 0)
{
g_OnlyOneRunFrame = true;
}
if (strcmp("--enable-trace", argv[i]) == 0)
{
gEnableTrace = true;
}
if (strcmp("--trace-file", argv[i]) == 0 && i < argc - 1)
{
gTraceFile = argv[i + 1];
argc++;
}
}
testing::InitGoogleTest(&argc, argv);
testing::AddGlobalTestEnvironment(new testing::Environment());
int rt = RUN_ALL_TESTS();
return rt;
}