Skip to content

Commit 469db02

Browse files
ofrobotsMyles Borins
authored and
Myles Borins
committed
deps: backport 9da3ab6 from V8 upstream
This patch exposes a new flag perf_basic_prof_only_functions (disabled by default) that can be useful for the use-case of running always-on profiling on long running production jobs. Original commit v8/v8@9da3ab6 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} PR-URL: #3609 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trevor Norris <[email protected]>
1 parent 94c2de4 commit 469db02

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

deps/v8/src/flag-definitions.h

+3
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,9 @@ DEFINE_BOOL(ll_prof, false, "Enable low-level linux profiler.")
929929
DEFINE_BOOL(perf_basic_prof, false,
930930
"Enable perf linux profiler (basic support).")
931931
DEFINE_NEG_IMPLICATION(perf_basic_prof, compact_code_space)
932+
DEFINE_BOOL(perf_basic_prof_only_functions, false,
933+
"Only report function code ranges to perf (i.e. no stubs).")
934+
DEFINE_IMPLICATION(perf_basic_prof_only_functions, perf_basic_prof)
932935
DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__",
933936
"Specify the name of the file for fake gc mmap used in ll_prof")
934937
DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.")

deps/v8/src/log.cc

+6
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,12 @@ void PerfBasicLogger::LogRecordedBuffer(Code* code,
290290
int length) {
291291
DCHECK(code->instruction_start() == code->address() + Code::kHeaderSize);
292292

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

0 commit comments

Comments
 (0)