lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081030183714.GA17822@elte.hu>
Date:	Thu, 30 Oct 2008 19:37:14 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Frédéric Weisbecker <fweisbec@...il.com>
Cc:	Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH] Make ftrace able to trace function return


* Frédéric Weisbecker <fweisbec@...il.com> wrote:

> 2008/10/30 Ingo Molnar <mingo@...e.hu>:
> > hm, are you aware of the -finstrument-functions feature of GCC?
> >
> > that feature generates such entry points at build time:
> >
> >                   void __cyg_profile_func_enter (void *this_fn,
> >                                                  void *call_site);
> >                   void __cyg_profile_func_exit  (void *this_fn,
> >                                                  void *call_site);
> 
> Oh I didn't know it.
> But wouldn't it conflict with the -pg used for mcount in ftrace?

i dont think the two can be enabled at once. If then it would replace 
the mcount stuff. (but the principle is very similar)

I'm wondering whether it's worth it though.

> > this might be faster/cleaner than using a trampoline approach IMO.
> 
> Yes, oubviously!
> 
> > OTOH, entry+exit profiling has about double the cost of just entry
> > profiling - so maybe there should be some runtime flexibility there.
> > Plus the same recordmcount trick should be used to patch up these
> > entry points to NOP by default.
> 
> Yes that's right. Hm I don't know what to do since there is already 
> mcount....

just dont use -pg, only use -finstrument-functions.

when i wrote my first mcount tracer many eons ago i knew about 
-finstrument-functions and decided against it based on the fact that 
it doubles the cost of profiling.

OTOH, dyn-ftrace changes the picture dramatically, with its NOP 
insertion and opt-in tricks. Still, one more 5-byte NOP in every 
function is still something not to be done lightly.

In that sense your mcount enhancement is better, as it does not 
increase the default (single NOP) cost. It can also be 
enabled/disabled dynamically in addition to the 'half-way profiling' 
mcount solution we have today. So i like it at first sight - if it can 
be made stable ;-)

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ