0001
0002
0003
0004 #include "vmlinux.h"
0005 #include <bpf/bpf_helpers.h>
0006 #include <bpf/bpf_tracing.h>
0007
0008 __u32 count = 0;
0009 __u32 on_cpu = 0xffffffff;
0010
0011 SEC("raw_tp/task_rename")
0012 int BPF_PROG(rename, struct task_struct *task, char *comm)
0013 {
0014
0015 count++;
0016 if ((__u64) task == 0x1234ULL && (__u64) comm == 0x5678ULL) {
0017 on_cpu = bpf_get_smp_processor_id();
0018 return (long)task + (long)comm;
0019 }
0020
0021 return 0;
0022 }
0023
0024 char _license[] SEC("license") = "GPL";