multip register_uprobe

Srikar Dronamraju srikar@linux.vnet.ibm.com
Fri Jul 6 12:35:00 GMT 2007


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 



More information about the Systemtap mailing list