Lines Matching +full:- +full:gninja

13 ------------------
16 Clang that supports the ``-fxray-instrument`` option. See `XRay <XRay.html>`_
19 In our example, we need to add ``-fxray-instrument`` to the list of flags
26 $ mkdir -p llvm-build && cd llvm-build
28 $ cmake -GNinja ../llvm -DCMAKE_BUILD_TYPE=Release \
29 -DCMAKE_C_FLAGS_RELEASE="-fxray-instrument" -DCMAKE_CXX_FLAGS="-fxray-instrument" \
39 $ objdump -h -j xray_instr_map ./bin/llc
40 ./bin/llc: file format elf64-x86-64
48 --------------
63 $ XRAY_OPTIONS="patch_premain=true xray_mode=xray-basic verbosity=1" ./bin/llc input.ll
64 ==69819==XRay: Log file in 'xray-log.llc.m35qPB'
68 The ``llvm-xray`` Tool
69 ----------------------
73 sense of this data, we use the ``llvm-xray`` tool which has a few subcommands
77 been instrumented. We can see an example accounting with ``llvm-xray account``:
81 $ llvm-xray account xray-log.llc.m35qPB --top=10 --sort=sum --sortorder=dsc --instr_map=./bin/llc
98 ``-format=csv`` option to the command for further analysis.
101 ``llvm-xray convert`` tool to get YAML output. The first few lines of that
106 $ llvm-xray convert -f yaml --symbolize --instr_map=./bin/llc xray-log.llc.m35qPB
107 ---
111 constant-tsc: true
112 nonstop-tsc: true
113 cycle-frequency: 2601000000
115- { type: 0, func-id: 110, function: __cxx_global_var_init.8, cpu: 37, thread: 69819, kind: functi…
116- { type: 0, func-id: 110, function: __cxx_global_var_init.8, cpu: 37, thread: 69819, kind: functi…
117- { type: 0, func-id: 164, function: __cxx_global_var_init, cpu: 37, thread: 69819, kind: function
118- { type: 0, func-id: 164, function: __cxx_global_var_init, cpu: 37, thread: 69819, kind: function
119- { type: 0, func-id: 142, function: '(anonymous namespace)::CommandLineParser::ParseCommandLineOp…
120- { type: 0, func-id: 142, function: '(anonymous namespace)::CommandLineParser::ParseCommandLineOp…
121- { type: 0, func-id: 187, function: 'llvm::LLLexer::LexIdentifier()', cpu: 37, thread: 69819, kin…
122- { type: 0, func-id: 187, function: 'llvm::LLLexer::LexIdentifier()', cpu: 37, thread: 69819, kin…
123- { type: 0, func-id: 187, function: 'llvm::LLLexer::LexIdentifier()', cpu: 37, thread: 69819, kin…
124- { type: 0, func-id: 187, function: 'llvm::LLLexer::LexIdentifier()', cpu: 37, thread: 69819, kin…
125- { type: 0, func-id: 187, function: 'llvm::LLLexer::LexIdentifier()', cpu: 37, thread: 69819, kin…
126- { type: 0, func-id: 187, function: 'llvm::LLLexer::LexIdentifier()', cpu: 37, thread: 69819, kin…
129 --------------------
141 ``-fxray-instruction-threshold=N`` flag when building our binary. We rebuild
147 $ cmake -GNinja ../llvm -DCMAKE_BUILD_TYPE=Release \
148 -DCMAKE_C_FLAGS_RELEASE="-fxray-instrument -fxray-instruction-threshold=1" \
149 -DCMAKE_CXX_FLAGS="-fxray-instrument -fxray-instruction-threshold=1"
152 ==69819==XRay: Log file in 'xray-log.llc.5rqxkU'
154 $ llvm-xray account xray-log.llc.5rqxkU --top=10 --sort=sum --sortorder=dsc --instr_map=./bin/llc
184 # xray-attr-list.txt
193 Given the file above we can re-build by providing it to the
194 ``-fxray-attr-list=`` flag to clang. You can have multiple files, each defining
198 -------------------
200 Given a trace, and optionally an instrumentation map, the ``llvm-xray stack``
208 $ llvm-xray stack xray-log.llc.5rqxkU --instr_map=./bin/llc
230 To address this, you may specify the ``--aggregate-threads`` or
231 ``--per-thread-stacks`` flags. ``--per-thread-stacks`` treats the thread id as an
232 implicit root in each call stack tree, while ``--aggregate-threads`` combines
236 ----------------------
238 The ``llvm-xray stack`` tool may also be used to generate flamegraphs for
246 - ``--all-stacks`` - Emits all of the stacks.
247 - ``--stack-format`` - Choose the flamegraph output format 'flame'.
248 - ``--aggregation-type`` - Choose the metric to graph.
255 …$ llvm-xray stack xray-log.llc.5rqxkU --instr_map=./bin/llc --stack-format=flame --aggregation-typ…
261 ---------------------------------
268 $ llvm-xray convert --symbolize --instr_map=./bin/llc \
269 --output-format=trace_event xray-log.llc.5rqxkU \
270 | gzip > llc-trace.txt.gz
273 the ``sample-trace.txt.gz`` file to visualize the execution trace.
276 -------------------
278 The ``llvm-xray`` tool has a few other subcommands that are in various stages
285 .. code-block:: c++
297 std::cerr << '-';
318 $ clang++ -o sample -O3 sample.cc -std=c++11 -fxray-instrument -fxray-instruction-threshold=1
319 $ XRAY_OPTIONS="patch_premain=true xray_mode=xray-basic" ./sample
324 the graph using another tool, then that should be feasible as well. ``llvm-xray
326 rendering applications. One example invocation of the ``llvm-xray graph``
332 $ llvm-xray graph xray-log.sample.* -m sample --color-edges=sum --edge-label=sum \
333 | unflatten -f -l10 | dot -Tsvg -o sample.svg
337 ----------
340 llvm-xray tool, please feel free to propose them on the llvm-dev@ mailing list.
344 - Implement a query/filtering library that allows for finding patterns in the
346 - Collecting function call stacks and how often they're encountered in the