def METHOD_NAME(pid: int):
    # load BPF program
    filename = "sar_perpro.bpf.c"
    with open(filename, "r") as f:
        lines = f.readlines()
    lines[2] = "#define TARGET_PID {}\n".format(pid)
    with open(filename, "w") as f:
        f.writelines(lines)
    bpf = BPF(src_file=filename)
    bpf.attach_tracepoint(tp="sched:sched_switch", fn_name="trace_sched_switch")
    bpf.attach_tracepoint(tp="irq:softirq_entry", fn_name="trace_softirq_entry")
    bpf.attach_tracepoint(tp="irq:softirq_exit", fn_name="trace_softirq_exit")
    bpf.attach_tracepoint(tp="irq:irq_handler_entry", fn_name="trace_irq_handler_entry")
    bpf.attach_tracepoint(tp="irq:irq_handler_exit", fn_name="trace_irq_handler_exit")
    bpf.attach_tracepoint(tp="raw_syscalls:sys_enter", fn_name="trace_sys_enter")
    # bpf.attach_tracepoint(tp="raw_syscalls:sys_exit", fn_name="trace_sys_exit")
    bpf.attach_kprobe(event="exit_to_user_mode_prepare",fn_name="exit_to_user_mode_prepare")
    return bpf