mirror of
https://github.com/varun-r-mallya/pylibbpf.git
synced 2026-02-12 16:11:00 +00:00
fix lost_callback_wrapper, clang-format
This commit is contained in:
@ -89,13 +89,12 @@ void PerfEventArray::lost_callback_wrapper(void *ctx, int cpu,
|
|||||||
unsigned long long cnt) {
|
unsigned long long cnt) {
|
||||||
auto *self = static_cast<PerfEventArray *>(ctx);
|
auto *self = static_cast<PerfEventArray *>(ctx);
|
||||||
|
|
||||||
if (self->lost_callback_.is_none()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
py::gil_scoped_acquire acquire;
|
py::gil_scoped_acquire acquire;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (self->lost_callback_.is_none()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
self->lost_callback_(cpu, cnt);
|
self->lost_callback_(cpu, cnt);
|
||||||
} catch (const py::error_already_set &e) {
|
} catch (const py::error_already_set &e) {
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
|
|||||||
@ -2,10 +2,10 @@
|
|||||||
#define PYLIBBPF_PERF_EVENT_ARRAY_H
|
#define PYLIBBPF_PERF_EVENT_ARRAY_H
|
||||||
|
|
||||||
#include <libbpf.h>
|
#include <libbpf.h>
|
||||||
|
#include <memory>
|
||||||
#include <pybind11/functional.h>
|
#include <pybind11/functional.h>
|
||||||
#include <pybind11/pybind11.h>
|
#include <pybind11/pybind11.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
class StructParser;
|
class StructParser;
|
||||||
class BpfMap;
|
class BpfMap;
|
||||||
|
|||||||
Reference in New Issue
Block a user