File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ const char *BPFTRACE_SCRIPT =
122122 str(arg0), \
123123 *(int32 *)(arg1 + 0), *(int32 *)(arg1 + 4), *(int32 *)(arg1 + 8) }\n"
124124"test:struct_by_val_reg { arg0=%hhu arg1=%u -> arg0, arg1 }\n"
125- #ifndef __clang__ /* bpftrace generates a bad BPF program in this case */
125+ #if ALLOW_STRUCT_BY_VALUE_TEST
126126"test:struct_by_val_reg_pair { s.x=%llx -> arg0 }\n" /* captures first half of a struct */
127127#endif
128128/* bpftrace can't handle 24-byte struct-by-value case in struct_by_val_stack */
@@ -140,7 +140,7 @@ const char *BPFTRACE_OUTPUT =
140140"test:ptrs: arg0=0x* arg1='some literal' arg2=&42\n"
141141"test:arrs: arg0='STRING' arg1=(-100,-200,-300)\n"
142142"test:struct_by_val_reg: arg0=1 arg1=2\n"
143- #ifndef __clang__
143+ #if ALLOW_STRUCT_BY_VALUE_TEST
144144"test:struct_by_val_reg_pair: s.x=3\n"
145145#endif
146146"test:structs_by_ref: a=(1) b=(2) c=(3,4) d=(4,5,6)\n"
Original file line number Diff line number Diff line change 88#define __always_inline inline __attribute__((always_inline))
99#endif
1010
11+ /* Struct-by-value USDT argument currently only works on x86_64 with gcc
12+ * See: https://github.com/bpftrace/bpftrace/issues/3798
13+ */
14+ #if defined(__clang__ ) || defined(__aarch64__ )
15+ #define ALLOW_STRUCT_BY_VALUE_TEST 0
16+ #else
17+ #define ALLOW_STRUCT_BY_VALUE_TEST 1
18+ #endif
19+
1120#ifdef __cplusplus
1221extern "C" {
1322#endif
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ const char *BPFTRACE_SCRIPT =
122122 str(arg0), \
123123 *(int32 *)(arg1 + 0), *(int32 *)(arg1 + 4), *(int32 *)(arg1 + 8) }\n "
124124" test:struct_by_val_reg { arg0=%hhu arg1=%u -> arg0, arg1 }\n "
125- #ifndef __clang__ /* bpftrace generates a bad BPF program in this case */
125+ #if ALLOW_STRUCT_BY_VALUE_TEST
126126" test:struct_by_val_reg_pair { s.x=%llx -> arg0 }\n " /* captures first half of a struct */
127127#endif
128128/* bpftrace can't handle 24-byte struct-by-value case in struct_by_val_stack */
@@ -140,7 +140,7 @@ const char *BPFTRACE_OUTPUT =
140140" test:ptrs: arg0=0x* arg1='some literal' arg2=&42\n "
141141" test:arrs: arg0='STRING' arg1=(-100,-200,-300)\n "
142142" test:struct_by_val_reg: arg0=1 arg1=2\n "
143- #ifndef __clang__
143+ #if ALLOW_STRUCT_BY_VALUE_TEST
144144" test:struct_by_val_reg_pair: s.x=3\n "
145145#endif
146146" test:structs_by_ref: a=(1) b=(2) c=(3,4) d=(4,5,6)\n "
You can’t perform that action at this time.
0 commit comments