• jarin's avatar
    Linux perf integration with the new support for JIT. · 82e95f59
    jarin authored
    Difference from --perf-basic-prof:
    - correctly attributes samples when code space gets reused (when unused code object dies and a new code objects is allocated at the same place).
    - outputs compiled machine code for instruction-level profile.
    
    Just like --perf-basic-prof, the file writer is not synchronized (even worse, there is a per-isolate file handle), so we will run into trouble with multiple isolates. However, this patch is still an improvement on --perf-basic-prof, and it should be fine to replace ll-prof.
    
    The patch also introduces experimental support for debug info, but it does not seem to be picked by the perf tool.
    
    Usage:
    
    You need the perf tool from Linux kernel >4.5. Then run:
    
    $ perf record -k mono d8 --perf-prof <your JS file>
    $ perf inject -j -i perf.data -o perf.data.jitted
    $ perf report -i perf.data.jitted
    
    Some explanations:
    The "-k mono" switch from "perf record" tells the perf tool to use the monotonic clock for perf sample timestamping. The "perf inject -j" command injects the collected code events into the perf data file, writing the output into perf.data.jitted. The perf report command then creates the report.
    
    Review URL: https://codereview.chromium.org/1809203007
    
    Cr-Commit-Position: refs/heads/master@{#35091}
    82e95f59
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
docs Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...