From c637478fd2d14e50e74ea05e6f1b08a20fa6e50e Mon Sep 17 00:00:00 2001 From: "qianlu.kk" Date: Sat, 12 Oct 2024 18:09:20 +0800 Subject: [PATCH] remove locks --- core/ebpf/SelfMonitor.cpp | 1 - core/ebpf/SelfMonitor.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/core/ebpf/SelfMonitor.cpp b/core/ebpf/SelfMonitor.cpp index 8c66b3fbba..539fcf5241 100644 --- a/core/ebpf/SelfMonitor.cpp +++ b/core/ebpf/SelfMonitor.cpp @@ -20,7 +20,6 @@ namespace ebpf { void BaseBPFMonitor::HandleStatistic(nami::eBPFStatistics& stats) { if (!stats.updated_) return; - std::lock_guard lk(mStatsMtx); UpdateInnerMetric(stats); } diff --git a/core/ebpf/SelfMonitor.h b/core/ebpf/SelfMonitor.h index 755c67d318..d8ea11d6de 100644 --- a/core/ebpf/SelfMonitor.h +++ b/core/ebpf/SelfMonitor.h @@ -45,10 +45,8 @@ class BaseBPFMonitor { // attention: not thread safe!! void UpdateInnerMetric(nami::eBPFStatistics& currStat); - mutable ReadWriteLock mMonitorMtx; std::string mPipelineName; PluginMetricManagerPtr mPluginMetricMgr; - mutable std::mutex mStatsMtx; MetricsRecordRef& mRef; std::vector> mRefAndLabels; @@ -104,7 +102,6 @@ class NetworkSecuritySelfMonitor : public BaseBPFMonitor { void HandleStatistic(nami::eBPFStatistics& stats) override { if (!stats.updated_) return; - std::lock_guard lk(mStatsMtx); UpdateInnerMetric(stats); } };