Skip to content

Commit 9da3ab6

Browse files
ofrobotsCommit bot
authored andcommitted
New flag --perf_basic_prof_only_functions
Restricts linux perf-event code range reporting to functions only (i.e. on stubs.) While this makes the gathered ticks less accurate, it reduces the growth of the /tmp/perf-${pid}.map file. BUG=v8:3453 [email protected],[email protected] LOG=N Review URL: https://codereview.chromium.org/1292743002 Cr-Commit-Position: refs/heads/master@{#30179}
1 parent 0c5fbd3 commit 9da3ab6

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/flag-definitions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,9 @@ DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.")
943943
DEFINE_BOOL(perf_basic_prof, false,
944944
"Enable perf linux profiler (basic support).")
945945
DEFINE_NEG_IMPLICATION(perf_basic_prof, compact_code_space)
946+
DEFINE_BOOL(perf_basic_prof_only_functions, false,
947+
"Only report function code ranges to perf (i.e. no stubs).")
948+
DEFINE_IMPLICATION(perf_basic_prof_only_functions, perf_basic_prof)
946949
DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__",
947950
"Specify the name of the file for fake gc mmap used in ll_prof")
948951
DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.")

src/log.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ void PerfBasicLogger::LogRecordedBuffer(Code* code,
288288
int length) {
289289
DCHECK(code->instruction_start() == code->address() + Code::kHeaderSize);
290290

291+
if (FLAG_perf_basic_prof_only_functions &&
292+
(code->kind() != Code::FUNCTION &&
293+
code->kind() != Code::OPTIMIZED_FUNCTION)) {
294+
return;
295+
}
296+
291297
base::OS::FPrint(perf_output_handle_, "%llx %x %.*s\n",
292298
reinterpret_cast<uint64_t>(code->instruction_start()),
293299
code->instruction_size(), length, name);

0 commit comments

Comments
 (0)