mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wu Zhangjin <wuzhangjin@gmail.com>
To: rostedt@goodmis.org, Ralf Baechle <ralf@linux-mips.org>
Cc: Wu Zhangjin <wuzhangjin@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, Nicholas Mc Guire <der.herr@hofr.at>,
	David Daney <ddaney@caviumnetworks.com>,
	Richard Sandiford <rdsandiford@googlemail.com>,
	Patrik Kluba <kpajko79@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Michal Simek <monstr@monstr.eu>,
	"Maciej W . Rozycki" <macro@linux-mips.org>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	zhangfx@lemote.com, zhouqg@gmail.com
Subject: [PATCH v8 09/16] tracing: define a new __time_notrace annotation flag
Date: Sat, 14 Nov 2009 14:33:24 +0800	[thread overview]
Message-ID: <c1fe0d6822e98bc0ffd2dfee7a579fbbe21430e0.1258177321.git.wuzhangjin@gmail.com> (raw)
In-Reply-To: <99ebd8fcb19e4cccd702fca966405ffc45f8540b.1258177321.git.wuzhangjin@gmail.com>
In-Reply-To: <cover.1258177321.git.wuzhangjin@gmail.com>

From: Wu Zhangjin <wuzhangjin@gmail.com>

Ftrace gets the timestamp via time relative functions, when enabling
function graph tracer, if we also trace these functions, the system will
go into recusion and then hang there. So, we must not trace them. and
there are two existing methods help this job.

The first one is annotating them with notrace, another method is
removing the -pg for the whole file which included them:

CFLAGS_REMOVE_ftrace.o = -pg

But there is a particular situation, that is some archs(i.e MIPS,
Microblaze) need to notrace the common time relative source code, we can
not simply annotate them with the above methods, but need to consider
the archs respectively. this patch does it!

This patch introduce a new annotation flag: __time_notrace, if your
platform need it, define it in your arch specific ftrace.h:

	#define __time_notrace notrace

if only function graph trace need it, wrap it:

	#ifdef CONFIG_FUNCTION_GRAPH_TRACER
	 #define __time_notrace notrace
	#endif

otherwise, ignore it!

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
---
 include/linux/ftrace.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 0b4f97d..c3f2f0f 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -511,4 +511,16 @@ static inline void trace_hw_branch_oops(void) {}
 
 #endif /* CONFIG_HW_BRANCH_TRACER */
 
+/* arch specific notrace for time relative functions, If your arch need it,
+ * define it in the arch specific ftrace.h
+ *
+ *	#define __time_notrace notrace
+ *
+ * otherwise, ignore it!
+ */
+
+#ifndef __time_notrace
+ #define __time_notrace
+#endif
+
 #endif /* _LINUX_FTRACE_H */
-- 
1.6.2.1


  parent reply	other threads:[~2009-11-14  6:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-14  6:30 [PATCH v8 00/16] ftrace for MIPS Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 01/16] tracing: convert trace_clock_local() as weak function Wu Zhangjin
2009-11-16 15:01   ` Steven Rostedt
2009-11-16 15:07   ` Thomas Gleixner
2009-11-16 15:21     ` Wu Zhangjin
2009-11-16 15:47     ` Michal Simek
2009-11-14  6:33 ` [PATCH v8 02/16] tracing: add mips_timecounter_read() for MIPS Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 03/16] tracing: add MIPS specific trace_clock_local() Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 04/16] tracing: add static function tracer support for MIPS Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 05/16] tracing: enable HAVE_FUNCTION_TRACE_MCOUNT_TEST " Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 06/16] tracing: add an endian argument to scripts/recordmcount.pl Wu Zhangjin
2009-11-16 14:21   ` Thomas Gleixner
2009-11-16 14:29     ` Wu Zhangjin
2009-11-16 15:10       ` Steven Rostedt
2009-11-16 15:32       ` Thomas Gleixner
2009-11-14  6:33 ` [PATCH v8 07/16] tracing: add dynamic function tracer support for MIPS Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 08/16] tracing: add IRQENTRY_EXIT section " Wu Zhangjin
2009-11-14  6:33 ` Wu Zhangjin [this message]
2009-11-14  6:33 ` [PATCH v8 10/16] tracing: not trace the timecounter_read* in kernel/time/clocksource.c Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 11/16] tracing: not trace mips_timecounter_read() for MIPS Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 12/16] tracing: add function graph tracer support " Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 13/16] tracing: add dynamic function graph tracer " Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 14/16] tracing: make ftrace for MIPS work without -fno-omit-frame-pointer Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 15/16] tracing: reserve $12(t0) for mcount-ra-address of gcc 4.5 Wu Zhangjin
2009-11-14  6:33 ` [PATCH v8 16/16] tracing: make function graph tracer work with -mmcount-ra-address Wu Zhangjin
2009-11-16 13:48 ` [PATCH v8 00/16] ftrace for MIPS Ralf Baechle
2009-11-16 14:19   ` Thomas Gleixner

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=c1fe0d6822e98bc0ffd2dfee7a579fbbe21430e0.1258177321.git.wuzhangjin@gmail.com \
    --to=wuzhangjin@gmail.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=macro@linux-mips.org \
    --cc=mingo@elte.hu \
    --cc=monstr@monstr.eu \
    --cc=ralf@linux-mips.org \
    --cc=rdsandiford@googlemail.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=zhangfx@lemote.com \
    --cc=zhouqg@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®