From: Mathieu Desnoyers <compudj@krystal.dyndns.org>
To: David Daney <ddaney@caviumnetworks.com>
Cc: ltt-dev@lists.casi.polymtl.ca, linux-mips@linux-mips.org
Subject: Re: [ltt-dev] [PATCH 3/3] lttng: MIPS: Use 64 bit counter for trace clock on Octeon CPUs.
Date: Tue, 20 Apr 2010 09:56:59 -0400 [thread overview]
Message-ID: <20100420135659.GC25175@Krystal> (raw)
In-Reply-To: <1271722791-27885-4-git-send-email-ddaney@caviumnetworks.com>
* David Daney (ddaney@caviumnetworks.com) wrote:
> Cavium Octeon CPUs have a 64-bit cycle counter that is synchronized
> when the CPUs are brought on-line. So for this case we don't need any
> fancy stuff.
Merged into the LTTng tree, with refactoring of the Octeon-specific
header file code into a new arch/mips/include/asm/octeon/trace-clock.h
file.
Thanks!
Mathieu
>
> Signed-off-by: David Daney <ddaney@caviumnetworks.com>
> ---
> arch/mips/Kconfig | 4 +-
> arch/mips/include/asm/trace-clock.h | 39 ++++++++++++++++++++++++++++++++++-
> arch/mips/kernel/smp.c | 2 +
> 3 files changed, 42 insertions(+), 3 deletions(-)
>
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index a690e9b..9e91e8c 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -1782,8 +1782,8 @@ config HAVE_GET_CYCLES_32
> def_bool y
> depends on !CPU_R4400_WORKAROUNDS
> select HAVE_TRACE_CLOCK
> - select HAVE_TRACE_CLOCK_32_TO_64
> - select HAVE_UNSYNCHRONIZED_TSC
> + select HAVE_TRACE_CLOCK_32_TO_64 if (!CPU_CAVIUM_OCTEON)
> + select HAVE_UNSYNCHRONIZED_TSC if (!CPU_CAVIUM_OCTEON)
>
> #
> # Use the generic interrupt handling code in kernel/irq/:
> diff --git a/arch/mips/include/asm/trace-clock.h b/arch/mips/include/asm/trace-clock.h
> index 3d8cb0f..a052f42 100644
> --- a/arch/mips/include/asm/trace-clock.h
> +++ b/arch/mips/include/asm/trace-clock.h
> @@ -12,6 +12,43 @@
>
> #define TRACE_CLOCK_MIN_PROBE_DURATION 200
>
> +#ifdef CONFIG_CPU_CAVIUM_OCTEON
> +
> +#include <asm/octeon/octeon.h>
> +
> +#define TC_HW_BITS 64
> +
> +static inline u32 trace_clock_read32(void)
> +{
> + return (u32)read_c0_cvmcount(); /* only need the 32 LSB */
> +}
> +
> +static inline u64 trace_clock_read64(void)
> +{
> + return read_c0_cvmcount();
> +}
> +
> +static inline u64 trace_clock_frequency(void)
> +{
> + return octeon_get_clock_rate();
> +}
> +
> +static inline u32 trace_clock_freq_scale(void)
> +{
> + return 1;
> +}
> +
> +static inline void get_trace_clock(void)
> +{
> + return;
> +}
> +
> +static inline void put_trace_clock(void)
> +{
> + return;
> +}
> +
> +#else /* !CONFIG_CPU_CAVIUM_OCTEON */
> /*
> * Number of hardware clock bits. The higher order bits are expected to be 0.
> * If the hardware clock source has more than 32 bits, the bits higher than the
> @@ -65,7 +102,7 @@ static inline void put_trace_clock(void)
> {
> put_synthetic_tsc();
> }
> -
> +#endif /* CONFIG_CPU_CAVIUM_OCTEON */
> static inline void set_trace_clock_is_sync(int state)
> {
> }
> diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
> index f8c50d1..42083eb 100644
> --- a/arch/mips/kernel/smp.c
> +++ b/arch/mips/kernel/smp.c
> @@ -159,7 +159,9 @@ void __init smp_cpus_done(unsigned int max_cpus)
> {
> mp_ops->cpus_done();
> synchronise_count_master();
> +#ifdef CONFIG_HAVE_UNSYNCHRONIZED_TSC
> test_tsc_synchronization();
> +#endif
> }
>
> /* called from main before smp_init() */
> --
> 1.6.6.1
>
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev@lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
prev parent reply other threads:[~2010-04-20 13:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-20 0:19 [PATCH 0/3] LTTng patches for MIPS CPUs David Daney
2010-04-20 0:19 ` [PATCH 1/3] lttng: MIPS: Fix syscall entry tracing David Daney
2010-04-20 13:55 ` [ltt-dev] " Mathieu Desnoyers
2010-04-20 0:19 ` [PATCH 2/3] lttng: MIPS: Dump MIPS system call tables David Daney
2010-04-20 13:56 ` [ltt-dev] " Mathieu Desnoyers
2010-04-20 0:19 ` [PATCH 3/3] lttng: MIPS: Use 64 bit counter for trace clock on Octeon CPUs David Daney
2010-04-20 13:56 ` Mathieu Desnoyers [this message]
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=20100420135659.GC25175@Krystal \
--to=compudj@krystal.dyndns.org \
--cc=ddaney@caviumnetworks.com \
--cc=linux-mips@linux-mips.org \
--cc=ltt-dev@lists.casi.polymtl.ca \
/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