Author: [email protected]
Date: Tue Jun 16 05:59:02 2009
New Revision: 2189
Added:
wiki/V8Oprofile.wiki
Log:
Created wiki page through web user interface.
Added: wiki/V8Oprofile.wiki
==============================================================================
--- (empty file)
+++ wiki/V8Oprofile.wiki Tue Jun 16 05:59:02 2009
@@ -0,0 +1,101 @@
+#summary Profiling V8 Using OProfile.
+
+= Introduction =
+
+V8 supports profiling using OProfile through a OProfile agent for handling
dynamically generated code together with the staticly compiled code.
+
+= Requirements =
+OProfile version 0.9.4 or higher is required as this is the first version
with support for dynamically generated (through the JIT API). As V8
currently support only 32-bit a 32-bit version of the OProfile and its
agent library is required. This includes the libraries that OProfile
depends in 32-bit as well.
+
+= Build =
+
+V8 must be built with `ENABLE_LOGGING_AND_PROFILING` and
`ENABLE_OPROFILE_AGENT` in order to be used with OProfile.
`ENABLE_LOGGING_AND_PROFILING` is defined by default and
`ENABLE_OPROFILE_AGENT` will be defined by adding the option
`prof=oprofile` to the SCons build.
+
+{{{
+scons prof=oprofile
+}}}
+
+= Command Line =
+
+To profile using OProfile, use the `--prof=oprofile` option to enable the
OProfile agent in V8. If V8 is build without OProfile support and the
option `--prof=oprofile` is passed a warning is issued.
+
+{{{
+./shell --prof=oprofile script.js
+}}}
+
+OProfile currently doesn't support code moving around. To avoid this
happening in V8 whilr profiling the `--oprofile` flag automatically
disables code moving by setting the `--never-compact` flag.
+
+= OProfile Utility Scripts =
+
+To avoid using the native OProfile commands a number of OProfile utility
scripts is available in `tools/oprofile`.
+
+To profile running the JavaScript file `script.js` using the V8 release
mode
+shell (assuming it is build passing `prof=oprofile` to the SCons build).
The
+following commands can be used:
+
+{{{
+tools/oprofile/start
+tools/oprofile/run script.js
+tools/oprofile/report | less
+tools/oprofile/annotate | less
+tools/oprofile/shutdown
+}}}
+
+For all the commands taking an executable the executable is expected to be
+a binary using V8. If no executable is specified the release mode V8 shell
+will be used.
+
+By default the `--session-dir=/tmp/oprofv8` is passed to all OProfile
+commands. This value can be changed by setting environment variable
+`OPROFILE_SESSION_DIR`.
+
+When using the default executable (V8 shell in release mode) it is assumed
+to be located in `../..` relative from the OProfile utility scripts (V8
repository root). This default location can be overridden using the
`V8_SHELL_DIR` environment
+variable.
+
+=== Start the OProfile daemon ===
+{{{
+tools/oprofile/start
+}}}
+
+=== Profile V8 Executable ===
+Profile a V8 executable. Running this will reset OProfile samples, run the
+command and do an OProfile dump to flush samples and write ELF binaries for
+the generated code. The parameters are passed to the executable together
+with the `--oprofile` option.
+
+{{{
+tools/oprofile/run [executable] [parameters]
+}}}
+
+=== Generate Profile Report ===
+Print the report for a profile run. The parameters are passed to
`opreport`.
+E.g `report --callgraph`.
+{{{
+tools/oprofile/report [executable] [parameters]
+}}}
+
+=== Generate Annotated Code Report ===
+Print annotated assembly for a profile run. The parameters are passed to
+`opannotate`. E.g `annotate -threshold 1`.
+{{{
+annotate [executable] [parameters]
+}}}
+
+=== Reset OProfile Samples ===
+{{{
+tools/oprofile/reset
+}}}
+As this is done automatically when using `run` running this is normally
not required.
+
+=== Flush OProfile Samples ===
+Flush OProfile samples and write ELF binaries for the generated code.
Running this is required for including the generated code in the reports
produced by `report`and `annotate`. When using `run` the OProfile samples
are automatically flushed.
+{{{
+tools/oprofile/dump
+}}}
+As this is done automatically when using `run` running this is normally
not required.
+
+=== Shutdown OProfile Daemon ===
+{{{
+tools/oprofile/shutdown
+}}}
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---