Support for the Linux 'perf report' and 'perf annotate' tools.
authorjarin@chromium.org <jarin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 25 Nov 2013 06:44:23 +0000 (06:44 +0000)
committerjarin@chromium.org <jarin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 25 Nov 2013 06:44:23 +0000 (06:44 +0000)
commit4e439deb0b6fb83449ab1a16c9761926ac0f65dc
tree96e44391d9a9aa392e8e38b7d5d929ca46aeb325
parent21dca31203c3efdca1a577214a534fb2dfacbce0
Support for the Linux 'perf report' and 'perf annotate' tools.

In this change, the support comes in two flavours:

--perf_jit_prof - outputs the files in a new perf format that only works with a
patched perf tool (patch obtained from Stephane Eranian). Both 'perf report' and
'perf annotate' are supported (the file format also contains the machine code).

--perf_basic_prof - outputs the files in a format that the existing perf tool
can consume. Only 'perf report' is supported.

In both cases, we have to disable code compaction because the perf tool does not
understand code relocation. (We are told that code relocation should be
supported soon.)

Usage:

perf record -g d8 --perf_jit_prof --no_compact_code_space my.js
perf report

The change itself is straightforward - we simply listen to code events and
write an entry to a log file for every new piece of code.

I am not yet sure whether we should keep both versions or just one (and which
one). My hope is the reviewers can help here.

R=danno@chromium.org
BUG=

Review URL: https://codereview.chromium.org/70013002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18034 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/flag-definitions.h
src/isolate.cc
src/log-utils.h
src/log.cc
src/log.h