Re: dynamic ftrace - graph

Steven Rostedt
2009-12-11T15:54:23Z

On Fri, 2009-12-11 at 16:28 +0100, Michal Simek wrote:
> Steven Rostedt wrote:
> > On Fri, 2009-12-11 at 15:40 +0100, Michal Simek wrote:
> >> Steven Rostedt wrote:
> >
> >>> Hey, if they work and they are only in your arch, then I'm fine with
> >>> them ;-)
> >> yeah. There is one just small hook to recordmcount.pl. :-)
> >
> > I may need to give an acked-by. If I did not yet, could you send me that
> > specific patch.
>
> I sent that patches to LKML last month - you were cc'd.
> http://lkml.org/lkml/2009/11/23/48

They are probably still in the "todo" pile ;-)

>
> You should get it in your mailbox
>
> That part is pretty easy. :-)
>
> diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
> index 090d300..b30dabd 100755
> --- a/scripts/recordmcount.pl
> +++ b/scripts/recordmcount.pl
> @@ -245,6 +245,9 @@ if ($arch eq "x86_64") {
> $ld .= " -m elf64_sparc";
> $cc .= " -m64";
> $objcopy .= " -O elf64-sparc";
> +} elsif ($arch eq "microblaze") {
> + # Microblaze calls '_mcount' instead of plain 'mcount'.
> + $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
> } else {
> die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
> }

If that's all it is, then here:

Acked-by: Steven Rostedt <rostedt@goodmis.org>

>
>
> >
> >
> >> we will see. Currently I have small problem only with irqsoff but I
> >> think this don't have connection with ftrace - only with lockdep I
> >> think. :-)
> >
> > You have lockdep working? If you get lockdep working you should get the
> > irqsoff tracer for free.
>
> I have some problems when I turn on lockdep debug (CONFIG_DEBUG_LOCKDEP)
> - kernel freeze for currently unknown reason.
> I saw that some arch has some part of code in entry.S but I haven't had
> a time to look at them - maybe needs some changes there too.

Yeah, anytime you disable interrupts or enable them (including when the
hardware does it from entering an exception), you need to call into the
lockdep infrastructure (trace_hardiqs_on/off){_caller}.

>
> As you can see below locking testsuite output looks fine but irqsoff
> tracer freeze the kernel. Function tracer is ok.
>
> There could be a problem with some arch specific functions which
> shouldn't be compiled with -pg.

Does it still freeze if you don't enable the function tracer?

>
> Any suggestions? :-)
>

> # cd /
> # mkdir debug
> # mount -t debugfs none /debug
> # cat /debug/tracing/available_tracers
> irqsoff function sched_switch nop
> # echo irqsoff > /debug/tracing/current_tracer
>
> and kernel freeze. :-(

Try it without configuring function tracer, or you could also do:

echo 0 > /proc/sys/ftrace_enabled

That will also disable the function tracer.

-- Steve