[Lldb-commits] [lldb] 909a2e3 - [lldb] Fix 7b73de9ec2b19df040c919d3004dfbead9b6ac59
Walter Erquinigo via lldb-commits
lldb-commits at lists.llvm.org
Mon May 9 21:02:47 PDT 2022
Author: Walter Erquinigo
Date: 2022-05-09T21:02:40-07:00
New Revision: 909a2e3c8822f0826234aa320794003c7066fada
URL: https://github.com/llvm/llvm-project/commit/909a2e3c8822f0826234aa320794003c7066fada
DIFF: https://github.com/llvm/llvm-project/commit/909a2e3c8822f0826234aa320794003c7066fada.diff
LOG: [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.
Added:
Modified:
lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
index 47d587741dbc..30c30eb6cfff 100644
--- a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
+++ b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
@@ -146,6 +146,7 @@ static Error CheckPsbPeriod(size_t psb_period) {
return createStringError(inconvertibleErrorCode(), error.str().c_str());
}
+#ifdef PERF_ATTR_SIZE_VER5
static Expected<uint64_t>
GeneratePerfEventConfigValue(bool enable_tsc, Optional<size_t> psb_period) {
uint64_t config = 0;
@@ -179,9 +180,8 @@ GeneratePerfEventConfigValue(bool enable_tsc, Optional<size_t> psb_period) {
static Expected<perf_event_attr>
CreateIntelPTPerfEventConfiguration(bool enable_tsc,
llvm::Optional<size_t> psb_period) {
-#ifndef PERF_ATTR_SIZE_VER5
- return llvm_unreachable("Intel PT Linux perf event not supported");
-#else
+ return createStringError(inconvertibleErrorCode(),
+ "Intel PT Linux perf event not supported");
perf_event_attr attr;
memset(&attr, 0, sizeof(attr));
attr.size = sizeof(attr);
@@ -204,8 +204,8 @@ CreateIntelPTPerfEventConfiguration(bool enable_tsc,
return intel_pt_type.takeError();
return attr;
-#endif
}
+#endif
size_t IntelPTSingleBufferTrace::GetTraceBufferSize() const {
return m_perf_event.GetAuxBuffer().size();
@@ -263,6 +263,10 @@ IntelPTSingleBufferTrace::GetTraceBuffer(size_t offset, size_t size) const {
Expected<IntelPTSingleBufferTraceUP>
IntelPTSingleBufferTrace::Start(const TraceIntelPTStartRequest &request,
lldb::tid_t tid) {
+#ifndef PERF_ATTR_SIZE_VER5
+ return createStringError(inconvertibleErrorCode(),
+ "Intel PT Linux perf event not supported");
+#else
Log *log = GetLog(POSIXLog::Trace);
LLDB_LOG(log, "Will start tracing thread id {0}", tid);
@@ -299,4 +303,5 @@ IntelPTSingleBufferTrace::Start(const TraceIntelPTStartRequest &request,
} else {
return perf_event.takeError();
}
+#endif
}
More information about the lldb-commits
mailing list