Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1626)

Unified Diff: bench/nanobench.cpp

Issue 1554193002: On Valgrind bots, print a message every 20 minutes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Print a message every 20 minutes (looks like valgrind times out after 40 min) Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/nanobench_flags.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 638477ecf6fc8720af438cf07dde48b162fcb19f..b7858983f8ff6cf95bcc367059e6e5d07eb3d757 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -38,6 +38,7 @@
#include "SkString.h"
#include "SkSurface.h"
#include "SkTaskGroup.h"
+#include "SkThreadUtils.h"
#include <stdlib.h>
@@ -106,6 +107,7 @@ DEFINE_int32(flushEvery, 10, "Flush --outResultsFile every Nth run.");
DEFINE_bool(resetGpuContext, true, "Reset the GrContext before running each test.");
DEFINE_bool(gpuStats, false, "Print GPU stats after each gpu benchmark?");
DEFINE_bool(gpuStatsDump, false, "Dump GPU states after each benchmark to json");
+DEFINE_bool(keepAlive, false, "Print a message every so often so that we don't time out");
static double now_ms() { return SkTime::GetNSecs() * 1e-6; }
@@ -972,6 +974,26 @@ private:
int fCurrentAnimSKP;
};
+// Some runs (mostly, Valgrind) are so slow that the bot framework thinks we've hung.
+// This prints something every once in a while so that it knows we're still working.
+static void start_keepalive() {
+ struct Loop {
+ static void forever(void*) {
+ for (;;) {
+ static const int kSec = 1200;
+ #if defined(SK_BUILD_FOR_WIN)
+ Sleep(kSec * 1000);
+ #else
+ sleep(kSec);
+ #endif
+ SkDebugf("\nBenchmarks still running...\n");
+ }
+ }
+ };
+ static SkThread* intentionallyLeaked = new SkThread(Loop::forever);
+ intentionallyLeaked->start();
+}
+
int nanobench_main();
int nanobench_main() {
SetupCrashHandler();
@@ -1042,6 +1064,10 @@ int nanobench_main() {
SkTDArray<Config> configs;
create_configs(&configs);
+ if (FLAGS_keepAlive) {
+ start_keepalive();
+ }
+
int runs = 0;
BenchmarkStream benchStream;
while (Benchmark* b = benchStream.next()) {
« no previous file with comments | « no previous file | tools/nanobench_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698