Re: [PATCHv3 bpf-next 6/6] bpftool: Add support to display uprobe_multi links

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 20, 2023 at 10:32:02AM -0800, Yonghong Song wrote:

SNIP

> > +static void show_uprobe_multi_plain(struct bpf_link_info *info)
> > +{
> > +	__u32 i;
> > +
> > +	if (!info->uprobe_multi.count)
> > +		return;
> > +
> > +	if (info->uprobe_multi.flags & BPF_F_UPROBE_MULTI_RETURN)
> > +		printf("\n\turetprobe.multi  ");
> > +	else
> > +		printf("\n\tuprobe.multi  ");
> > +
> > +	printf("path %s  ", (char *) u64_to_ptr(info->uprobe_multi.path));
> > +	printf("func_cnt %u  ", info->uprobe_multi.count);
> > +
> > +	if (info->uprobe_multi.pid != (__u32) -1)
> > +		printf("pid %d  ", info->uprobe_multi.pid);
> 
> Could you explain when info->uprobe_multi.pid could be -1?
> From patch 3, I see:
> 	info->uprobe_multi.pid = umulti_link->task ?
> 			 task_pid_nr_ns(umulti_link->task, task_active_pid_ns(current)) : 0;
> and cannot find how -1 could be assigned to info->uprobe_multi.pid.

ah it's leftover from previous version fix.. and I forgot to update
the bpftool code.. nice catch, thanks

jirka

> 
> > +
> > +	printf("\n\t%-16s   %-16s   %-16s", "offset", "ref_ctr_offset", "cookies");
> > +	for (i = 0; i < info->uprobe_multi.count; i++) {
> > +		printf("\n\t0x%-16llx 0x%-16llx 0x%-16llx",
> > +			u64_to_arr(info->uprobe_multi.offsets)[i],
> > +			u64_to_arr(info->uprobe_multi.ref_ctr_offsets)[i],
> > +			u64_to_arr(info->uprobe_multi.cookies)[i]);
> > +	}
> > +}
> > +
> >   static void show_perf_event_kprobe_plain(struct bpf_link_info *info)
> >   {
> >   	const char *buf;
> > [...]




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux