Skip to content

Commit c27da22

Browse files
remove ruff errors. May contain breaking changes.
1 parent b095828 commit c27da22

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

examples/clone_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pythonbpf import bpf, map, section, bpfglobal, BPF
44
from pythonbpf.helpers import pid
55
from pythonbpf.maps import HashMap
6-
from pylibbpf import *
6+
from pylibbpf import BpfMap
77
from ctypes import c_void_p, c_int64, c_uint64, c_int32
88
import matplotlib.pyplot as plt
99

examples/struct_and_perf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ def events() -> PerfEventArray:
2424
def hello(ctx: c_void_p) -> c_int32:
2525
dataobj = data_t()
2626
ts = ktime()
27-
process_id = pid()
2827
strobj = "hellohellohello"
2928
dataobj.pid = pid()
3029
dataobj.ts = ktime()
3130
# dataobj.comm = strobj
32-
print(f"clone called at {dataobj.ts} by pid {dataobj.pid}, comm {strobj}")
31+
print(
32+
f"clone called at {dataobj.ts} by pid {dataobj.pid}, comm {strobj} at time {ts}"
33+
)
3334
events.output(dataobj)
3435
return c_int32(0)
3536

pythonbpf/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
from .decorators import bpf, map, section, bpfglobal, struct
22
from .codegen import compile_to_ir, compile, BPF
3+
4+
__all__ = [
5+
"bpf",
6+
"map",
7+
"section",
8+
"bpfglobal",
9+
"struct",
10+
"compile_to_ir",
11+
"compile",
12+
"BPF",
13+
]

pythonbpf/debuginfo/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
from .dwarf_constants import *
2-
from .dtypes import *
1+
from .dwarf_constants import * # noqa: F403
2+
from .dtypes import * # noqa: F403
33
from .debug_info_generator import DebugInfoGenerator
4+
5+
__all__ = ["DebugInfoGenerator"]

pythonbpf/functions_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def handle_assign(
189189
map_name = rval.func.value.func.id
190190
method_name = rval.func.attr
191191
if map_name in map_sym_tab:
192-
map_ptr = map_sym_tab[map_name]
192+
# map_ptr = map_sym_tab[map_name]
193193
if method_name in helper_func_list:
194194
val = handle_helper_call(
195195
rval,
@@ -289,7 +289,7 @@ def handle_if(
289289
):
290290
"""Handle if statements in the function body."""
291291
print("Handling if statement")
292-
start = builder.block.parent
292+
# start = builder.block.parent
293293
then_block = func.append_basic_block(name="if.then")
294294
merge_block = func.append_basic_block(name="if.end")
295295
if stmt.orelse:

0 commit comments

Comments
 (0)