|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init |
|
| #
d30fd5c3 |
| 29-Jun-2022 |
Gaurav Gaur <[email protected]> |
[trace][intel pt] Add a cgroup filter
It turns out that cgroup filtering is relatively trivial and works really nicely. Thid diffs adds automatic cgroup filtering when in per-cpu mode, unless a new
[trace][intel pt] Add a cgroup filter
It turns out that cgroup filtering is relatively trivial and works really nicely. Thid diffs adds automatic cgroup filtering when in per-cpu mode, unless a new --disable-cgroup-filtering flag is passed in the start command. At least on Meta machines, all processes are spawned inside a cgroup by default, which comes super handy, because per cpu tracing is now much more precise.
A manual test gave me this result
- Without filtering: Total number of trace items: 36083 Total number of continuous executions found: 229 Number of continuous executions for this thread: 2 Total number of PSB blocks found: 98 Number of PSB blocks for this thread 2 Total number of unattributed PSB blocks found: 38
- With filtering: Total number of trace items: 87756 Total number of continuous executions found: 123 Number of continuous executions for this thread: 2 Total number of PSB blocks found: 10 Number of PSB blocks for this thread 3 Total number of unattributed PSB blocks found: 2
Filtering gives us great results. The number of instructions collected more than double (probalby because we have less noise in the trace), and we have much less unattributed PSBs blocks and unrelated PSBs in general. The ones that are unrelated probably belong to other processes in the same cgroup.
Differential Revision: https://reviews.llvm.org/D129257
show more ...
|
|
Revision tags: llvmorg-14.0.6 |
|
| #
6a5355e8 |
| 14-Jun-2022 |
Walter Erquinigo <[email protected]> |
[trace][intelpt] Support system-wide tracing [20] - Rename some fields in the schema
As discusses offline with @jj10305, we are updating some naming used throughout the code, specially in the json s
[trace][intelpt] Support system-wide tracing [20] - Rename some fields in the schema
As discusses offline with @jj10305, we are updating some naming used throughout the code, specially in the json schema
- traceBuffer -> iptTrace - core -> cpu
Differential Revision: https://reviews.llvm.org/D127817
show more ...
|
| #
561a61fb |
| 13-Jun-2022 |
Walter Erquinigo <[email protected]> |
[trace][intelpt] Support system-wide tracing [18] - some more improvements
This applies the changes requested for diff 12.
- use DenseMap<ConstString, _> instead of std::unordered_map<ConstString,
[trace][intelpt] Support system-wide tracing [18] - some more improvements
This applies the changes requested for diff 12.
- use DenseMap<ConstString, _> instead of std::unordered_map<ConstString, _>, which is more idiomatic and possibly performant. - deduplicate some code in Trace.cpp by using helper functions for fetching in maps - stop using size and offset when fetching binary data, because we in fact read the entire buffers all the time. If we ever need streaming, we can implement it then. Now, the size is used only to check that we are getting the correct amount of data. This is useful because in some cases determining the size doesn't involve fetching the actual data. - added back the x86_64 macro to the perf tests - added more documentation - simplified some file handling - fixed some comments
Differential Revision: https://reviews.llvm.org/D127752
show more ...
|
|
Revision tags: llvmorg-14.0.5, llvmorg-14.0.4 |
|
| #
fc5ef57c |
| 19-May-2022 |
Walter Erquinigo <[email protected]> |
[trace][intelpt] Support system-wide tracing [12] - Support multi-core trace load and save
:q! This diff is massive, but it's because it connects the client with lldb-server and also ensures that th
[trace][intelpt] Support system-wide tracing [12] - Support multi-core trace load and save
:q! This diff is massive, but it's because it connects the client with lldb-server and also ensures that the postmortem case works.
- Flatten the postmortem trace schema. The reason is that the schema has become quite complex due to the new multicore case, which defeats the original purpose of having a schema that could work for every trace plug-in. At this point, it's better that each trace plug-in defines it's own full schema. This means that the only common field is "type". -- Because of this new approach, I merged the "common" trace load and saving functionalities into the IntelPT one. This simplified the code quite a bit. If we eventually implement another trace plug-in, we can see then what we could reuse. -- The new schema, which is flattened, has now better comments and is parsed better. A change I did was to disallow hex addresses, because they are a bit error prone. I'm asking now to print the address in decimal. -- Renamed "intel" to "GenuineIntel" in the schema because that's what you see in /proc/cpuinfo. - Implemented reading the context switch trace data buffer. I had to do some refactors to do that cleanly. -- A major change that I did here was to simplify the perf_event circular buffer reading logic. It was too complex. Maybe the original Intel author had something different in mind. - Implemented all the necessary bits to read trace.json files with per-core data. - Implemented all the necessary bits to save to disk per-core trace session. - Added a test that ensures that parsing and saving to disk works.
Differential Revision: https://reviews.llvm.org/D126015
show more ...
|
| #
a7582059 |
| 18-May-2022 |
Walter Erquinigo <[email protected]> |
[trace][intelpt] Support system-wide tracing [9] - Collect and return context switch traces
- Add collection of context switches per cpu grouped with the per-cpu intel pt traces. - Move the state ha
[trace][intelpt] Support system-wide tracing [9] - Collect and return context switch traces
- Add collection of context switches per cpu grouped with the per-cpu intel pt traces. - Move the state handling from the interl pt trace class to the PerfEvent one. - Add support for stopping and enabling perf event groups. - Return context switch entries as part of the jLLDBTraceGetState response. - Move the triggers of whenever the process stopped or resumed. Now the will-resume notification is in a better location, which will ensure that we'll capture the instructions that will be executed. - Remove IntelPTSingleBufferTraceUP. The unique pointer was useless. - Add unit tests
Differential Revision: https://reviews.llvm.org/D125897
show more ...
|
| #
5a92632d |
| 18-May-2022 |
Walter Erquinigo <[email protected]> |
[trace][intelpt] Support system-wide tracing [8] - Improve the single buffer perf_event configuration
We were setting some events to be written in the data buffer of the perf_event, but we don't nee
[trace][intelpt] Support system-wide tracing [8] - Improve the single buffer perf_event configuration
We were setting some events to be written in the data buffer of the perf_event, but we don't need that.
Besides that, we don't need the data buffer to be larger than 1, so we can reduce its size.
Differential Revision: https://reviews.llvm.org/D125850
show more ...
|
| #
8e757c6b |
| 25-May-2022 |
Thomas Preud'homme <[email protected]> |
Fix conversion error to Expected
On Ubuntu 18.04 with GCC 7.5 Intel trace code fails to build due to failure to convert from lldb_private::process_linux::IntelPTPerThreadProcessTraceUP to Expected<l
Fix conversion error to Expected
On Ubuntu 18.04 with GCC 7.5 Intel trace code fails to build due to failure to convert from lldb_private::process_linux::IntelPTPerThreadProcessTraceUP to Expected<lldb_private::process_linux::IntelPTPerThreadProcessTraceUP>. This commit explicitely marks those unique_ptr values as being moved which fixes the conversion error.
Reviewed By: wallace
Differential Revision: https://reviews.llvm.org/D126402
show more ...
|
| #
1637545f |
| 04-May-2022 |
Walter Erquinigo <[email protected]> |
[trace][intelpt] Support system-wide tracing [5] - Disable/enable per-core tracing based on the process state
When tracing on per-core mode, we are tracing all processes, which means that after hitt
[trace][intelpt] Support system-wide tracing [5] - Disable/enable per-core tracing based on the process state
When tracing on per-core mode, we are tracing all processes, which means that after hitting a breakpoint, our process will stop running (thus producing no more tracing data) but other processes will continue writing to our trace buffers. This causes a big data loss for our trace. As a way to remediate this, I'm adding some logic to pause and unpause tracing based on the target's state. The earlier we do it the better, however, I'm not adding the trigger at the earliest possible point for simplicity of this diff. Later we can improve that part.
Differential Revision: https://reviews.llvm.org/D124962
show more ...
|
| #
1f49714d |
| 03-May-2022 |
Walter Erquinigo <[email protected]> |
[trace][intelpt] Support system-wide tracing [4] - Support per core tracing on lldb-server
This diffs implements per-core tracing on lldb-server. It also includes tests that ensure that tracing can
[trace][intelpt] Support system-wide tracing [4] - Support per core tracing on lldb-server
This diffs implements per-core tracing on lldb-server. It also includes tests that ensure that tracing can be initiated from the client and that the jLLDBGetState ppacket returns the list of trace buffers per core.
This doesn't include any decoder changes.
Finally, this makes some little changes here and there improving the existing code.
A specific piece of code that can't reliably be tested is when tracing per core fails due to permissions. In this case we add a troubleshooting message and this is the manual test:
``` /proc/sys/kernel/perf_event_paranoid set to 1
(lldb) process trace start --per-core-tracing error: perf event syscall failed: Permission denied You might need that /proc/sys/kernel/perf_event_paranoid has a value of 0 or -1. ``
Differential Revision: https://reviews.llvm.org/D124858
show more ...
|
| #
b6bb9e7d |
| 10-May-2022 |
Walter Erquinigo <[email protected]> |
[lldb] Fix 7b73de9ec2b19df040c919d3004dfbead9b6ac59
It turns out that the issue in https://lab.llvm.org/buildbot/#/builders/17/builds/21754 is that a size_t is attempted to be used inter
[lldb] Fix 7b73de9ec2b19df040c919d3004dfbead9b6ac59
It turns out that the issue in https://lab.llvm.org/buildbot/#/builders/17/builds/21754 is that a size_t is attempted to be used interchangeably with uint64_t.
show more ...
|
| #
c4172c75 |
| 10-May-2022 |
Walter Erquinigo <[email protected]> |
[lldb] Fix 7b73de9ec2b19df040c919d3004dfbead9b6ac59
It turns out that the issue in https://lab.llvm.org/buildbot/#/builders/17/builds/21754 is that a size_t is attempted to be used interchangeably w
[lldb] Fix 7b73de9ec2b19df040c919d3004dfbead9b6ac59
It turns out that the issue in https://lab.llvm.org/buildbot/#/builders/17/builds/21754 is that a size_t is attempted to be used interchangeably with uint64_t.
show more ...
|
| #
909a2e3c |
| 10-May-2022 |
Walter Erquinigo <[email protected]> |
[lldb] Fix 7b73de9ec2b19df040c919d3004dfbead9b6ac59
This commit causes https://lab.llvm.org/buildbot/#/builders/17/builds/21743 to fail seemingly because of bad handling of the PERF_ATTR_SIZE_VER5 s
[lldb] Fix 7b73de9ec2b19df040c919d3004dfbead9b6ac59
This commit causes https://lab.llvm.org/buildbot/#/builders/17/builds/21743 to fail seemingly because of bad handling of the PERF_ATTR_SIZE_VER5 symbol.
This patch tries to handle better the absence of this symbol.
show more ...
|
| #
7b73de9e |
| 29-Apr-2022 |
Walter Erquinigo <[email protected]> |
[trace][intelpt] Support system-wide tracing [3] - Refactor IntelPTThreadTrace
I'm refactoring IntelPTThreadTrace into IntelPTSingleBufferTrace so that it can both single threads or single cores. In
[trace][intelpt] Support system-wide tracing [3] - Refactor IntelPTThreadTrace
I'm refactoring IntelPTThreadTrace into IntelPTSingleBufferTrace so that it can both single threads or single cores. In this diff I'm basically renaming the class, moving it to its own file, and removing all the pieces that are not used along with some basic cleanup.
Differential Revision: https://reviews.llvm.org/D124648
show more ...
|