Skip to content

Commit

Permalink
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
Delphix Engineering committed Dec 14, 2023
2 parents d59de07 + 54090e3 commit 447e9ac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/runtime/probe
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,18 @@ NAME kprobe_offset_module
RUN {{BPFTRACE}} -e 'kprobe:nft_trans_alloc_gfp+0x5 { printf("hit\n"); exit(); }'
AFTER /usr/sbin/nft add table bpftrace
EXPECT hit
ARCH x86_64|aarch64
ARCH x86_64
TIMEOUT 5
REQUIRES lsmod | grep '^nf_tables'
REQUIRES /usr/sbin/nft --help
CLEANUP /usr/sbin/nft delete table bpftrace

# Local entry point to nft_trans_alloc_gfp is located at offset of 8 bytes in ppc64.
# Local entry point to nft_trans_alloc_gfp is located at offset of 8 bytes in ppc64 and aarch64.
NAME kprobe_offset_module
RUN {{BPFTRACE}} -e 'kprobe:nft_trans_alloc_gfp+0x8 { printf("hit\n"); exit(); }'
AFTER /usr/sbin/nft add table bpftrace
EXPECT hit
ARCH ppc64|ppc64le
ARCH ppc64|ppc64le|aarch64
TIMEOUT 5
REQUIRES lsmod | grep '^nf_tables'
REQUIRES /usr/sbin/nft --help
Expand All @@ -173,6 +173,15 @@ CLEANUP /usr/sbin/nft delete table bpftrace
NAME kprobe_offset_module_error
RUN {{BPFTRACE}} -e 'kprobe:nft_trans_alloc_gfp+0x1 { printf("hit\n"); exit(); }'
EXPECT Possible attachment attempt in the middle of an instruction, try a different offset.
ARCH x86_64
TIMEOUT 5
REQUIRES lsmod | grep '^nf_tables'
WILL_FAIL

NAME kprobe_offset_module_error
RUN {{BPFTRACE}} -e 'kprobe:nft_trans_alloc_gfp+0x1 { printf("hit\n"); exit(); }'
EXPECT Invalid argument
ARCH aarch64
TIMEOUT 5
REQUIRES lsmod | grep '^nf_tables'
WILL_FAIL
Expand Down
4 changes: 4 additions & 0 deletions tools/execsnoop.bt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* 11-Sep-2018 " " Switched to use join().
*/

#ifndef BPFTRACE_HAVE_BTF
#include <linux/sched.h>
#endif

BEGIN
{
printf("%-10s %-7s %-7s %s\n", "TIME(ms)", "PID", "PPID", "ARGS");
Expand Down

0 comments on commit 447e9ac

Please sign in to comment.