[RFC 1/3] Kprobes: userspace probes new interfaces

William Cohen wcohen@redhat.com
Thu Sep 15 13:44:00 GMT 2005


Prasanna S Panchamukhi wrote:
> Hi James,
> 
> On Wed, Sep 14, 2005 at 11:10:40AM -0500, James Dickens wrote:
> 
>>>        struct uprobe {
>>>                /*path of the application */
>>>                char name[50];
>>
>>
>>this doesn't scale, should be a pointer to a list of applications being probed. 
> 
> 
> Now with having kernel module allocate this application pathname string 
> and copying the path name to application pathname string should work. 
> With this change, the uprobes structure will look like
> 	struct uprobe {
> 		char *pathname;
> 		...............
> With this, the kernel module need to allocate pathname string one for each
> application and pass the pointer of the same pathname to insert probes within
> that application. This should help to scale well.
> 
> 
>>450000 * 50 = 22.5 MB..  far too much for kernel space before we even
>>do any work.
>>
> 
> 
> Now it will just the stringlength size of memory need to be allocated
> for all the probes (say 450000) probes within the same application.
> As per your example, now you will have 
> 
> strlen(application_path) + (450000 * sizeof(char *)) = 1.8 MB.
> 
> Thanks
> Prasanna

OProfile uses dcookies to pass path information from kernel to user 
space. There are a couple advantages to this approach for OProfile. A 
small, fixed-size integer is passed to user space rather than a 
potentially large, variable-length string. Also the redundancy is 
factored out. There is a system call to convert a dcookie to a string. 
Would it be possible to consider the inverse operation, convert a path 
into a dcookie? Then use dcookie instead.

-Will



More information about the Systemtap mailing list