All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wu Zhangjin <wuzhangjin@gmail.com>
To: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Cc: Wu Zhangjin <wuzhangjin@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	rostedt@goodmis.org, Thomas Gleixner <tglx@linutronix.de>,
	Ralf Baechle <ralf@linux-mips.org>,
	Richard Sandiford <rdsandiford@googlemail.com>,
	Nicholas Mc Guire <der.herr@hofr.at>,
	David Daney <ddaney@caviumnetworks.com>,
	Adam Nemet <anemet@caviumnetworks.com>,
	Patrik Kluba <kpajko79@gmail.com>
Subject: [PATCH -v6 03/13] tracing: add MIPS specific trace_clock_local()
Date: Mon, 26 Oct 2009 23:13:20 +0800	[thread overview]
Message-ID: <f290e125634d164ec65b09b24b269815f78455ab.1256569489.git.wuzhangjin@gmail.com> (raw)
In-Reply-To: <3f47087b70a965fd679b17a59521671296457df1.1256569489.git.wuzhangjin@gmail.com>
In-Reply-To: <cover.1256569489.git.wuzhangjin@gmail.com>

This patch add the mips_timecounter_read() based high precision version
of trace_clock_local().

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
---
 arch/mips/kernel/Makefile      |    6 ++++++
 arch/mips/kernel/trace_clock.c |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/kernel/trace_clock.c

diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 8e26e9c..f228868 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -8,6 +8,10 @@ obj-y		+= cpu-probe.o branch.o entry.o genex.o irq.o process.o \
 		   ptrace.o reset.o setup.o signal.o syscall.o \
 		   time.o topology.o traps.o unaligned.o watch.o
 
+ifdef CONFIG_FUNCTION_TRACER
+CFLAGS_REMOVE_trace_clock.o = -pg
+endif
+
 obj-$(CONFIG_CEVT_BCM1480)	+= cevt-bcm1480.o
 obj-$(CONFIG_CEVT_R4K_LIB)	+= cevt-r4k.o
 obj-$(CONFIG_MIPS_MT_SMTC)	+= cevt-smtc.o
@@ -24,6 +28,8 @@ obj-$(CONFIG_SYNC_R4K)		+= sync-r4k.o
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-$(CONFIG_MODULES)		+= mips_ksyms.o module.o
 
+obj-$(CONFIG_FTRACE)		+= trace_clock.o
+
 obj-$(CONFIG_CPU_LOONGSON2)	+= r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_MIPS32)	+= r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_MIPS64)	+= r4k_fpu.o r4k_switch.o
diff --git a/arch/mips/kernel/trace_clock.c b/arch/mips/kernel/trace_clock.c
new file mode 100644
index 0000000..0fe85ea
--- /dev/null
+++ b/arch/mips/kernel/trace_clock.c
@@ -0,0 +1,33 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive for
+ * more details.
+ *
+ * Copyright (C) 2009 Lemote Inc. & DSLab, Lanzhou University, China
+ * Author: Wu Zhangjin <wuzj@lemote.com>
+ */
+
+#include <linux/clocksource.h>
+#include <linux/sched.h>
+
+#include <asm/time.h>
+
+/*
+ * trace_clock_local(): the simplest and least coherent tracing clock.
+ *
+ * Useful for tracing that does not cross to other CPUs nor
+ * does it go through idle events.
+ */
+u64 trace_clock_local(void)
+{
+	unsigned long flags;
+	u64 clock;
+
+	raw_local_irq_save(flags);
+
+	clock = mips_timecounter_read();
+
+	raw_local_irq_restore(flags);
+
+	return clock;
+}
-- 
1.6.2.1


  reply	other threads:[~2009-10-26 15:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26 15:13 [PATCH -v6 00/13] ftrace for MIPS Wu Zhangjin
2009-10-26 15:13 ` [PATCH -v6 01/13] tracing: convert trace_clock_local() as weak function Wu Zhangjin
2009-10-26 15:13   ` [PATCH -v6 02/13] tracing: add mips_timecounter_read() for MIPS Wu Zhangjin
2009-10-26 15:13     ` Wu Zhangjin [this message]
2009-10-26 15:13       ` [PATCH -v6 04/13] tracing: add static function tracer support " Wu Zhangjin
2009-10-26 15:13         ` [PATCH -v6 05/13] tracing: enable HAVE_FUNCTION_TRACE_MCOUNT_TEST " Wu Zhangjin
2009-10-26 15:13           ` [PATCH -v6 06/13] tracing: add an endian argument to scripts/recordmcount.pl Wu Zhangjin
2009-10-26 15:13             ` [PATCH -v6 07/13] tracing: add dynamic function tracer support for MIPS Wu Zhangjin
2009-10-26 15:13               ` [PATCH -v6 08/13] tracing: add IRQENTRY_EXIT section " Wu Zhangjin
2009-10-26 15:13                 ` [PATCH -v6 09/13] tracing: Add __arch_notrace for arch specific requirement Wu Zhangjin
2009-10-26 15:13                   ` [PATCH -v6 10/13] tracing: not trace the timecounter_read* in kernel/time/clocksource.c Wu Zhangjin
2009-10-26 15:13                     ` [PATCH -v6 11/13] tracing: not trace mips_timecounter_read() for MIPS Wu Zhangjin
2009-10-26 15:13                       ` [PATCH -v6 12/13] tracing: add function graph tracer support " Wu Zhangjin
2009-10-26 15:13                         ` [PATCH -v6 13/13] tracing: add dynamic function graph tracer " Wu Zhangjin
2009-11-09  2:26                 ` [PATCH -v6 08/13] tracing: add IRQENTRY_EXIT section " Frederic Weisbecker
2009-11-09  3:31                   ` Wu Zhangjin
2009-11-09  3:31                     ` Wu Zhangjin
2009-11-09 11:36                     ` Frederic Weisbecker
2009-11-09 12:46                     ` Steven Rostedt
2009-11-09 12:48                     ` Steven Rostedt
2009-11-09  4:16                 ` Wu Zhangjin
2009-10-26 16:06               ` [PATCH -v6 07/13] tracing: add dynamic function tracer support " Steven Rostedt
2009-10-26 16:35                 ` Wu Zhangjin
2009-10-26 16:45                   ` Steven Rostedt
2009-10-26 17:35                     ` Wu Zhangjin
2009-10-26 15:41           ` [PATCH -v6 05/13] tracing: enable HAVE_FUNCTION_TRACE_MCOUNT_TEST " Sergei Shtylyov
2009-10-26 15:57             ` Steven Rostedt
2009-10-26 15:57               ` Steven Rostedt
2009-10-26 16:16             ` Wu Zhangjin
2009-11-09  4:15     ` [PATCH -v6 02/13] tracing: add mips_timecounter_read() " Wu Zhangjin
2009-11-09  4:15       ` Wu Zhangjin
2009-11-09  2:10   ` [PATCH -v6 01/13] tracing: convert trace_clock_local() as weak function 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=f290e125634d164ec65b09b24b269815f78455ab.1256569489.git.wuzhangjin@gmail.com \
    --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.