Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #include "CrashHandler.h" | 1 #include "CrashHandler.h" |
| 2 #include "DMJsonWriter.h" | 2 #include "DMJsonWriter.h" |
| 3 #include "DMSrcSink.h" | 3 #include "DMSrcSink.h" |
| 4 #include "OverwriteLine.h" | 4 #include "OverwriteLine.h" |
| 5 #include "ProcStats.h" | 5 #include "ProcStats.h" |
| 6 #include "SkBBHFactory.h" | 6 #include "SkBBHFactory.h" |
| 7 #include "SkChecksum.h" | 7 #include "SkChecksum.h" |
| 8 #include "SkCommonFlags.h" | 8 #include "SkCommonFlags.h" |
| 9 #include "SkForceLinking.h" | 9 #include "SkForceLinking.h" |
| 10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 static SkTArray<SkString> gFailures; | 41 static SkTArray<SkString> gFailures; |
| 42 | 42 |
| 43 static void fail(ImplicitString err) { | 43 static void fail(ImplicitString err) { |
| 44 SkAutoMutexAcquire lock(gFailuresMutex); | 44 SkAutoMutexAcquire lock(gFailuresMutex); |
| 45 SkDebugf("\n\nFAILURE: %s\n\n", err.c_str()); | 45 SkDebugf("\n\nFAILURE: %s\n\n", err.c_str()); |
| 46 gFailures.push_back(err); | 46 gFailures.push_back(err); |
| 47 } | 47 } |
| 48 | 48 |
| 49 static int32_t gPending = 0; // Atomic. | 49 static int32_t gPending = 0; // Atomic. |
| 50 | 50 |
| 51 static void done(double ms, ImplicitString config, ImplicitString src, ImplicitS tring name) { | 51 static void done(double ms, ImplicitString config, ImplicitString src, ImplicitS tring name, |
| 52 ImplicitString verboseLog) { | |
| 52 int32_t pending = sk_atomic_dec(&gPending)-1; | 53 int32_t pending = sk_atomic_dec(&gPending)-1; |
| 53 SkDebugf("%s(%4dMB %5d) %s\t%s %s %s ", FLAGS_verbose ? "\n" : kSkOverwrite Line | 54 SkDebugf("%s(%4dMB %5d) %s\t%s %s %s ", FLAGS_verbose ? "\n" : kSkOverwrite Line |
|
mtklein
2015/02/02 16:23:17
I think you'll have a better time if we log everyt
| |
| 54 , sk_tools::getMaxResidentSetSizeMB() | 55 , sk_tools::getMaxResidentSetSizeMB() |
| 55 , pending | 56 , pending |
| 56 , HumanizeMs(ms).c_str() | 57 , HumanizeMs(ms).c_str() |
| 57 , config.c_str() | 58 , config.c_str() |
| 58 , src.c_str() | 59 , src.c_str() |
| 59 , name.c_str()); | 60 , name.c_str()); |
| 61 if (FLAGS_verbose && !verboseLog.isEmpty()) { | |
| 62 SkDebugf("\n%s", verboseLog.c_str()); | |
| 63 } | |
| 60 // We write our dm.json file every once in a while in case we crash. | 64 // We write our dm.json file every once in a while in case we crash. |
| 61 // Notice this also handles the final dm.json when pending == 0. | 65 // Notice this also handles the final dm.json when pending == 0. |
| 62 if (pending % 500 == 0) { | 66 if (pending % 500 == 0) { |
| 63 JsonWriter::DumpJson(); | 67 JsonWriter::DumpJson(); |
| 64 } | 68 } |
| 65 } | 69 } |
| 66 | 70 |
| 67 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ | 71 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ |
| 68 | 72 |
| 69 struct Gold : public SkString { | 73 struct Gold : public SkString { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 SkASSERT(bitmap.drawsNothing()); | 347 SkASSERT(bitmap.drawsNothing()); |
| 344 } else if (!bitmap.drawsNothing()) { | 348 } else if (!bitmap.drawsNothing()) { |
| 345 WriteToDisk(*task, md5, ext, NULL, 0, &bitmap); | 349 WriteToDisk(*task, md5, ext, NULL, 0, &bitmap); |
| 346 } | 350 } |
| 347 } | 351 } |
| 348 } | 352 } |
| 349 timer.end(); | 353 timer.end(); |
| 350 if (!whyBlacklisted.isEmpty()) { | 354 if (!whyBlacklisted.isEmpty()) { |
| 351 name.appendf(" (--blacklist, %s)", whyBlacklisted.c_str()); | 355 name.appendf(" (--blacklist, %s)", whyBlacklisted.c_str()); |
| 352 } | 356 } |
| 353 done(timer.fWall, task->sink.tag, task->src.tag, name); | 357 done(timer.fWall, task->sink.tag, task->src.tag, name, task->sink->verbo seLog()); |
| 354 } | 358 } |
| 355 | 359 |
| 356 static void WriteToDisk(const Task& task, | 360 static void WriteToDisk(const Task& task, |
| 357 SkString md5, | 361 SkString md5, |
| 358 const char* ext, | 362 const char* ext, |
| 359 SkStream* data, size_t len, | 363 SkStream* data, size_t len, |
| 360 const SkBitmap* bitmap) { | 364 const SkBitmap* bitmap) { |
| 361 JsonWriter::BitmapResult result; | 365 JsonWriter::BitmapResult result; |
| 362 result.name = task.src->name(); | 366 result.name = task.src->name(); |
| 363 result.config = task.sink.tag; | 367 result.config = task.sink.tag; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 } | 468 } |
| 465 bool verbose() const SK_OVERRIDE { return FLAGS_veryVerbose; } | 469 bool verbose() const SK_OVERRIDE { return FLAGS_veryVerbose; } |
| 466 } reporter; | 470 } reporter; |
| 467 WallTimer timer; | 471 WallTimer timer; |
| 468 timer.start(); | 472 timer.start(); |
| 469 if (!FLAGS_dryRun) { | 473 if (!FLAGS_dryRun) { |
| 470 GrContextFactory factory; | 474 GrContextFactory factory; |
| 471 test->proc(&reporter, &factory); | 475 test->proc(&reporter, &factory); |
| 472 } | 476 } |
| 473 timer.end(); | 477 timer.end(); |
| 474 done(timer.fWall, "unit", "test", test->name); | 478 done(timer.fWall, "unit", "test", test->name, ""); |
| 475 } | 479 } |
| 476 | 480 |
| 477 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ | 481 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ |
| 478 | 482 |
| 479 // If we're isolating all GPU-bound work to one thread (the default), this funct ion runs all that. | 483 // If we're isolating all GPU-bound work to one thread (the default), this funct ion runs all that. |
| 480 static void run_enclave_and_gpu_tests(SkTArray<Task>* tasks) { | 484 static void run_enclave_and_gpu_tests(SkTArray<Task>* tasks) { |
| 481 run_enclave(tasks); | 485 run_enclave(tasks); |
| 482 for (int i = 0; i < gGPUTests.count(); i++) { | 486 for (int i = 0; i < gGPUTests.count(); i++) { |
| 483 run_test(&gGPUTests[i]); | 487 run_test(&gGPUTests[i]); |
| 484 } | 488 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 } | 548 } |
| 545 return 0; | 549 return 0; |
| 546 } | 550 } |
| 547 | 551 |
| 548 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 552 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 549 int main(int argc, char** argv) { | 553 int main(int argc, char** argv) { |
| 550 SkCommandLineFlags::Parse(argc, argv); | 554 SkCommandLineFlags::Parse(argc, argv); |
| 551 return dm_main(); | 555 return dm_main(); |
| 552 } | 556 } |
| 553 #endif | 557 #endif |
| OLD | NEW |