Skip to content

Commit eebfe61

Browse files
committed
fix lost_callback_wrapper, clang-format
1 parent ec5377b commit eebfe61

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/maps/perf_event_array.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,12 @@ void PerfEventArray::lost_callback_wrapper(void *ctx, int cpu,
8989
unsigned long long cnt) {
9090
auto *self = static_cast<PerfEventArray *>(ctx);
9191

92-
if (self->lost_callback_.is_none()) {
93-
return;
94-
}
95-
9692
py::gil_scoped_acquire acquire;
9793

9894
try {
95+
if (self->lost_callback_.is_none()) {
96+
return;
97+
}
9998
self->lost_callback_(cpu, cnt);
10099
} catch (const py::error_already_set &e) {
101100
PyErr_Print();

src/maps/perf_event_array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#define PYLIBBPF_PERF_EVENT_ARRAY_H
33

44
#include <libbpf.h>
5+
#include <memory>
56
#include <pybind11/functional.h>
67
#include <pybind11/pybind11.h>
78
#include <string>
8-
#include <memory>
99

1010
class StructParser;
1111
class BpfMap;

0 commit comments

Comments
 (0)