Go to file
Keith Wyss 9420ec3378 [XRay][tools] Function call stack based analysis tooling for XRay traces
Second try after fixing a code san problem with iterator reference types.

This change introduces a subcommand to the llvm-xray tool called
"stacks" which allows for analysing XRay traces provided as inputs and
accounting time to stacks instead of just individual functions. This
gives us a more precise view of where in a program the latency is
actually attributed.

The tool uses a trie data structure to keep track of the caller-callee
relationships as we process the XRay traces. In particular, we keep
track of the function call stack as we enter functions. While we're
doing this we're adding nodes in a trie and indicating a "calls"
relatinship between the caller (current top of the stack) and the callee
(the new top of the stack). When we push function ids onto the stack, we
keep track of the timestamp (TSC) for the enter event.

When exiting functions, we are able to account the duration by getting
the difference between the timestamp of the exit event and the
corresponding entry event in the stack. This works even if we somehow
miss the exit events for intermediary functions (i.e. if the exit event
is not cleanly associated with the enter event at the top of the stack).

The output of the tool currently provides just the top N leaf functions
that contribute the most latency, and the top N stacks that have the
most frequency. In the future we can provide more sophisticated query
mechanisms and potentially an export to database feature to make offline
analysis of the stack traces possible with existing tools.

Differential revision: D34863

llvm-svn: 312733
2017-09-07 18:07:48 +00:00
clang [OpenCL] Handle taking an address of block captures. 2017-09-07 17:00:33 +00:00
clang-tools-extra Make run-clang-tidy compatible with Python 3.x 2017-09-05 12:36:33 +00:00
compiler-rt [libFuzzer] simplify CustomCrossOverTest even more 2017-09-07 05:33:05 +00:00
debuginfo-tests Fix debuginfo-tests with GDB on Linux 2017-08-31 18:16:55 +00:00
libclc amdgcn,waitcnt: Add datalayout info 2017-09-04 15:52:07 +00:00
libcxx Add even more string_view tests. These found some bugs in the default parameter value for rfind/find_last_of/find_last_not_of 2017-09-07 04:19:32 +00:00
libcxxabi Revert "[libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_return" 2017-09-06 03:00:42 +00:00
libunwind Revert r312240 2017-08-31 15:51:23 +00:00
lld [ELF] Always write non-immediate bits for AArch64 branch instruction. 2017-09-07 16:29:52 +00:00
lldb Fix lldb-mi test data_read_memory_bytes_global 2017-09-07 16:24:39 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [XRay][tools] Function call stack based analysis tooling for XRay traces 2017-09-07 18:07:48 +00:00
openmp Read blocktime value set by kmp_set_blocktime() before reading from KMP_BLOCKTIME 2017-09-05 15:45:48 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [CodeGen] Bitcast scalar writes to actual value. 2017-09-07 12:15:01 +00:00