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

Unified Diff: src/runtime/runtime-internal.cc

Issue 1967123002: Add callstats.py run --refresh flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 7 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 | « src/runtime/runtime.h ('k') | tools/callstats.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-internal.cc
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc
index 54337bf86dfbf99e6a12e955356371b103b664f5..e3890df342ed414eeb68aa9425755d46a737f10f 100644
--- a/src/runtime/runtime-internal.cc
+++ b/src/runtime/runtime-internal.cc
@@ -550,7 +550,7 @@ RUNTIME_FUNCTION(Runtime_GetAndResetRuntimeCallStats) {
isolate->counters()->runtime_call_stats()->Reset();
return *result;
} else {
- DCHECK_EQ(1, args.length());
+ DCHECK_LE(args.length(), 2);
std::FILE* f;
if (args[0]->IsString()) {
// With a string argument, the results are appended to that file.
@@ -566,6 +566,13 @@ RUNTIME_FUNCTION(Runtime_GetAndResetRuntimeCallStats) {
DCHECK(fd == 1 || fd == 2);
f = fd == 1 ? stdout : stderr;
}
+ // The second argument (if any) is a message header to be printed.
+ if (args.length() >= 2) {
+ CONVERT_ARG_HANDLE_CHECKED(String, arg1, 1);
+ arg1->PrintOn(f);
+ std::fputc('\n', f);
+ std::fflush(f);
+ }
OFStream stats_stream(f);
isolate->counters()->runtime_call_stats()->Print(stats_stream);
isolate->counters()->runtime_call_stats()->Reset();
« no previous file with comments | « src/runtime/runtime.h ('k') | tools/callstats.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698