Commit e003a456 authored by rmcilroy's avatar rmcilroy Committed by Commit bot

[Tools] Update linux_perf_report to split out GC.

Review-Url: https://codereview.chromium.org/2511553002
Cr-Commit-Position: refs/heads/master@{#41076}
parent 1fe704e1
......@@ -54,6 +54,8 @@ COMPILER_SYMBOLS_RE = re.compile(
r"v8::internal::(?:\(anonymous namespace\)::)?Compile|v8::internal::Parser")
JIT_CODE_SYMBOLS_RE = re.compile(
r"(LazyCompile|Compile|Eval|Script):(\*|~)")
GC_SYMBOLS_RE = re.compile(
r"v8::internal::Heap::CollectGarbage")
def strip_function_parameters(symbol):
......@@ -74,7 +76,7 @@ def strip_function_parameters(symbol):
def collapsed_callchains_generator(perf_stream, hide_other=False,
hide_compiler=False, hide_jit=False,
show_full_signatures=False):
hide_gc=False, show_full_signatures=False):
current_chain = []
skip_until_end_of_chain = False
compiler_symbol_in_chain = False
......@@ -122,6 +124,11 @@ def collapsed_callchains_generator(perf_stream, hide_other=False,
current_chain.append("[jit]")
yield current_chain
skip_until_end_of_chain = True
elif GC_SYMBOLS_RE.match(symbol):
if not hide_gc:
current_chain.append("[gc]")
yield current_chain
skip_until_end_of_chain = True
elif symbol == "Stub:CEntryStub" and compiler_symbol_in_chain:
if not hide_compiler:
current_chain.append("[compiler]")
......@@ -211,6 +218,11 @@ def parse_command_line():
help="Hide samples from JIT code execution",
action="store_true"
)
command_line_parser.add_argument(
"--hide-gc",
help="Hide samples from garbage collection",
action="store_true"
)
command_line_parser.add_argument(
"--show-full-signatures", "-s",
help="show full signatures instead of function names",
......@@ -237,7 +249,8 @@ def main():
callchains = collapsed_callchains_generator(
perf.stdout, program_options.hide_other, program_options.hide_compiler,
program_options.hide_jit, program_options.show_full_signatures)
program_options.hide_jit, program_options.hide_gc,
program_options.show_full_signatures)
if program_options.output_flamegraph:
write_flamegraph_input_file(program_options.output_stream, callchains)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment