[Lldb-commits] [lldb] fix: [lldb]: add missing if for smaller linux version (PR #105715)

via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 22 11:39:00 PDT 2024


https://github.com/root-kidik created https://github.com/llvm/llvm-project/pull/105715

None

>From 719a9c76f8852ed4e493e7376b9959bfef8b4b5f Mon Sep 17 00:00:00 2001
From: Nikita <rtkid.nik at gmail.com>
Date: Fri, 23 Aug 2024 01:37:57 +0700
Subject: [PATCH] fix: [lldb]: add missing if for smaller linux version

---
 lldb/source/Plugins/Process/Linux/Perf.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lldb/source/Plugins/Process/Linux/Perf.cpp b/lldb/source/Plugins/Process/Linux/Perf.cpp
index 097c719b9c1d25..8135d092cfdd68 100644
--- a/lldb/source/Plugins/Process/Linux/Perf.cpp
+++ b/lldb/source/Plugins/Process/Linux/Perf.cpp
@@ -342,7 +342,9 @@ lldb_private::process_linux::CreateContextSwitchTracePerfEvent(
   attr.size = sizeof(attr);
   attr.sample_type = PERF_SAMPLE_TID | PERF_SAMPLE_TIME;
   attr.type = PERF_TYPE_SOFTWARE;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
   attr.context_switch = 1;
+#endif
   attr.exclude_kernel = 1;
   attr.sample_id_all = 1;
   attr.exclude_hv = 1;



More information about the lldb-commits mailing list