Revision: 13090
Author:   [email protected]
Date:     Thu Nov 29 04:47:21 2012
Log:      Edited wiki page V8Profiler through web user interface.
http://code.google.com/p/v8/source/detail?r=13090

Modified:
 /wiki/V8Profiler.wiki

=======================================
--- /wiki/V8Profiler.wiki       Thu Jan 21 14:52:00 2010
+++ /wiki/V8Profiler.wiki       Thu Nov 29 04:47:21 2012
@@ -5,40 +5,30 @@
V8 has built-in sample based profiling. Profiling is turned off by default, but can be enabled via the --prof command line option. The sampler records stacks of both JavaScript and C/C++ code.

 = Build =
-V8 must be built with `ENABLE_LOGGING_AND_PROFILING` in order to be used. This macro is defined by default.
+Build the d8 shell following the instructions at [BuildingWithGYP].

-= Windows =
-Symbol resolution is done using a `.MAP` file, so the application must be linked to generate a `.MAP` file containing symbol information. Using the SCons `prof` option will make a `.MAP` file be generated for the target.
-
-{{{
-scons prof=on
-}}}
-
-In Visual Studio 2005 the option for generation a `.MAP` file can be found on the property page under _Configuration Properties->Linker->Debugging_.

 = Command Line =
-To start profiling, use the `--prof` option. When profiling, v8 generates a `v8.log` file which contains profiling data. +To start profiling, use the `--prof` option. When profiling, V8 generates a `v8.log` file which contains profiling data.

 Windows:
 {{{
-v8_shell_sample --prof script.js
+build\Release\d8 --prof script.js
 }}}

-Other platforms:
+Other platforms (replace "ia32" with "x64" if you want to profile the x64 build):
 {{{
-./shell --prof script.js
+out/ia32.release/d8 --prof script.js
 }}}

 = Process the Generated Output =

-Log file processing is done using JS scripts running by the d8 shell. Under Windows the d8 shell must be built manually because there are multiple way of building (SCons, VS.) Under `*`nix-like platforms, the linux-tick-processor script automatically calls SCons in order to build the d8 shell executable. +Log file processing is done using JS scripts running by the d8 shell. For this to work, a `d8` binary (or symlink, or `d8.exe` on Windows) must be in the root of your V8 checkout, or in the path specified by the environment variable `D8_PATH`. Note: this binary is just used to process the log, but not for the actual profiling, so it doesn't matter which version etc. it is.

 Windows:
 {{{
 tools\windows-tick-processor.bat v8.log
 }}}
-
-`windows-tick-processor.bat` script assumes that `d8.exe` resides in the project root directory.

 Linux:
 {{{
@@ -52,7 +42,7 @@

 == Snapshot-based VM build and builtins reporting ==

-When a snapshot-based VM build is being used, code objects from a snapshot that doesn't correspond to function objects are reported with generic names like _"A builtin from the snapshot"_, because their real names are not stored in the snapshot. To see the names the following steps must be taken: +When a snapshot-based VM build is being used, code objects from a snapshot that don't correspond to functions are reported with generic names like _"A builtin from the snapshot"_, because their real names are not stored in the snapshot. To see the names the following steps must be taken:

* `--log-snapshot-positions` flag must be passed to VM (along with `--prof`); this way, for deserialized objects the `(memory address, snapshot offset)` pairs are being emitted into profiler log;

@@ -60,8 +50,8 @@

 An example of usage:
 {{{
-./shell --prof --log-snapshot-positions script.js
-tools/linux-tick-processor --snapshot-log=obj/release/snapshot.log v8.log
+out/ia32.release/d8 --prof --log-snapshot-positions script.js
+tools/linux-tick-processor --snapshot-log=out/ia32.release/obj.target/v8_snapshot/geni/snapshot.log v8.log
 }}}

 = Programmatic Control of Profiling =

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to