From: Wu Zhangjin <wuzhangjin@gmail.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
rostedt@goodmis.org, Thomas Gleixner <tglx@linutronix.de>,
Ralf Baechle <ralf@linux-mips.org>,
Nicholas Mc Guire <der.herr@hofr.at>,
Richard Sandiford <rdsandiford@googlemail.com>,
David Daney <ddaney@caviumnetworks.com>,
Adam Nemet <anemet@caviumnetworks.com>,
Patrik Kluba <kpajko79@gmail.com>
Subject: Re: [PATCH -v5 08/11] tracing: not trace mips_timecounter_init() in MIPS
Date: Mon, 26 Oct 2009 17:42:36 +0800 [thread overview]
Message-ID: <1256550156.5642.148.camel@falcon> (raw)
In-Reply-To: <c62985530910251727o23beafcco539870e4b2f84637@mail.gmail.com>
On Mon, 2009-10-26 at 01:27 +0100, Frederic Weisbecker wrote:
> 2009/10/25 Wu Zhangjin <wuzhangjin@gmail.com>:
> > -static inline u64 mips_timecounter_read(void)
> > +static inline u64 notrace mips_timecounter_read(void)
>
>
> You don't need to set notrace functions, unless their addresses
> are referenced somewhere, which unfortunately might happen
> for some functions but this is rare.
>
Okay, Will remove it.
>
> > {
> > #ifdef CONFIG_CSRC_R4K
> > return r4k_timecounter_read();
> > diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c
> > index 4e7705f..0690bea 100644
> > --- a/arch/mips/kernel/csrc-r4k.c
> > +++ b/arch/mips/kernel/csrc-r4k.c
> > @@ -42,7 +42,7 @@ static struct timecounter r4k_tc = {
> > .cc = NULL,
> > };
> >
> > -static cycle_t r4k_cc_read(const struct cyclecounter *cc)
> > +static cycle_t notrace r4k_cc_read(const struct cyclecounter *cc)
> > {
> > return read_c0_count();
> > }
> > @@ -66,7 +66,7 @@ int __init init_r4k_timecounter(void)
> > return 0;
> > }
> >
> > -u64 r4k_timecounter_read(void)
> > +u64 notrace r4k_timecounter_read(void)
> > {
> > u64 clock;
> >
> > diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
> > index 83d2fbd..2a02992 100644
> > --- a/include/linux/clocksource.h
> > +++ b/include/linux/clocksource.h
> > @@ -73,7 +73,7 @@ struct timecounter {
> > * XXX - This could use some mult_lxl_ll() asm optimization. Same code
> > * as in cyc2ns, but with unsigned result.
> > */
> > -static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc,
> > +static inline u64 notrace cyclecounter_cyc2ns(const struct cyclecounter
>
> ditto here.
>
Will remove it too.
>
> *cc,
> > cycle_t cycles)
> > {
> > u64 ret = (u64)cycles;
> > diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
> > index 5e18c6a..9ce9d02 100644
> > --- a/kernel/time/clocksource.c
> > +++ b/kernel/time/clocksource.c
> > @@ -52,7 +52,7 @@ EXPORT_SYMBOL(timecounter_init);
> > * The first call to this function for a new time counter initializes
> > * the time tracking and returns an undefined result.
> > */
> > -static u64 timecounter_read_delta(struct timecounter *tc)
> > +static u64 notrace timecounter_read_delta(struct timecounter *tc)
> > {
> > cycle_t cycle_now, cycle_delta;
> > u64 ns_offset;
> > @@ -72,7 +72,7 @@ static u64 timecounter_read_delta(struct timecounter
>
>
> Hmm yeah this is not very nice to do that in core functions because
> of a specific arch problem.
> At least you have __notrace_funcgraph, this is a notrace
> that only applies if CONFIG_FUNCTION_GRAPH_TRACER
> so that it's still traceable by the function tracer in this case.
>
> But I would rather see a __mips_notrace on these two core functions.
What about this: __arch_notrace? If the arch need this, define it,
otherwise, ignore it! if only graph tracer need it, define it in "#ifdef
CONFIG_FUNCTION_GRAPH_TRACER ... #endif".
diff --git a/arch/mips/include/asm/ftrace.h
b/arch/mips/include/asm/ftrace.h
index d5771e8..eeacd51 100644
--- a/arch/mips/include/asm/ftrace.h
+++ b/arch/mips/include/asm/ftrace.h
@@ -31,6 +31,11 @@ static inline unsigned long
ftrace_call_adjust(unsigned long addr)
struct dyn_arch_ftrace {
};
#endif /* CONFIG_DYNAMIC_FTRACE */
+
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+#define __arch_notrace
+#endif
+
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_FUNCTION_TRACER */
#endif /* _ASM_MIPS_FTRACE_H */
[...]
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 0b4f97d..959c8b3 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -511,4 +511,12 @@ static inline void trace_hw_branch_oops(void) {}
#endif /* CONFIG_HW_BRANCH_TRACER */
+/* arch specific notrace */
+#ifndef __arch_notrace
+#define __arch_notrace
+#else
+#undef __arch_notrace
+#define __arch_notrace notrace
+#endif
+
#endif /* _LINUX_FTRACE_H */
[...]
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 9ce9d02..91acdf7 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -30,6 +30,7 @@
#include <linux/sched.h> /* for spin_unlock_irq() using preempt_count()
m68k */
#include <linux/tick.h>
#include <linux/kthread.h>
+#include <linux/ftrace.h>
void timecounter_init(struct timecounter *tc,
const struct cyclecounter *cc,
@@ -52,7 +53,7 @@ EXPORT_SYMBOL(timecounter_init);
* The first call to this function for a new time counter initializes
* the time tracking and returns an undefined result.
*/
-static u64 notrace timecounter_read_delta(struct timecounter *tc)
+static u64 __arch_notrace timecounter_read_delta(struct timecounter
*tc)
{
cycle_t cycle_now, cycle_delta;
u64 ns_offset;
@@ -72,7 +73,7 @@ static u64 notrace timecounter_read_delta(struct
timecounter *tc)
return ns_offset;
}
-u64 notrace timecounter_read(struct timecounter *tc)
+u64 __arch_notrace timecounter_read(struct timecounter *tc)
{
u64 nsec;
Regards,
Wu Zhangjin
next prev parent reply other threads:[~2009-10-26 9:43 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-25 15:16 [PATCH -v5 00/11] ftrace for MIPS Wu Zhangjin
[not found] ` <cover.1256483735.git.wuzhangjin@gmail.com>
2009-10-25 15:16 ` [PATCH -v5 01/11] tracing: convert trace_clock_local() as weak function Wu Zhangjin
2009-10-25 15:16 ` [PATCH -v5 02/11] MIPS: add mips_timecounter_read() to get high precision timestamp Wu Zhangjin
2009-10-26 14:01 ` Steven Rostedt
2009-10-26 14:25 ` Wu Zhangjin
2009-10-26 14:34 ` Steven Rostedt
2009-10-26 14:42 ` Wu Zhangjin
2009-10-25 15:16 ` [PATCH -v5 03/11] tracing: add MIPS specific trace_clock_local() Wu Zhangjin
2009-10-25 15:16 ` [PATCH -v5 04/11] tracing: add static function tracer support for MIPS Wu Zhangjin
2009-10-25 15:16 ` [PATCH -v5 05/11] tracing: enable HAVE_FUNCTION_TRACE_MCOUNT_TEST " Wu Zhangjin
2009-10-25 15:16 ` [PATCH -v5 06/11] tracing: add an endian argument to scripts/recordmcount.pl Wu Zhangjin
2009-10-25 15:16 ` [PATCH -v5 07/11] tracing: add dynamic function tracer support for MIPS Wu Zhangjin
2009-10-25 15:16 ` [PATCH -v5 08/11] tracing: not trace mips_timecounter_init() in MIPS Wu Zhangjin
2009-10-26 0:27 ` Frederic Weisbecker
2009-10-26 0:27 ` Frederic Weisbecker
2009-10-26 9:42 ` Wu Zhangjin [this message]
2009-11-02 21:43 ` Frederic Weisbecker
2009-11-03 1:34 ` Wu Zhangjin
2009-11-09 4:31 ` Wu Zhangjin
2009-11-09 11:53 ` Frederic Weisbecker
2009-11-09 12:08 ` Wu Zhangjin
2009-11-09 12:54 ` Steven Rostedt
2009-11-09 14:35 ` Wu Zhangjin
2009-10-25 15:17 ` [PATCH -v5 09/11] tracing: add IRQENTRY_EXIT for MIPS Wu Zhangjin
2009-10-26 0:36 ` Frederic Weisbecker
2009-10-26 7:26 ` Wu Zhangjin
2009-10-27 17:39 ` Frederic Weisbecker
2009-10-27 17:46 ` Frederic Weisbecker
2009-10-25 15:17 ` [PATCH -v5 10/11] tracing: add function graph tracer support " Wu Zhangjin
2009-10-26 15:13 ` Steven Rostedt
2009-10-26 16:11 ` Wu Zhangjin
2009-10-26 16:32 ` Steven Rostedt
2009-10-26 16:57 ` Wu Zhangjin
2009-10-26 17:11 ` Steven Rostedt
2009-10-25 15:17 ` [PATCH -v5 11/11] tracing: add dynamic function graph tracer " Wu Zhangjin
2009-10-26 1:13 ` [PATCH -v5 10/11] tracing: add function graph tracer support " Wu Zhangjin
2009-10-26 0:42 ` [PATCH -v5 00/11] ftrace " Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1256550156.5642.148.camel@falcon \
--to=wuzhangjin@gmail.com \
--cc=anemet@caviumnetworks.com \
--cc=ddaney@caviumnetworks.com \
--cc=der.herr@hofr.at \
--cc=fweisbec@gmail.com \
--cc=kpajko79@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=rdsandiford@googlemail.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.