[PATCH] lib/tevent: Add trace point callback

simo idra at samba.org
Fri Jun 8 06:01:13 MDT 2012


On Fri, 2012-06-08 at 13:53 +0200, Volker Lendecke wrote: 
> On Fri, Jun 08, 2012 at 07:36:10AM -0400, simo wrote:
> > On Fri, 2012-06-08 at 13:32 +0200, Volker Lendecke wrote: 
> > > On Fri, Jun 08, 2012 at 07:29:34AM -0400, simo wrote:
> > > > I guess it would also be a good idea to inline
> > > > tevent_trace_point_callback()
> > > 
> > > Are you sure? What about the branch prediction cache?
> > 
> > It really depends on how much this will end up being used.
> > Perhaps right now it is not a big deal, but tracing functions have the
> > bad habit of ending up being used in critical paths in the long run :)
> 
> Right. That's why I think there's a trade-off. How expensive
> is calling a function vs a branch prediction miss? We have
> an if-statement in that function that has the same outcome
> throughout the whole program run. Do we benefit from a
> correct branch prediction more than we do from a
> non-executed call/return?

I am not sure I see your point, as it is the function call is always
executed, the inline would remove that part. The if statement will
always be executed (eventually branch predicted) but in the main
function.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list