Re: [PATCHv9 2.6.35-rc4-tip 10/13] perf: Re-Add make_absolute_path

From: Srikar Dronamraju
Date: Mon Jul 12 2010 - 11:42:35 EST


* Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxx> [2010-07-12 11:00:23]:

> Em Mon, Jul 12, 2010 at 04:04:12PM +0530, Srikar Dronamraju escreveu:
> > perf: Re-Add make_absolute_path
> >
> > perf probe for uprobes would use make_absolute_path.
> > make_absolute_path can be used to convert a file name to a dso name.
> >
> > so if user specifies the function to be traced as malloc@/lib/libc.so.6
> > it needs to be converted to malloc@xxxxxxxxxxx
>
> Isn't this the other way around? I.e. "if the user specifies
> malloc@xxxxxxxxxxx it needs to be converted to malloc@/lib/libc.so.6"?
>

Actually we dont need to convert malloc@xxxxxxxxxxx to a
malloc@/lib/libc.so.6. Because we can match the shortname of the dso.

Problem will occur when users specifies a full path of the file.
Since the file can refer to a symbolic link and the dso will have just
the short name or the target file name. Here I am using
make_absolute_path to resolve to the target file.
Now we can then either check on dso full names or short names.
I have chosen to use the short name.


> Also please remove the xstrdup and die calls from this function, we're
> trying to get rid of all such 'panic' like functions so that we can
> librarize as much code as possible.

Okay, Can I do that in subsequent versions of the patchset?

--
Thanks and Regards
Srikar

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/