Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: nareshgbhat@gmail.com (Naresh Bhat)
Subject: [ltt-dev] lttv unable to execute textDump on MIPS multicore target
Date: Thu, 17 Feb 2011 00:33:59 +0530	[thread overview]
Message-ID: <AANLkTikCcnj=2OTA9mUrMeWxpNTA+q-Bs=VVqLRtHc_h@mail.gmail.com> (raw)
In-Reply-To: <BLU0-SMTP53396496DB856B47F531CC96D20@phx.gbl>

Hi David/Matheu,

Yes, It was my mistake. I am sorry about that.

Here is my back ported working patch for 2.6.32 with lttng patch set
0.188 on MIPS architecture CAVM octeon plus (52xx, 58xx)  boards.

==============================================================================================

From abd8fb81cc1aea87a2867736251d1be15e02a51c Mon Sep 17 00:00:00 2001
From: Naresh Bhat <nareshgbhat@gmail.com>
Date: Wed, 16 Feb 2011 18:00:19 +0530
Subject: [PATCH] fix lttng mips use 64 bit counter for trace clock,
get_cycles on octeon

---
 arch/mips/Kconfig                          |    7 ++++
 arch/mips/include/asm/octeon/trace-clock.h |   43
++++++++++++++++++++++++++++
 arch/mips/include/asm/timex.h              |   35 ++++++++++++++++++++++-
 arch/mips/include/asm/trace-clock.h        |    5 +++
 arch/mips/kernel/smp.c                     |    2 +
 5 files changed, 91 insertions(+), 1 deletions(-)
 create mode 100644 arch/mips/include/asm/octeon/trace-clock.h

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 2aaf0a3..8e19a6d 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1739,10 +1739,17 @@ config CPU_R4400_WORKAROUNDS
 config HAVE_GET_CYCLES_32
  def_bool y
  depends on !CPU_R4400_WORKAROUNDS
+ depends on !CPU_CAVIUM_OCTEON
  select HAVE_TRACE_CLOCK
  select HAVE_TRACE_CLOCK_32_TO_64
  select HAVE_UNSYNCHRONIZED_TSC

+config HAVE_GET_CYCLES
+ def_bool y
+ depends on CPU_CAVIUM_OCTEON
+ select HAVE_TRACE_CLOCK
+ select HAVE_UNSYNCHRONIZED_TSC
+
 #
 # Use the generic interrupt handling code in kernel/irq/:
 #
diff --git a/arch/mips/include/asm/octeon/trace-clock.h
b/arch/mips/include/asm/octeon/trace-clock.h
new file mode 100644
index 0000000..41345a7
--- /dev/null
+++ b/arch/mips/include/asm/octeon/trace-clock.h
@@ -0,0 +1,43 @@
+/*
+** Copyright (C) 2005,2008 Mathieu Desnoyers
+**
+** Trace clock MIPS Octeon definitions.
+**/
+
+#ifndef _ASM_MIPS_OCTEON_TRACE_CLOCK_H
+#define _ASM_MIPS_OCTEON_TRACE_CLOCK_H
+
+#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;
+}
+#endif /* _ASM_MIPS_OCTEON_TRACE_CLOCK_H */
+
diff --git a/arch/mips/include/asm/timex.h b/arch/mips/include/asm/timex.h
index 10c8dd8..13256b4 100644
--- a/arch/mips/include/asm/timex.h
+++ b/arch/mips/include/asm/timex.h
@@ -42,9 +42,42 @@ extern unsigned int mips_hpt_frequency;
  * will result in the timer interrupt getting lost.
  */

+#if defined(CONFIG_CPU_CAVIUM_OCTEON)
+/* Since the Octeon supports a 64 bit cycle counter we might as well use
+ * it. We can't use it with an O32 kernel since 64bit registers are not
+ * saved. */
+typedef unsigned long cycles_t;
+#else
 typedef unsigned int cycles_t;
+#endif
+
+#ifdef CONFIG_HAVE_GET_CYCLES
+# ifdef CONFIG_CPU_CAVIUM_OCTEON
+static inline cycles_t get_cycles(void)
+{
+       return read_c0_cvmcount();
+}
+
+static inline void get_cycles_barrier(void)
+{
+}
+
+static inline cycles_t get_cycles_rate(void)
+{
+       return mips_hpt_frequency;
+}
+
+extern int test_tsc_synchronization(void);
+extern int _tsc_is_sync;
+static inline int tsc_is_sync(void)
+{
+       return _tsc_is_sync;
+}
+# else /* #ifdef CONFIG_CPU_CAVIUM_OCTEON */
+# error "64-bit get_cycles() supported only on Cavium Octeon MIPS
architectures"
+# endif /* #else #ifdef CONFIG_CPU_CAVIUM_OCTEON */
+#elif defined(CONFIG_HAVE_GET_CYCLES_32)

-#ifdef CONFIG_HAVE_GET_CYCLES_32
 static inline cycles_t get_cycles(void)
 {
  return read_c0_count();
diff --git a/arch/mips/include/asm/trace-clock.h
b/arch/mips/include/asm/trace-clock.h
index 3d8cb0f..3c9c638 100644
--- a/arch/mips/include/asm/trace-clock.h
+++ b/arch/mips/include/asm/trace-clock.h
@@ -12,6 +12,10 @@

 #define TRACE_CLOCK_MIN_PROBE_DURATION 200

+#ifdef CONFIG_CPU_CAVIUM_OCTEON
+# include <asm/octeon/trace-clock.h>
+#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,6 +69,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.3.3.209.g83a28

==============================================================================================
*
*
*Thanks and Regards*
*-Naresh Bhat*

On Thu, Feb 17, 2011 at 12:10 AM, Mathieu Desnoyers <
compudj at krystal.dyndns.org> wrote:

> * David Daney (ddaney at caviumnetworks.com) wrote:
> > On 02/16/2011 03:26 AM, Naresh Bhat wrote:
> >> Hi Mathieu/David,
> >>
> >> Thank you very much for all your support.
> >> Here is my back ported working patch for 2.6.32 with lttng patch set
> 0.188
> >> kernel
> >>
> >>
> ====================================================================================================
> >> Description:
> >>
> >> fix lttng mips use 64 bit counter for trace clock
> >> and fix octeon get_cycles
> >>
> >> Signed-off-by: David Daney<ddaney at caviumnetworks.com>
> >
> > I don't recall being the author of this patch, nor having really been
> > associated with it in any way.
> >
> > Did someone other than me add my Signed-off-by: header?  If so, please
> > remove it.
>
> Hi David,
>
> It looks like Naresh mistakenly attributed both of us with sign-off.
> This is a patch being posted for older lttng versions, so it won't end
> up in any LTTng tree. But Naresh should repost it without our sign-offs
>
> >> Signed-off-by: Mathieu Desnoyers<mathieu.desnoyers at efficios.com>
>
> (to remove too)
>
> since this is code that has been produced by him.
>
> Naresh: See the Linux kernel Documentation/SubmittingPatches, section 12
> for details.
>
> Thanks,
>
> Mathieu
>
> >> Signed-off-by: Naresh Bhat<nareshgbhat at gmail.com>
> >> ---
> >>   arch/mips/Kconfig                          |    7 ++++
> >>   arch/mips/include/asm/octeon/trace-clock.h |   43
> >> ++++++++++++++++++++++++++++
> >>   arch/mips/include/asm/timex.h              |   35
> ++++++++++++++++++++++-
> >>   arch/mips/include/asm/trace-clock.h        |    6 ++++
> >>   arch/mips/kernel/smp.c                     |    2 +
> >>   5 files changed, 92 insertions(+), 1 deletions(-)
> >>   create mode 100644 arch/mips/include/asm/octeon/trace-clock.h
> >>
> >
>
> --
> Mathieu Desnoyers
> Operating System Efficiency R&D Consultant
> EfficiOS Inc.
> http://www.efficios.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.casi.polymtl.ca/pipermail/ltt-dev/attachments/20110217/1b165418/attachment-0001.htm>


WARNING: multiple messages have this Message-ID
From: nareshgbhat@gmail.com (Naresh Bhat)
Subject: [ltt-dev] lttv unable to execute textDump on MIPS multicore target
Date: Thu, 17 Feb 2011 00:33:59 +0530	[thread overview]
Message-ID: <AANLkTikCcnj=2OTA9mUrMeWxpNTA+q-Bs=VVqLRtHc_h@mail.gmail.com> (raw)
Message-ID: <20110216190359.kUzabkgSWBML4nzR1TFVjDM1fAWWSFs4SikXEFtuZIo@z> (raw)
In-Reply-To: <BLU0-SMTP53396496DB856B47F531CC96D20@phx.gbl>

Hi David/Matheu,

Yes, It was my mistake. I am sorry about that.

Here is my back ported working patch for 2.6.32 with lttng patch set
0.188 on MIPS architecture CAVM octeon plus (52xx, 58xx)  boards.

==============================================================================================

From abd8fb81cc1aea87a2867736251d1be15e02a51c Mon Sep 17 00:00:00 2001
From: Naresh Bhat <nareshgbhat@gmail.com>
Date: Wed, 16 Feb 2011 18:00:19 +0530
Subject: [PATCH] fix lttng mips use 64 bit counter for trace clock,
get_cycles on octeon

---
 arch/mips/Kconfig                          |    7 ++++
 arch/mips/include/asm/octeon/trace-clock.h |   43
++++++++++++++++++++++++++++
 arch/mips/include/asm/timex.h              |   35 ++++++++++++++++++++++-
 arch/mips/include/asm/trace-clock.h        |    5 +++
 arch/mips/kernel/smp.c                     |    2 +
 5 files changed, 91 insertions(+), 1 deletions(-)
 create mode 100644 arch/mips/include/asm/octeon/trace-clock.h

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 2aaf0a3..8e19a6d 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1739,10 +1739,17 @@ config CPU_R4400_WORKAROUNDS
 config HAVE_GET_CYCLES_32
  def_bool y
  depends on !CPU_R4400_WORKAROUNDS
+ depends on !CPU_CAVIUM_OCTEON
  select HAVE_TRACE_CLOCK
  select HAVE_TRACE_CLOCK_32_TO_64
  select HAVE_UNSYNCHRONIZED_TSC

+config HAVE_GET_CYCLES
+ def_bool y
+ depends on CPU_CAVIUM_OCTEON
+ select HAVE_TRACE_CLOCK
+ select HAVE_UNSYNCHRONIZED_TSC
+
 #
 # Use the generic interrupt handling code in kernel/irq/:
 #
diff --git a/arch/mips/include/asm/octeon/trace-clock.h
b/arch/mips/include/asm/octeon/trace-clock.h
new file mode 100644
index 0000000..41345a7
--- /dev/null
+++ b/arch/mips/include/asm/octeon/trace-clock.h
@@ -0,0 +1,43 @@
+/*
+** Copyright (C) 2005,2008 Mathieu Desnoyers
+**
+** Trace clock MIPS Octeon definitions.
+**/
+
+#ifndef _ASM_MIPS_OCTEON_TRACE_CLOCK_H
+#define _ASM_MIPS_OCTEON_TRACE_CLOCK_H
+
+#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;
+}
+#endif /* _ASM_MIPS_OCTEON_TRACE_CLOCK_H */
+
diff --git a/arch/mips/include/asm/timex.h b/arch/mips/include/asm/timex.h
index 10c8dd8..13256b4 100644
--- a/arch/mips/include/asm/timex.h
+++ b/arch/mips/include/asm/timex.h
@@ -42,9 +42,42 @@ extern unsigned int mips_hpt_frequency;
  * will result in the timer interrupt getting lost.
  */

+#if defined(CONFIG_CPU_CAVIUM_OCTEON)
+/* Since the Octeon supports a 64 bit cycle counter we might as well use
+ * it. We can't use it with an O32 kernel since 64bit registers are not
+ * saved. */
+typedef unsigned long cycles_t;
+#else
 typedef unsigned int cycles_t;
+#endif
+
+#ifdef CONFIG_HAVE_GET_CYCLES
+# ifdef CONFIG_CPU_CAVIUM_OCTEON
+static inline cycles_t get_cycles(void)
+{
+       return read_c0_cvmcount();
+}
+
+static inline void get_cycles_barrier(void)
+{
+}
+
+static inline cycles_t get_cycles_rate(void)
+{
+       return mips_hpt_frequency;
+}
+
+extern int test_tsc_synchronization(void);
+extern int _tsc_is_sync;
+static inline int tsc_is_sync(void)
+{
+       return _tsc_is_sync;
+}
+# else /* #ifdef CONFIG_CPU_CAVIUM_OCTEON */
+# error "64-bit get_cycles() supported only on Cavium Octeon MIPS
architectures"
+# endif /* #else #ifdef CONFIG_CPU_CAVIUM_OCTEON */
+#elif defined(CONFIG_HAVE_GET_CYCLES_32)

-#ifdef CONFIG_HAVE_GET_CYCLES_32
 static inline cycles_t get_cycles(void)
 {
  return read_c0_count();
diff --git a/arch/mips/include/asm/trace-clock.h
b/arch/mips/include/asm/trace-clock.h
index 3d8cb0f..3c9c638 100644
--- a/arch/mips/include/asm/trace-clock.h
+++ b/arch/mips/include/asm/trace-clock.h
@@ -12,6 +12,10 @@

 #define TRACE_CLOCK_MIN_PROBE_DURATION 200

+#ifdef CONFIG_CPU_CAVIUM_OCTEON
+# include <asm/octeon/trace-clock.h>
+#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,6 +69,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.3.3.209.g83a28

==============================================================================================
*
*
*Thanks and Regards*
*-Naresh Bhat*

On Thu, Feb 17, 2011 at 12:10 AM, Mathieu Desnoyers <
compudj at krystal.dyndns.org> wrote:

> * David Daney (ddaney at caviumnetworks.com) wrote:
> > On 02/16/2011 03:26 AM, Naresh Bhat wrote:
> >> Hi Mathieu/David,
> >>
> >> Thank you very much for all your support.
> >> Here is my back ported working patch for 2.6.32 with lttng patch set
> 0.188
> >> kernel
> >>
> >>
> ====================================================================================================
> >> Description:
> >>
> >> fix lttng mips use 64 bit counter for trace clock
> >> and fix octeon get_cycles
> >>
> >> Signed-off-by: David Daney<ddaney at caviumnetworks.com>
> >
> > I don't recall being the author of this patch, nor having really been
> > associated with it in any way.
> >
> > Did someone other than me add my Signed-off-by: header?  If so, please
> > remove it.
>
> Hi David,
>
> It looks like Naresh mistakenly attributed both of us with sign-off.
> This is a patch being posted for older lttng versions, so it won't end
> up in any LTTng tree. But Naresh should repost it without our sign-offs
>
> >> Signed-off-by: Mathieu Desnoyers<mathieu.desnoyers at efficios.com>
>
> (to remove too)
>
> since this is code that has been produced by him.
>
> Naresh: See the Linux kernel Documentation/SubmittingPatches, section 12
> for details.
>
> Thanks,
>
> Mathieu
>
> >> Signed-off-by: Naresh Bhat<nareshgbhat at gmail.com>
> >> ---
> >>   arch/mips/Kconfig                          |    7 ++++
> >>   arch/mips/include/asm/octeon/trace-clock.h |   43
> >> ++++++++++++++++++++++++++++
> >>   arch/mips/include/asm/timex.h              |   35
> ++++++++++++++++++++++-
> >>   arch/mips/include/asm/trace-clock.h        |    6 ++++
> >>   arch/mips/kernel/smp.c                     |    2 +
> >>   5 files changed, 92 insertions(+), 1 deletions(-)
> >>   create mode 100644 arch/mips/include/asm/octeon/trace-clock.h
> >>
> >
>
> --
> Mathieu Desnoyers
> Operating System Efficiency R&D Consultant
> EfficiOS Inc.
> http://www.efficios.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.casi.polymtl.ca/pipermail/lttng-dev/attachments/20110217/1b165418/attachment-0003.htm>


WARNING: multiple messages have this Message-ID
From: nareshgbhat@gmail.com (Naresh Bhat)
Subject: [ltt-dev] lttv unable to execute textDump on MIPS multicore target
Date: Thu, 17 Feb 2011 00:33:59 +0530	[thread overview]
Message-ID: <AANLkTikCcnj=2OTA9mUrMeWxpNTA+q-Bs=VVqLRtHc_h@mail.gmail.com> (raw)
Message-ID: <20110216190359.fOXea_C-p8L_7qPTgqKkkPRNBcOn7cmPqdNIAyD3Ouo@z> (raw)
In-Reply-To: <BLU0-SMTP53396496DB856B47F531CC96D20@phx.gbl>

Hi David/Matheu,

Yes, It was my mistake. I am sorry about that.

Here is my back ported working patch for 2.6.32 with lttng patch set
0.188 on MIPS architecture CAVM octeon plus (52xx, 58xx)  boards.

==============================================================================================

From abd8fb81cc1aea87a2867736251d1be15e02a51c Mon Sep 17 00:00:00 2001
From: Naresh Bhat <nareshgbhat@gmail.com>
Date: Wed, 16 Feb 2011 18:00:19 +0530
Subject: [PATCH] fix lttng mips use 64 bit counter for trace clock,
get_cycles on octeon

---
 arch/mips/Kconfig                          |    7 ++++
 arch/mips/include/asm/octeon/trace-clock.h |   43
++++++++++++++++++++++++++++
 arch/mips/include/asm/timex.h              |   35 ++++++++++++++++++++++-
 arch/mips/include/asm/trace-clock.h        |    5 +++
 arch/mips/kernel/smp.c                     |    2 +
 5 files changed, 91 insertions(+), 1 deletions(-)
 create mode 100644 arch/mips/include/asm/octeon/trace-clock.h

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 2aaf0a3..8e19a6d 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1739,10 +1739,17 @@ config CPU_R4400_WORKAROUNDS
 config HAVE_GET_CYCLES_32
  def_bool y
  depends on !CPU_R4400_WORKAROUNDS
+ depends on !CPU_CAVIUM_OCTEON
  select HAVE_TRACE_CLOCK
  select HAVE_TRACE_CLOCK_32_TO_64
  select HAVE_UNSYNCHRONIZED_TSC

+config HAVE_GET_CYCLES
+ def_bool y
+ depends on CPU_CAVIUM_OCTEON
+ select HAVE_TRACE_CLOCK
+ select HAVE_UNSYNCHRONIZED_TSC
+
 #
 # Use the generic interrupt handling code in kernel/irq/:
 #
diff --git a/arch/mips/include/asm/octeon/trace-clock.h
b/arch/mips/include/asm/octeon/trace-clock.h
new file mode 100644
index 0000000..41345a7
--- /dev/null
+++ b/arch/mips/include/asm/octeon/trace-clock.h
@@ -0,0 +1,43 @@
+/*
+** Copyright (C) 2005,2008 Mathieu Desnoyers
+**
+** Trace clock MIPS Octeon definitions.
+**/
+
+#ifndef _ASM_MIPS_OCTEON_TRACE_CLOCK_H
+#define _ASM_MIPS_OCTEON_TRACE_CLOCK_H
+
+#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;
+}
+#endif /* _ASM_MIPS_OCTEON_TRACE_CLOCK_H */
+
diff --git a/arch/mips/include/asm/timex.h b/arch/mips/include/asm/timex.h
index 10c8dd8..13256b4 100644
--- a/arch/mips/include/asm/timex.h
+++ b/arch/mips/include/asm/timex.h
@@ -42,9 +42,42 @@ extern unsigned int mips_hpt_frequency;
  * will result in the timer interrupt getting lost.
  */

+#if defined(CONFIG_CPU_CAVIUM_OCTEON)
+/* Since the Octeon supports a 64 bit cycle counter we might as well use
+ * it. We can't use it with an O32 kernel since 64bit registers are not
+ * saved. */
+typedef unsigned long cycles_t;
+#else
 typedef unsigned int cycles_t;
+#endif
+
+#ifdef CONFIG_HAVE_GET_CYCLES
+# ifdef CONFIG_CPU_CAVIUM_OCTEON
+static inline cycles_t get_cycles(void)
+{
+       return read_c0_cvmcount();
+}
+
+static inline void get_cycles_barrier(void)
+{
+}
+
+static inline cycles_t get_cycles_rate(void)
+{
+       return mips_hpt_frequency;
+}
+
+extern int test_tsc_synchronization(void);
+extern int _tsc_is_sync;
+static inline int tsc_is_sync(void)
+{
+       return _tsc_is_sync;
+}
+# else /* #ifdef CONFIG_CPU_CAVIUM_OCTEON */
+# error "64-bit get_cycles() supported only on Cavium Octeon MIPS
architectures"
+# endif /* #else #ifdef CONFIG_CPU_CAVIUM_OCTEON */
+#elif defined(CONFIG_HAVE_GET_CYCLES_32)

-#ifdef CONFIG_HAVE_GET_CYCLES_32
 static inline cycles_t get_cycles(void)
 {
  return read_c0_count();
diff --git a/arch/mips/include/asm/trace-clock.h
b/arch/mips/include/asm/trace-clock.h
index 3d8cb0f..3c9c638 100644
--- a/arch/mips/include/asm/trace-clock.h
+++ b/arch/mips/include/asm/trace-clock.h
@@ -12,6 +12,10 @@

 #define TRACE_CLOCK_MIN_PROBE_DURATION 200

+#ifdef CONFIG_CPU_CAVIUM_OCTEON
+# include <asm/octeon/trace-clock.h>
+#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,6 +69,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.3.3.209.g83a28

==============================================================================================
*
*
*Thanks and Regards*
*-Naresh Bhat*

On Thu, Feb 17, 2011 at 12:10 AM, Mathieu Desnoyers <
compudj at krystal.dyndns.org> wrote:

> * David Daney (ddaney at caviumnetworks.com) wrote:
> > On 02/16/2011 03:26 AM, Naresh Bhat wrote:
> >> Hi Mathieu/David,
> >>
> >> Thank you very much for all your support.
> >> Here is my back ported working patch for 2.6.32 with lttng patch set
> 0.188
> >> kernel
> >>
> >>
> ====================================================================================================
> >> Description:
> >>
> >> fix lttng mips use 64 bit counter for trace clock
> >> and fix octeon get_cycles
> >>
> >> Signed-off-by: David Daney<ddaney at caviumnetworks.com>
> >
> > I don't recall being the author of this patch, nor having really been
> > associated with it in any way.
> >
> > Did someone other than me add my Signed-off-by: header?  If so, please
> > remove it.
>
> Hi David,
>
> It looks like Naresh mistakenly attributed both of us with sign-off.
> This is a patch being posted for older lttng versions, so it won't end
> up in any LTTng tree. But Naresh should repost it without our sign-offs
>
> >> Signed-off-by: Mathieu Desnoyers<mathieu.desnoyers at efficios.com>
>
> (to remove too)
>
> since this is code that has been produced by him.
>
> Naresh: See the Linux kernel Documentation/SubmittingPatches, section 12
> for details.
>
> Thanks,
>
> Mathieu
>
> >> Signed-off-by: Naresh Bhat<nareshgbhat at gmail.com>
> >> ---
> >>   arch/mips/Kconfig                          |    7 ++++
> >>   arch/mips/include/asm/octeon/trace-clock.h |   43
> >> ++++++++++++++++++++++++++++
> >>   arch/mips/include/asm/timex.h              |   35
> ++++++++++++++++++++++-
> >>   arch/mips/include/asm/trace-clock.h        |    6 ++++
> >>   arch/mips/kernel/smp.c                     |    2 +
> >>   5 files changed, 92 insertions(+), 1 deletions(-)
> >>   create mode 100644 arch/mips/include/asm/octeon/trace-clock.h
> >>
> >
>
> --
> Mathieu Desnoyers
> Operating System Efficiency R&D Consultant
> EfficiOS Inc.
> http://www.efficios.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.casi.polymtl.ca/pipermail/lttng-dev/attachments/20110217/1b165418/attachment-0002.htm>


  parent reply	other threads:[~2011-02-16 19:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-11  6:38 Naresh Bhat
2011-02-11  6:38 ` Naresh Bhat
2011-02-11  6:38 ` Naresh Bhat
2011-02-11  7:07 ` Mathieu Desnoyers
     [not found] ` <BLU0-SMTP48F24DF0C4B7D6CF250B2696EF0@phx.gbl>
2011-02-11  7:30   ` Naresh Bhat
2011-02-11  7:30     ` Naresh Bhat
2011-02-11  7:30     ` Naresh Bhat
2011-02-11 14:26     ` Mathieu Desnoyers
     [not found]     ` <BLU0-SMTP19709C87A494AE8507C77296EF0@phx.gbl>
2011-02-14  8:48       ` Naresh Bhat
2011-02-14  8:48         ` Naresh Bhat
2011-02-14  8:48         ` Naresh Bhat
2011-02-14 14:39         ` Mathieu Desnoyers
     [not found]         ` <BLU0-SMTP86B1C8A867AFBF486A0DEB96D00@phx.gbl>
2011-02-14 17:48           ` David Daney
2011-02-14 19:43             ` Mathieu Desnoyers
     [not found]             ` <BLU0-SMTP381C9DC048B0AF55E0C00596D00@phx.gbl>
2011-02-14 19:50               ` David Daney
2011-02-14 19:56                 ` Mathieu Desnoyers
     [not found]                 ` <20110214195622.GA18825@Krystal>
2011-02-15  3:32                   ` Mathieu Desnoyers
     [not found]                   ` <BLU0-SMTP25F09381155A8E4CF8878B96D30@phx.gbl>
2011-02-15 13:30                     ` Naresh Bhat
2011-02-15 13:30                       ` Naresh Bhat
2011-02-15 13:30                       ` Naresh Bhat
2011-02-15 14:05                       ` Mathieu Desnoyers
2011-02-15 14:05                       ` Naresh Bhat
2011-02-15 14:05                         ` Naresh Bhat
2011-02-15 14:05                         ` Naresh Bhat
2011-02-15 14:09                         ` Mathieu Desnoyers
     [not found]                         ` <BLU0-SMTP89B659A630D5B5735DB78696D30@phx.gbl>
2011-02-16 11:26                           ` Naresh Bhat
2011-02-16 11:26                             ` Naresh Bhat
2011-02-16 11:26                             ` Naresh Bhat
2011-02-16 17:23                             ` David Daney
2011-02-16 18:40                               ` Mathieu Desnoyers
     [not found]                               ` <BLU0-SMTP53396496DB856B47F531CC96D20@phx.gbl>
2011-02-16 19:03                                 ` Naresh Bhat [this message]
2011-02-16 19:03                                   ` Naresh Bhat
2011-02-16 19:03                                   ` Naresh Bhat
     [not found]                                   ` <AANLkTikbLY=HpDOUQYErk_CBgAd4NDJeL5otptRHT3Uj@mail.gmail.com>
     [not found]                                     ` <20110218145546.GA13022@Krystal>
2011-02-18 15:04                                       ` [ltt-dev] [RELEASE] LTTng 0.245 (mips fix) Mathieu Desnoyers

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='AANLkTikCcnj=2OTA9mUrMeWxpNTA+q-Bs=VVqLRtHc_h@mail.gmail.com' \
    --to=nareshgbhat@gmail.com \
    /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