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_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
|
find_package(
|
||||||
|
Python
|
||||||
|
COMPONENTS Interpreter Development.Module
|
||||||
|
REQUIRED)
|
||||||
|
|
||||||
# pybind11
|
# pybind11
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/src)
|
include_directories(${CMAKE_SOURCE_DIR}/src)
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import ctypes
|
import ctypes
|
||||||
import logging
|
import logging
|
||||||
from typing import Dict, Type
|
|
||||||
|
|
||||||
from llvmlite import ir
|
from llvmlite import ir
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ def _make_repr(struct_name: str, fields: list):
|
|||||||
return __repr__
|
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."""
|
"""Convert PythonBPF's structs_sym_tab to ctypes.Structure classes."""
|
||||||
if not structs_sym_tab:
|
if not structs_sym_tab:
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
from typing import Callable, Optional
|
from collections.abc import Callable
|
||||||
|
|
||||||
|
|
||||||
class PerfEventArrayHelper:
|
class PerfEventArrayHelper:
|
||||||
@ -13,7 +13,7 @@ class PerfEventArrayHelper:
|
|||||||
callback: Callable,
|
callback: Callable,
|
||||||
struct_name: str = "",
|
struct_name: str = "",
|
||||||
page_cnt: int = 8,
|
page_cnt: int = 8,
|
||||||
lost_callback: Optional[Callable] = None,
|
lost_callback: Callable | None = None,
|
||||||
):
|
):
|
||||||
"""Open perf buffer with auto-deserialization."""
|
"""Open perf buffer with auto-deserialization."""
|
||||||
from .pylibbpf import PerfEventArray
|
from .pylibbpf import PerfEventArray
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -3,7 +3,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from setuptools import Extension, find_packages, setup
|
from setuptools import Extension, setup
|
||||||
from setuptools.command.build_ext import build_ext
|
from setuptools.command.build_ext import build_ext
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user