Commit 2e081aa6 authored by 4ast's avatar 4ast

Merge pull request #228 from iovisor/bblanco_dev

Add a better test case for nested probe reads
parents f22a1e09 05f60a83
...@@ -180,12 +180,20 @@ static void print_file_name(struct file *file) { ...@@ -180,12 +180,20 @@ static void print_file_name(struct file *file) {
const char *name = file->f_path.dentry->d_name.name; const char *name = file->f_path.dentry->d_name.name;
bpf_trace_printk("%s\\n", name); bpf_trace_printk("%s\\n", name);
} }
int trace_entry(struct pt_regs *ctx, struct file *file) { static void print_file_name2(int unused, struct file *file) {
print_file_name(file);
}
int trace_entry1(struct pt_regs *ctx, struct file *file) {
print_file_name(file); print_file_name(file);
return 0; return 0;
} }
int trace_entry2(struct pt_regs *ctx, int unused, struct file *file) {
print_file_name2(unused, file);
return 0;
}
""") """)
fn = b.load_func("trace_entry", BPF.KPROBE) fn = b.load_func("trace_entry1", BPF.KPROBE)
fn = b.load_func("trace_entry2", BPF.KPROBE)
def test_probe_struct_assign(self): def test_probe_struct_assign(self):
b = BPF(text = """ b = BPF(text = """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment