[lkml]   [2008]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [RFC][PATCH] Make ftrace able to trace function return

    * Frédéric Weisbecker <> wrote:

    > 2008/10/30 Ingo Molnar <>:
    > > 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 ;-)

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2008-10-30 19:39    [W:0.025 / U:7.680 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site