mirror of
https://github.com/varun-r-mallya/pylibbpf.git
synced 2025-12-31 20:36:26 +00:00
Janitorial formatting
This commit is contained in:
@ -5,7 +5,10 @@ set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
|
||||
find_package(
|
||||
Python
|
||||
COMPONENTS Interpreter Development.Module
|
||||
REQUIRED)
|
||||
|
||||
# pybind11
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src)
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import ctypes
|
||||
import logging
|
||||
from typing import Dict, Type
|
||||
|
||||
from llvmlite import ir
|
||||
|
||||
@ -51,7 +50,7 @@ def _make_repr(struct_name: str, fields: list):
|
||||
return __repr__
|
||||
|
||||
|
||||
def convert_structs_to_ctypes(structs_sym_tab) -> Dict[str, Type[ctypes.Structure]]:
|
||||
def convert_structs_to_ctypes(structs_sym_tab) -> dict[str, type[ctypes.Structure]]:
|
||||
"""Convert PythonBPF's structs_sym_tab to ctypes.Structure classes."""
|
||||
if not structs_sym_tab:
|
||||
return {}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from typing import Callable, Optional
|
||||
from collections.abc import Callable
|
||||
|
||||
|
||||
class PerfEventArrayHelper:
|
||||
@ -13,7 +13,7 @@ class PerfEventArrayHelper:
|
||||
callback: Callable,
|
||||
struct_name: str = "",
|
||||
page_cnt: int = 8,
|
||||
lost_callback: Optional[Callable] = None,
|
||||
lost_callback: Callable | None = None,
|
||||
):
|
||||
"""Open perf buffer with auto-deserialization."""
|
||||
from .pylibbpf import PerfEventArray
|
||||
|
||||
Reference in New Issue
Block a user