[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1256574910.5642.228.camel@falcon>
Date: Tue, 27 Oct 2009 00:35:10 +0800
From: Wu Zhangjin <wuzhangjin@...il.com>
To: rostedt@...dmis.org
Cc: linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org,
Frederic Weisbecker <fweisbec@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ralf Baechle <ralf@...ux-mips.org>,
Richard Sandiford <rdsandiford@...glemail.com>,
Nicholas Mc Guire <der.herr@...r.at>,
David Daney <ddaney@...iumnetworks.com>,
Adam Nemet <anemet@...iumnetworks.com>,
Patrik Kluba <kpajko79@...il.com>
Subject: Re: [PATCH -v6 07/13] tracing: add dynamic function tracer support
for MIPS
Hi,
[...]
> > +
> > +NESTED(ftrace_caller, PT_SIZE, ra)
> > + .globl _mcount
> > +_mcount:
> > + j ftrace_stub
> > + nop
> > + lw t0, function_trace_stop
> > + bnez t0, ftrace_stub
> > + nop
> > +
> > + MCOUNT_SAVE_REGS
> > +
> > + MCOUNT_SET_ARGS
> > + .globl ftrace_call
> > +ftrace_call:
> > + nop /* a placeholder for the call to a real tracing function */
> > + nop /* Do not touch me, I'm in the dealy slot of "jal func" */
>
> Indent the second nop ;-)
>
Yup, later in -v7.
> > + $mcount_regex = "^\\s*([0-9a-fA-F]+): R_MIPS_HI16\\s+_mcount\$";
> > + $objdump .= " -Melf-trad".$endian."mips ";
> > +
> > + if ($endian eq "big") {
> > + $endian = " -EB ";
> > + $ld .= " -melf".$bits."btsmip";
> > + } else {
> > + $endian = " -EL ";
> > + $ld .= " -melf".$bits."ltsmip";
> > + }
> > +
> > + $cc .= " -mno-abicalls -fno-pic -mabi=" . $bits . $endian;
> > + $ld .= $endian;
> > +
> > + if ($bits == 64) {
> > + $function_regex =
> > + "^([0-9a-fA-F]+)\\s+<(.|[^\$]L.*?|\$[^L].*?|[^\$][^L].*?)>:";
> > + $type = ".dword";
> > + }
> > +
> > } else {
> > die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
> > }
>
> So if I convert mips to do what ppc does, we can remove the long jump
> thing, right?
>
If remove the long jump, we at least to change the $mcount_regex in
scripts/recordmcount.pl, the addr + 12 in arch/mips/include/asm/ftrace.h
and the _mcount & ftrace_caller in mcount.S and the ftrace_make_nop &
ftrace_make_call in arch/mips/kernel/ftrace.c back to the -v4 version.
I think this method of supporting module is not that BAD, no obvious
overhead added except the "lui...addiu..." and two more "nop"
instructions. and it's very understandable, so, just use this version?
Regards,
Wu Zhangjin
--
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