[Top] [All Lists]

[PATCH -v6 10/13] tracing: not trace the timecounter_read* in kernel/tim

Subject: [PATCH -v6 10/13] tracing: not trace the timecounter_read* in kernel/time/clocksource.c
From: Wu Zhangjin <>
Date: Mon, 26 Oct 2009 23:13:27 +0800
Cc: Wu Zhangjin <>, Frederic Weisbecker <>,, Thomas Gleixner <>, Ralf Baechle <>, Richard Sandiford <>, Nicholas Mc Guire <>, David Daney <>, Adam Nemet <>, Patrik Kluba <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:in-reply-to:references; bh=5V6qC/UCQArhzNRD0PSxRjxW1Xci5btQmV+HopSM8Ow=; b=bFSCDRsxwFzCHsiP2J4LiS3e1bQKMjme0POoR04Gv1d37LZvEDPStf3bvhfExDd0yJ cdaQlv1FdmMM5ALvn5iZKGOokKGZQvhl/sLQLGHjNw43JtRYdxeVC+a6P1GH9sin39Y/ EClZdkPXFYdr2cizyqkU303V1X56oaEK7TMXU=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=FrXWXDGh/g1N+F0/7fxZ0+KajJ+ExinBA+ryBwPi2Wzb0xzKyIpI9vjT6IUPozpVnY blkKFRpNpTYlqIPYiBVpUOcf73caIkbULQo4gXRE3aEGJVN0cxtzaL1EMAt5Akl4mMfl UaesJpSpWJ8L+sQXaiBchBK+oxzE0BGqXalrg=
In-reply-to: <>
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <> <> <> <> <> <>
References: <>
Some platforms(i.e. MIPS) need these two functions to get the precise
timestamp, we use __arch_notrace(added in the last patch) to annotate
it. By default, __arch_notrace is empty, so, this patch have no
influence to the original functions, but if you really not need to trace
them, just add the following line into the arch specific ftrace.h:

        #define __arch_notrace

If only want to enable it for function graph tracer, add these lines

        #define __arch_notrace

Signed-off-by: Wu Zhangjin <>
 kernel/time/clocksource.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 5e18c6a..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 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 timecounter_read_delta(struct timecounter *tc)
        return ns_offset;
-u64 timecounter_read(struct timecounter *tc)
+u64 __arch_notrace timecounter_read(struct timecounter *tc)
        u64 nsec;

<Prev in Thread] Current Thread [Next in Thread>