OLD | NEW |
1 Turbolizer | 1 Turbolizer |
2 ========== | 2 ========== |
3 | 3 |
4 Turbolizer is a HTML-based tool that visualizes optimized code along the various | 4 Turbolizer is a HTML-based tool that visualizes optimized code along the various |
5 phases of Turbofan's optimization pipeline, allowing easy navigation between | 5 phases of Turbofan's optimization pipeline, allowing easy navigation between |
6 source code, Turbofan IR graphs, scheduled IR nodes and generated assembly code. | 6 source code, Turbofan IR graphs, scheduled IR nodes and generated assembly code. |
7 | 7 |
8 Turbolizer consumes .json files that are generated per-function by d8 by passing | 8 Turbolizer consumes .json files that are generated per-function by d8 by passing |
9 the '--trace-turbo' command-line flag. | 9 the '--trace-turbo' command-line flag. |
10 | 10 |
11 Host the turbolizer locally by starting a web server that serves the contents of | 11 Host the turbolizer locally by starting a web server that serves the contents of |
12 the turbolizer directory, e.g.: | 12 the turbolizer directory, e.g.: |
13 | 13 |
14 cd src/tools/turbolizer | 14 cd src/tools/turbolizer |
15 python -m SimpleHTTPServer 8000 | 15 python -m SimpleHTTPServer 8000 |
16 | 16 |
17 Optionally, profiling data generated by the perf tools in linux can be merged | 17 Optionally, profiling data generated by the perf tools in linux can be merged |
18 with the .json files using the perf-turbo.py file included. The following | 18 with the .json files using the turbolizer-perf.py file included. The following |
19 command is an example of using the perf script: | 19 command is an example of using the perf script: |
20 | 20 |
21 perf script -i perf.data.jitted -s perf-turbo.py turbo-main.json | 21 perf script -i perf.data.jitted -s turbolizer-perf.py turbo-main.json |
22 | 22 |
23 The output of the above command is a json object that can be piped to a file | 23 The output of the above command is a json object that can be piped to a file |
24 which, when uploaded to turbolizer, will display the event counts from perf next | 24 which, when uploaded to turbolizer, will display the event counts from perf next |
25 to each instruction in the disassembly. Further detail can be found in the | 25 to each instruction in the disassembly. Further detail can be found in the |
26 bottom of this document under "Using Perf with Turbo." | 26 bottom of this document under "Using Perf with Turbo." |
27 | 27 |
28 Using the python interface in perf script requires python-dev to be installed | 28 Using the python interface in perf script requires python-dev to be installed |
29 and perf be recompiled with python support enabled. Once recompiled, the | 29 and perf be recompiled with python support enabled. Once recompiled, the |
30 variable PERF_EXEC_PATH must be set to the location of the recompiled perf | 30 variable PERF_EXEC_PATH must be set to the location of the recompiled perf |
31 binaries. | 31 binaries. |
(...skipping 11 matching lines...) Expand all Loading... |
43 | 43 |
44 In order to generate perf data that matches exactly with the turbofan trace, you | 44 In order to generate perf data that matches exactly with the turbofan trace, you |
45 must use either a debug build of v8 or a release build with the flag | 45 must use either a debug build of v8 or a release build with the flag |
46 'disassembler=on'. This flag ensures that the '--trace-turbo' will output the | 46 'disassembler=on'. This flag ensures that the '--trace-turbo' will output the |
47 necessary disassembly for linking with the perf profile. | 47 necessary disassembly for linking with the perf profile. |
48 | 48 |
49 The basic example of generating the required data is as follows: | 49 The basic example of generating the required data is as follows: |
50 | 50 |
51 perf record -k mono /path/to/d8 --turbo --trace-turbo --perf-prof main.js | 51 perf record -k mono /path/to/d8 --turbo --trace-turbo --perf-prof main.js |
52 perf inject -j -i perf.data -o perf.data.jitted | 52 perf inject -j -i perf.data -o perf.data.jitted |
53 perf script -i perf.data.jitted -s perf-turbo.py turbo-main.json | 53 perf script -i perf.data.jitted -s turbolizer-perf.py turbo-main.json |
54 | 54 |
55 These commands combined will run and profile d8, merge the output into a single | 55 These commands combined will run and profile d8, merge the output into a single |
56 'perf.data.jitted' file, then take the event data from that and link them to the | 56 'perf.data.jitted' file, then take the event data from that and link them to the |
57 disassembly in the 'turbo-main.json'. Note that, as above, the output of the | 57 disassembly in the 'turbo-main.json'. Note that, as above, the output of the |
58 script command must be piped to a file for uploading to turbolizer. | 58 script command must be piped to a file for uploading to turbolizer. |
59 | 59 |
60 There are many options that can be added to the first command, for example '-e' | 60 There are many options that can be added to the first command, for example '-e' |
61 can be used to specify the counting of specific events (default: cycles), as | 61 can be used to specify the counting of specific events (default: cycles), as |
62 well as '--cpu' to specify which CPU to sample. | 62 well as '--cpu' to specify which CPU to sample. |
OLD | NEW |