@@ -3152,10 +3152,54 @@ static int bpf_uprobe_multi_link_fill_link_info(const struct bpf_link *link,
3152
3152
return err ;
3153
3153
}
3154
3154
3155
+ #ifdef CONFIG_PROC_FS
3156
+ static void bpf_uprobe_multi_show_fdinfo (const struct bpf_link * link ,
3157
+ struct seq_file * seq )
3158
+ {
3159
+ struct bpf_uprobe_multi_link * umulti_link ;
3160
+ char * p , * buf ;
3161
+ pid_t pid ;
3162
+
3163
+ umulti_link = container_of (link , struct bpf_uprobe_multi_link , link );
3164
+
3165
+ buf = kmalloc (PATH_MAX , GFP_KERNEL );
3166
+ if (!buf )
3167
+ return ;
3168
+
3169
+ p = d_path (& umulti_link -> path , buf , PATH_MAX );
3170
+ if (IS_ERR (p )) {
3171
+ kfree (buf );
3172
+ return ;
3173
+ }
3174
+
3175
+ pid = umulti_link -> task ?
3176
+ task_pid_nr_ns (umulti_link -> task , task_active_pid_ns (current )) : 0 ;
3177
+ seq_printf (seq ,
3178
+ "uprobe_cnt:\t%u\n"
3179
+ "pid:\t%u\n"
3180
+ "path:\t%s\n" ,
3181
+ umulti_link -> cnt , pid , p );
3182
+
3183
+ seq_printf (seq , "%s\t %s\t %s\n" , "cookie" , "offset" , "ref_ctr_offset" );
3184
+ for (int i = 0 ; i < umulti_link -> cnt ; i ++ ) {
3185
+ seq_printf (seq ,
3186
+ "%llu\t %#llx\t %#lx\n" ,
3187
+ umulti_link -> uprobes [i ].cookie ,
3188
+ umulti_link -> uprobes [i ].offset ,
3189
+ umulti_link -> uprobes [i ].ref_ctr_offset );
3190
+ }
3191
+
3192
+ kfree (buf );
3193
+ }
3194
+ #endif
3195
+
3155
3196
static const struct bpf_link_ops bpf_uprobe_multi_link_lops = {
3156
3197
.release = bpf_uprobe_multi_link_release ,
3157
3198
.dealloc_deferred = bpf_uprobe_multi_link_dealloc ,
3158
3199
.fill_link_info = bpf_uprobe_multi_link_fill_link_info ,
3200
+ #ifdef CONFIG_PROC_FS
3201
+ .show_fdinfo = bpf_uprobe_multi_show_fdinfo ,
3202
+ #endif
3159
3203
};
3160
3204
3161
3205
static int uprobe_prog_run (struct bpf_uprobe * uprobe ,
0 commit comments