Janitorial: clang-format

This commit is contained in:
Pragyansh Chaturvedi
2025-10-18 21:00:16 +05:30
parent c5a485b526
commit 4a5ff0c1c2
8 changed files with 623 additions and 637 deletions

View File

@ -2,27 +2,29 @@
#define PYLIBBPF_BPF_PERF_BUFFER_H
#include <libbpf.h>
#include <pybind11/pybind11.h>
#include <pybind11/functional.h>
#include <pybind11/pybind11.h>
namespace py = pybind11;
class BpfPerfBuffer {
private:
struct perf_buffer *pb_;
py::function callback_;
py::function lost_callback_;
struct perf_buffer *pb_;
py::function callback_;
py::function lost_callback_;
// Static callback wrappers for C API
static void sample_callback_wrapper(void *ctx, int cpu, void *data, unsigned int size);
static void lost_callback_wrapper(void *ctx, int cpu, unsigned long long cnt);
// Static callback wrappers for C API
static void sample_callback_wrapper(void *ctx, int cpu, void *data,
unsigned int size);
static void lost_callback_wrapper(void *ctx, int cpu, unsigned long long cnt);
public:
BpfPerfBuffer(int map_fd, int page_cnt, py::function callback, py::object lost_callback);
~BpfPerfBuffer();
BpfPerfBuffer(int map_fd, int page_cnt, py::function callback,
py::object lost_callback);
~BpfPerfBuffer();
int poll(int timeout_ms);
int consume();
int poll(int timeout_ms);
int consume();
};
#endif // PYLIBBPF_BPF_PERF_BUFFER_H