Skip to content

Commit

Permalink
Merge branch 'linuxkerneltravel:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
albertxu216 committed May 24, 2024
2 parents ad6c1c3 + 9ae9062 commit 32845b4
Show file tree
Hide file tree
Showing 9 changed files with 1,568 additions and 65 deletions.
19 changes: 15 additions & 4 deletions eBPF_Supermarket/Stack_Analyser/bpf/probe.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ static int entry(void *ctx)
bpf_map_update_elem(&starts, &pid, &nsec, BPF_ANY);
return 0;
}

SEC("fentry/dummy_fentry")
int BPF_PROG(dummy_fentry)
{
entry(ctx);
return 0;
}
SEC("kprobe/dummy_kprobe")
int BPF_KPROBE(dummy_kprobe)
{
Expand All @@ -64,8 +69,7 @@ int BPF_KPROBE(dummy_kprobe)
static int exit(void *ctx)
{
CHECK_ACTIVE;
u32 pid = bpf_get_current_pid_tgid() >> 32;

u32 pid = bpf_get_current_pid_tgid() >> 32;
u64 *start = bpf_map_lookup_elem(&starts, &pid);
if (!start)
return 0;
Expand All @@ -87,14 +91,21 @@ static int exit(void *ctx)
return 0;
}

SEC("fexit/dummy_fexit")
int BPF_PROG(dummy_fexit)
{
exit(ctx);
return 0;
}


SEC("kretprobe/dummy_kretprobe")
int BPF_KRETPROBE(dummy_kretprobe)
{
exit(ctx);
return 0;
}


static int handleCounts(void *ctx)
{
CHECK_ACTIVE;
Expand Down
Loading

0 comments on commit 32845b4

Please sign in to comment.