This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: multip register_uprobe
- From: Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
- To: Wenji Huang <wenji dot huang at oracle dot com>
- Cc: systemtap at sourceware dot org
- Date: Fri, 6 Jul 2007 18:05:19 +0530
- Subject: Re: multip register_uprobe
- References: <468DF726.9090808@oracle.com>
- Reply-to: Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
Hi Wenji,
> I am creating some test scripts based on sarikar's framework.
>
> There is one problem about register multiple times.
> .................
> probes->vaddr = vaddr;
> probes->pid = pid;
> probes->handler = handler;
> for (i=0; i < 3; i++) {
> ret = register_uprobe(probes);
> if (ret!=0) //of course, the first time should succeed and
> will failed in second time, ret = -16
> {
> I tried several possibilities:
> * return ret; //RESULT: the module can't be removed,
> the probed process will hang, can't be killed/continued
> * return 0; //RESULT: same as above
> * unregister_uprobe(probes);kfree(probes);break;
> //RESULT: same as above
> * kfree(probes);break; //RESULT: the module can be
> removed, the probed process will hang, can't be killed/continued
> }
> }
> return 0;
uprobes doesn't allow to register using the same probe structure.
Thats currently documented in the Documentation/uprobes.txt
Under Uprobes features and Limitations.
Uprobes may produce unexpected results if you:
- assign non-zero values to reserved members of struct uprobe;
- change the contents of a uprobe or uretprobe object while it is
registered; or
- attempt to register a uprobe or uretprobe that is already registered.
Please do let me know if I it doesn't answer or if I have misunderstood
your query.
--
Thanks and Regards
Srikar