[Lldb-commits] [PATCH] D125850: [trace][intelpt] Support system-wide tracing [7] - Improve the single buffer perf_event configuration
walter erquinigo via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue May 17 21:49:49 PDT 2022
wallace created this revision.
wallace added a reviewer: jj10306.
Herald added a project: All.
wallace requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D125850
Files:
lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
Index: lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
===================================================================
--- lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
+++ lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
@@ -183,11 +183,8 @@
memset(&attr, 0, sizeof(attr));
attr.size = sizeof(attr);
attr.exclude_kernel = 1;
- attr.sample_type = PERF_SAMPLE_TIME;
- attr.sample_id_all = 1;
attr.exclude_hv = 1;
attr.exclude_idle = 1;
- attr.mmap = 1;
if (Expected<uint64_t> config_value =
GeneratePerfEventConfigValue(enable_tsc, psb_period))
@@ -297,7 +294,7 @@
request.trace_buffer_size);
}
uint64_t page_size = getpagesize();
- uint64_t buffer_numpages = static_cast<uint64_t>(llvm::PowerOf2Floor(
+ uint64_t aux_buffer_numpages = static_cast<uint64_t>(llvm::PowerOf2Floor(
(request.trace_buffer_size + page_size - 1) / page_size));
Expected<perf_event_attr> attr = CreateIntelPTPerfEventConfiguration(
@@ -312,8 +309,8 @@
request.trace_buffer_size);
if (Expected<PerfEvent> perf_event = PerfEvent::Init(*attr, tid, core_id)) {
- if (Error mmap_err = perf_event->MmapMetadataAndBuffers(buffer_numpages,
- buffer_numpages)) {
+ if (Error mmap_err = perf_event->MmapMetadataAndBuffers(
+ /*num_data_pages=*/0, aux_buffer_numpages)) {
return std::move(mmap_err);
}
IntelPTSingleBufferTraceUP trace_up(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125850.430239.patch
Type: text/x-patch
Size: 1526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220518/8caa496a/attachment-0001.bin>
More information about the lldb-commits
mailing list