File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
tools/testing/selftests/bpf/progs Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -228,3 +228,37 @@ int BPF_PROG(test12, int a)
228228 test12_exit_ok = * cookie == 0x1111222233334444ull ;
229229 return 0 ;
230230}
231+
232+ __u64 test13_entry_result = 0 ;
233+ __u64 test13_exit_result = 0 ;
234+
235+ SEC ("fsession/bpf_fentry_test1" )
236+ int BPF_PROG (test13 , int a , int ret )
237+ {
238+ __u64 * cookie = bpf_fsession_cookie (ctx );
239+
240+ if (!bpf_tracing_is_exit (ctx )) {
241+ test13_entry_result = a == 1 && ret == 0 ;
242+ * cookie = 0x123456ULL ;
243+ return 0 ;
244+ }
245+
246+ test13_exit_result = a == 1 && ret == 2 && * cookie == 0x123456ULL ;
247+ return 0 ;
248+ }
249+
250+ __u64 test14_result = 0 ;
251+ SEC ("fexit/bpf_fentry_test1" )
252+ int BPF_PROG (test14 , int a , int ret )
253+ {
254+ test14_result = a == 1 && ret == 2 ;
255+ return 0 ;
256+ }
257+
258+ __u64 test15_result = 0 ;
259+ SEC ("fentry/bpf_fentry_test1" )
260+ int BPF_PROG (test15 , int a )
261+ {
262+ test15_result = a == 1 ;
263+ return 0 ;
264+ }
You can’t perform that action at this time.
0 commit comments