lkml.org 
[lkml]   [1996]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Problem: how to identify source code points for latency profiling
Date
From
> 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




\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.062 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site