Hash :
4e7a6a69
Author :
Date :
2020-07-15T19:35:43
Perf Tests: Fix trace test calibration. The trace tests were including the startup time in their calibration calculations. Then was forcing them to always render one step. This fixes the calibration to attempt to get a more consistent measurement. The trace tests now render many more steps than they did before. It should increase the stability and decrease variance in our measurements as they will be runnnig many more frames than before. Also adds a verbose logging flag to help debugging. Noticed this bug when working on the trace test offscreen mode. Bug: angleproject:4845 Change-Id: Iff0c987008a935e7051fca34ef12f4433eb46092 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2300205 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@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 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
//
// Copyright 2019 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.
//
// ANGLEPerfTestArgs.cpp:
// Parse command line arguments for angle_perftests.
//
#include "ANGLEPerfTestArgs.h"
#include <string.h>
#include <sstream>
namespace angle
{
bool gCalibration = false;
int gStepsToRunOverride = -1;
bool gEnableTrace = false;
const char *gTraceFile = "ANGLETrace.json";
const char *gScreenShotDir = nullptr;
bool gVerboseLogging = false;
} // namespace angle
using namespace angle;
void ANGLEProcessPerfTestArgs(int *argc, char **argv)
{
int argcOutCount = 0;
for (int argIndex = 0; argIndex < *argc; argIndex++)
{
if (strcmp("--one-frame-only", argv[argIndex]) == 0)
{
gStepsToRunOverride = 1;
}
else if (strcmp("--enable-trace", argv[argIndex]) == 0)
{
gEnableTrace = true;
}
else if (strcmp("--trace-file", argv[argIndex]) == 0 && argIndex < *argc - 1)
{
gTraceFile = argv[argIndex + 1];
// Skip an additional argument.
argIndex++;
}
else if (strcmp("--calibration", argv[argIndex]) == 0)
{
gCalibration = true;
}
else if (strcmp("--steps", argv[argIndex]) == 0 && argIndex < *argc - 1)
{
unsigned int stepsToRun = 0;
std::stringstream strstr;
strstr << argv[argIndex + 1];
strstr >> stepsToRun;
gStepsToRunOverride = stepsToRun;
// Skip an additional argument.
argIndex++;
}
else if (strcmp("--screenshot-dir", argv[argIndex]) == 0 && argIndex < *argc - 1)
{
gScreenShotDir = argv[argIndex + 1];
argIndex++;
}
else if (strcmp("--verbose-logging", argv[argIndex]) == 0)
{
gVerboseLogging = true;
}
else
{
argv[argcOutCount++] = argv[argIndex];
}
}
*argc = argcOutCount;
}