Commit c9fedd25 authored by ssanfilippo's avatar ssanfilippo Committed by Commit bot

[Interpreter] Support Linux perf >= 4.1 in linux_perf_report.py.

Since Linux 4.1, flag -f became -F, but the long option --flags stayed
the same. Using --flags assures compatibility with new and old versions.

Also, symbols appear to be reported as name+offset in newer versions
even when not requested, so we trim the latter part if present.

BUG=v8:4899
LOG=N

Review-Url: https://codereview.chromium.org/2134703002
Cr-Commit-Position: refs/heads/master@{#37614}
parent 120b753f
......@@ -97,7 +97,8 @@ def collapsed_callchains_generator(perf_stream, show_all=False,
if skip_until_end_of_chain:
continue
symbol = line.split(" ", 1)[1]
# Trim the leading address and the trailing +offset, if present.
symbol = line.split(" ", 1)[1].split("+", 1)[0]
if not show_full_signatures:
symbol = strip_function_parameters(symbol)
current_chain.append(symbol)
......@@ -204,7 +205,7 @@ def parse_command_line():
def main():
program_options = parse_command_line()
perf = subprocess.Popen(["perf", "script", "-f", "ip,sym",
perf = subprocess.Popen(["perf", "script", "--fields", "ip,sym",
"-i", program_options.perf_filename],
stdout=subprocess.PIPE)
......
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