mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Refactor disksnoop.py to remove logging and main block
Removed logging setup and main execution block from disksnoop.py.
This commit is contained in:
committed by
GitHub
parent
c91e69e2f7
commit
99fc5d75cc
@ -2,7 +2,6 @@ from vmlinux import struct_request, struct_pt_regs
|
|||||||
from pythonbpf import bpf, section, bpfglobal, compile_to_ir, compile, map
|
from pythonbpf import bpf, section, bpfglobal, compile_to_ir, compile, map
|
||||||
from pythonbpf.helper import ktime
|
from pythonbpf.helper import ktime
|
||||||
from pythonbpf.maps import HashMap
|
from pythonbpf.maps import HashMap
|
||||||
import logging
|
|
||||||
from ctypes import c_int64, c_uint64, c_int32
|
from ctypes import c_int64, c_uint64, c_int32
|
||||||
|
|
||||||
# Constants
|
# Constants
|
||||||
@ -55,7 +54,4 @@ def trace_start(ctx1: struct_pt_regs) -> c_int32:
|
|||||||
def LICENSE() -> str:
|
def LICENSE() -> str:
|
||||||
return "GPL"
|
return "GPL"
|
||||||
|
|
||||||
|
compile()
|
||||||
if __name__ == "__main__":
|
|
||||||
compile_to_ir("disksnoop.py", "disksnoop.ll", loglevel=logging.INFO)
|
|
||||||
compile()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user