Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756172AbZKIPcD (ORCPT ); Mon, 9 Nov 2009 10:32:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755983AbZKIPcC (ORCPT ); Mon, 9 Nov 2009 10:32:02 -0500 Received: from mail-fx0-f221.google.com ([209.85.220.221]:54876 "EHLO mail-fx0-f221.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756161AbZKIPb7 (ORCPT ); Mon, 9 Nov 2009 10:31:59 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=K3psMg1FLIcHrx6xA1D5Xv+jcymbOsIUAosH0QeMRq5ZR8o15aw0F7Lya2qJNSmtgt q4Fhz30sWarfiBFVzfJU2TL97AO6ESWVnyd2K5dnybldIZkmU/kkvby7q0n1jvd3x+A6 0u9CMespObd0FJAxykCKVzEjFWpYH/nemZ0lo= From: Wu Zhangjin To: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Cc: zhangfx@lemote.com, zhouqg@gmail.com, Wu Zhangjin , Ralf Baechle , rostedt@goodmis.org, Frederic Weisbecker , Ingo Molnar , Nicholas Mc Guire , David Daney , Richard Sandiford , Patrik Kluba , Thomas Gleixner , Michal Simek Subject: [PATCH v7 03/17] tracing: add MIPS specific trace_clock_local() Date: Mon, 9 Nov 2009 23:31:20 +0800 Message-Id: <8f579e2cece16cd22358a4ec143ef6a8c462639b.1257779502.git.wuzhangjin@gmail.com> X-Mailer: git-send-email 1.6.2.1 In-Reply-To: References: <9dc81a7a9e5a292cccdf465c533a2b08d19d6021.1257779502.git.wuzhangjin@gmail.com> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2527 Lines: 83 From: Wu Zhangjin This patch add the mips_timecounter_read() based high precision version of trace_clock_local(). Signed-off-by: Wu Zhangjin --- 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 + */ + +#include +#include + +#include + +/* + * 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/