Skip to content

Commit

Permalink
fix: devcgroup
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Bastide <[email protected]>
  • Loading branch information
prb112 committed Oct 31, 2024
1 parent 13d54fe commit 5f5f8d0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/devcgroup.bt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bpftrace

# SPDX-License-Identifier: Apache-2.0
# inspired by https://github.com/freedge/blog/blob/44ede6a73caaaf7f8128e69eb28cfa26b37100bd/kerneltrace.md?plain=1#L55

#ifndef BPFTRACE_HAVE_BTF
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/kprobes.h>
#endif

kretprobe:devcgroup_check_permission {
if (retval < 0) {
printf("PID %d, comm %s returned %ld\n", pid, comm, retval);
}
}

0 comments on commit 5f5f8d0

Please sign in to comment.