This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: dereferencing filenames from a vfs_write probe
On Thu, 2008-03-20 at 12:24 -0500, dave-systemtap@skeptech.org wrote:
...
>
> This happens to be 2.6.16.19. I'm curious, how often do systemtap
> scripts need to change in practice because of data struture changes in
> the kernel?
It's not uncommon, but the tapset maintainers try to shield tapset users
from this. Grep for "kernel_v" and "LINUX_VERSION_CODE" in
src/tapset/*.stp to get an idea.
...
> Cool thanks. So based on that code I've chopped out the following function:
>
> function get_path:string (dentry:dentry *,vsmnt:vsmount *) %{
> char *page = (char *)__get_free_page(GFP_KERNEL);
> sprintf("%s",d_path(dentry, vfsmnt, page, PAGE_SIZE));
> free_page((unsigned long)page);
> %}
Keep in mind that a handler mustn't sleep, so you should use GFP_ATOMIC
rather than GFP_KERNEL.
And yeah, the dentry and vsmnt args should be declared long and cast to
the appropriate pointer types.
>
> ...
>
> Thanks
>
> --dave
Jim Keniston