File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -506,6 +506,25 @@ static int probe_kern_arg_ctx_tag(int token_fd)
506506 return probe_fd (prog_fd );
507507}
508508
509+ #ifdef __x86_64__
510+ #ifndef __NR_uprobe
511+ #define __NR_uprobe 336
512+ #endif
513+ static int probe_uprobe_syscall (int token_fd )
514+ {
515+ /*
516+ * When not executed from executed kernel provided trampoline,
517+ * the uprobe syscall returns ENXIO error.
518+ */
519+ return syscall (__NR_uprobe ) == -1 && errno == ENXIO ;
520+ }
521+ #else
522+ static int probe_uprobe_syscall (int token_fd )
523+ {
524+ return 0 ;
525+ }
526+ #endif
527+
509528typedef int (* feature_probe_fn )(int /* token_fd */ );
510529
511530static struct kern_feature_cache feature_cache ;
@@ -581,6 +600,9 @@ static struct kern_feature_desc {
581600 [FEAT_BTF_QMARK_DATASEC ] = {
582601 "BTF DATASEC names starting from '?'" , probe_kern_btf_qmark_datasec ,
583602 },
603+ [FEAT_UPROBE_SYSCALL ] = {
604+ "Kernel supports uprobe syscall" , probe_uprobe_syscall ,
605+ },
584606};
585607
586608bool feat_supported (struct kern_feature_cache * cache , enum kern_feature_id feat_id )
Original file line number Diff line number Diff line change @@ -392,6 +392,8 @@ enum kern_feature_id {
392392 FEAT_ARG_CTX_TAG ,
393393 /* Kernel supports '?' at the front of datasec names */
394394 FEAT_BTF_QMARK_DATASEC ,
395+ /* Kernel supports uprobe syscall */
396+ FEAT_UPROBE_SYSCALL ,
395397 __FEAT_CNT ,
396398};
397399
You can’t perform that action at this time.
0 commit comments