From eebfe61ccca006b0dc84d89f5c59a5f14783d992 Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Mon, 20 Oct 2025 05:17:40 +0530 Subject: [PATCH] fix lost_callback_wrapper, clang-format --- src/maps/perf_event_array.cpp | 7 +++---- src/maps/perf_event_array.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/maps/perf_event_array.cpp b/src/maps/perf_event_array.cpp index a14d11b..cfebb3d 100644 --- a/src/maps/perf_event_array.cpp +++ b/src/maps/perf_event_array.cpp @@ -89,13 +89,12 @@ void PerfEventArray::lost_callback_wrapper(void *ctx, int cpu, unsigned long long cnt) { auto *self = static_cast(ctx); - if (self->lost_callback_.is_none()) { - return; - } - py::gil_scoped_acquire acquire; try { + if (self->lost_callback_.is_none()) { + return; + } self->lost_callback_(cpu, cnt); } catch (const py::error_already_set &e) { PyErr_Print(); diff --git a/src/maps/perf_event_array.h b/src/maps/perf_event_array.h index 1b75440..9f77454 100644 --- a/src/maps/perf_event_array.h +++ b/src/maps/perf_event_array.h @@ -2,10 +2,10 @@ #define PYLIBBPF_PERF_EVENT_ARRAY_H #include +#include #include #include #include -#include class StructParser; class BpfMap;