From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 14 Nov 2009 07:35:05 +0100 (CET) Received: from mail-pw0-f45.google.com ([209.85.160.45]:52839 "EHLO mail-pw0-f45.google.com" rhost-flags-OK-OK-OK-OK) by ftp.linux-mips.org with ESMTP id S1492235AbZKNGeS (ORCPT ); Sat, 14 Nov 2009 07:34:18 +0100 Received: by mail-pw0-f45.google.com with SMTP id 15so2474684pwi.24 for ; Fri, 13 Nov 2009 22:34:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; 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=9uMvLeSbhSJNHmLl2wsbYtWb3+kpy5epJgYb26EL9Qw=; b=PYGXvuPZAJxP6TJzrnEtMZZVm8J5DZ+2aKqek0RS86WQRbYOAws68ZkLfwcgRZGuco fF1VLMvAMg+4e1NbYsFncXPrNFizanCy11gGpi6UuexLAxe1Di1lUSsiz10MtA1MI4sY ZItd2Ei4GP/Qkf3hux1ytBbgi+fz94PjulgZE= 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=E10SB5h708omvjbyeWEeSGyRscGjnD0a2U8AIEGrbe8Hh8EFnO1iZUY+LmVXHiXRzw E4x76PiHBX87XVXYpelHC4CbrD5uHfgTcMq43fGSv5QgA4NbZkY4QeF2AWmXn+1i/wD8 OXy8eFI8BxWaRCGyegqMdCqHQkSi/AHjH8K6E= Received: by 10.115.80.6 with SMTP id h6mr2852331wal.108.1258180457059; Fri, 13 Nov 2009 22:34:17 -0800 (PST) Received: from localhost.localdomain ([222.92.8.142]) by mx.google.com with ESMTPS id 20sm2668108pzk.5.2009.11.13.22.34.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 13 Nov 2009 22:34:16 -0800 (PST) From: Wu Zhangjin To: rostedt@goodmis.org, Ralf Baechle Cc: Wu Zhangjin , Frederic Weisbecker , Ingo Molnar , Nicholas Mc Guire , David Daney , Richard Sandiford , Patrik Kluba , Thomas Gleixner , Michal Simek , "Maciej W . Rozycki" , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, zhangfx@lemote.com, zhouqg@gmail.com Subject: [PATCH v8 03/16] tracing: add MIPS specific trace_clock_local() Date: Sat, 14 Nov 2009 14:33:18 +0800 Message-Id: <8f579e2cece16cd22358a4ec143ef6a8c462639b.1258177321.git.wuzhangjin@gmail.com> X-Mailer: git-send-email 1.6.2.1 In-Reply-To: References: <9dc81a7a9e5a292cccdf465c533a2b08d19d6021.1258177321.git.wuzhangjin@gmail.com> In-Reply-To: References: Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 24894 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: wuzhangjin@gmail.com Precedence: bulk X-list: linux-mips 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