Re: Problem: how to identify source code points for latency profiling

Marty Leisner (leisner@sdsp.mc.xerox.com)
Mon, 10 Jun 1996 13:40:01 PDT


> On Sun, 9 Jun 1996, Alan Cox wrote:
>
> > > what is the point of using __inline__ functions ...
> > >
> > > __inline__ void foo( arg ) {
> >
> > Arg is evaluated once. You don't get burned by nasty macro expansion
> > side effects (especially since we nest inlines 3 deep in places).
>
> i will use the IP pointer instead of __FILE__ and __LINE__ then, as a
> global identifier for source code points. It's more robust anyways.
>
> about transforming IP values (code addresses) into symbols later:
>
>

You can always do this in C:

good_foo(const int lineno, const char *file, const char *function, ...)
{
stuff...
}

#define foo(i) good_foo(__LINE__, __FILE__, __FUNCTION__, i)

then call
foo()

For nonvarargs functions, the compiler can collapse the extra arguments
if their not used in good_foo

>

-- 
marty
leisner@sdsp.mc.xerox.com  
Member of the League for Programming Freedom