From: Maynard Johnson <maynardj@us.ibm.com>
To: cbe-oss-dev@ozlabs.org, linux-kernel@vger.kernel.org,
linuxppc-dev@ozlabs.org, oprofile-list@lists.sourceforge.net
Subject: [RFC, PATCH 2/4] Add support to OProfile for profiling Cell BE SPUs -- update
Date: Mon, 29 Jan 2007 13:47:33 -0600 [thread overview]
Message-ID: <45BE4F55.8070801@us.ibm.com> (raw)
In-Reply-To: <45BE4ED0.5030808@us.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: oprof-ppu-fix2.diff --]
[-- Type: text/x-patch, Size: 3634 bytes --]
The code was setting up the debug bus for group 21 when profiling on the
event PPU CYCLES. The debug bus is not actually used by the hardware
performance counters when counting PPU CYCLES. Setting up the debug bus
for PPU CYCLES causes signal routing conflicts on the debug bus when
profiling PPU cycles and another PPU event. This patch fixes the code to
only setup the debug bus to route the performance signals for the non
PPU CYCLE events.
Signed-off-by: Maynard Johnson <mpjohn@us.ibm.com>
Signed-off-by: Carl Love <carll@us.ibm.com>
Index: linux-2.6.20-rc1/arch/powerpc/oprofile/op_model_cell.c
===================================================================
--- linux-2.6.20-rc1.orig/arch/powerpc/oprofile/op_model_cell.c 2007-01-18 16:56:47.300605984 -0600
+++ linux-2.6.20-rc1/arch/powerpc/oprofile/op_model_cell.c 2007-01-24 12:16:16.225609136 -0600
@@ -39,6 +39,9 @@
#include "../platforms/cell/interrupt.h"
#define PPU_CYCLES_EVENT_NUM 1 /* event number for CYCLES */
+#define PPU_CYCLES_GRP_NUM 1 /* special group number for identifying
+ * PPU_CYCLES event
+ */
#define CBE_COUNT_ALL_CYCLES 0x42800000 /* PPU cycle event specifier */
#define NUM_THREADS 2 /* number of physical threads in
@@ -62,7 +65,7 @@
struct pm_signal {
u16 cpu; /* Processor to modify */
u16 sub_unit; /* hw subunit this applies to (if applicable) */
- u16 signal_group; /* Signal Group to Enable/Disable */
+ short int signal_group; /* Signal Group to Enable/Disable */
u8 bus_word; /* Enable/Disable on this Trace/Trigger/Event
* Bus Word(s) (bitmask)
*/
@@ -173,26 +176,40 @@
static void pm_rtas_activate_signals(u32 node, u32 count)
{
int ret;
- int j;
+ int i, j;
struct pm_signal pm_signal_local[NR_PHYS_CTRS];
+ /* There is no debug setup required for the cycles event.
+ * Note that only events in the same group can be used.
+ * Otherwise, there will be conflicts in correctly routing
+ * the signals on the debug bus. It is the responsiblity
+ * of the OProfile user tool to check the events are in
+ * the same group.
+ */
+ i = 0;
for (j = 0; j < count; j++) {
- /* fw expects physical cpu # */
- pm_signal_local[j].cpu = node;
- pm_signal_local[j].signal_group
- = pm_signal[j].signal_group;
- pm_signal_local[j].bus_word = pm_signal[j].bus_word;
- pm_signal_local[j].sub_unit = pm_signal[j].sub_unit;
- pm_signal_local[j].bit = pm_signal[j].bit;
- }
+ if (pm_signal[j].signal_group != PPU_CYCLES_GRP_NUM) {
- ret = rtas_ibm_cbe_perftools(SUBFUNC_ACTIVATE, PASSTHRU_ENABLE,
- pm_signal_local,
- count * sizeof(struct pm_signal));
+ /* fw expects physical cpu # */
+ pm_signal_local[i].cpu = node;
+ pm_signal_local[i].signal_group
+ = pm_signal[j].signal_group;
+ pm_signal_local[i].bus_word = pm_signal[j].bus_word;
+ pm_signal_local[i].sub_unit = pm_signal[j].sub_unit;
+ pm_signal_local[i].bit = pm_signal[j].bit;
+ i++;
+ }
+ }
- if (ret)
- printk(KERN_WARNING "%s: rtas returned: %d\n",
- __FUNCTION__, ret);
+ if (i != 0) {
+ ret = rtas_ibm_cbe_perftools(SUBFUNC_ACTIVATE, PASSTHRU_ENABLE,
+ pm_signal_local,
+ i * sizeof(struct pm_signal));
+
+ if (ret)
+ printk(KERN_WARNING "%s: rtas returned: %d\n",
+ __FUNCTION__, ret);
+ }
}
/*
@@ -209,7 +226,7 @@
/* Special Event: Count all cpu cycles */
pm_regs.pm07_cntrl[ctr] = CBE_COUNT_ALL_CYCLES;
p = &(pm_signal[ctr]);
- p->signal_group = 21;
+ p->signal_group = PPU_CYCLES_GRP_NUM;
p->bus_word = 1;
p->sub_unit = 0;
p->bit = 0;
next prev parent reply other threads:[~2007-01-29 19:47 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-29 19:45 [RFC, PATCH 0/4] Add support to OProfile for profiling Cell BE SPUs -- update Maynard Johnson
2007-01-29 19:46 ` [RFC, PATCH 1/4] " Maynard Johnson
2007-01-30 4:07 ` [Cbe-oss-dev] " Arnd Bergmann
2007-01-30 10:39 ` Christoph Hellwig
2007-01-30 22:49 ` Carl Love
2007-01-30 22:57 ` Benjamin Herrenschmidt
2007-01-31 8:47 ` Christoph Hellwig
2007-01-30 22:59 ` Benjamin Herrenschmidt
2007-01-29 19:47 ` Maynard Johnson [this message]
2007-01-30 4:08 ` [Cbe-oss-dev] [RFC, PATCH 2/4] " Arnd Bergmann
2007-01-30 23:51 ` Carl Love
2007-01-29 19:48 ` [RFC, PATCH 3/4] " Maynard Johnson
2007-01-30 4:24 ` [Cbe-oss-dev] " Arnd Bergmann
2007-01-30 15:31 ` Maynard Johnson
2007-01-31 0:35 ` Arnd Bergmann
2007-01-29 19:48 ` [RFC, PATCH 4/4] " Maynard Johnson
2007-01-30 7:39 ` [Cbe-oss-dev] " Arnd Bergmann
2007-01-30 7:53 ` Benjamin Herrenschmidt
2007-01-30 10:41 ` Christoph Hellwig
2007-01-30 23:09 ` Maynard Johnson
2007-01-30 21:41 ` Maynard Johnson
2007-01-30 22:54 ` Maynard Johnson
2007-01-30 23:34 ` Benjamin Herrenschmidt
2007-01-31 0:29 ` Maynard Johnson
2007-01-31 6:52 ` Arnd Bergmann
2007-02-02 16:47 ` Maynard Johnson
2007-02-03 7:40 ` Arnd Bergmann
2007-02-03 20:03 ` Maynard Johnson
2007-02-04 2:42 ` Arnd Bergmann
2007-02-04 17:11 ` Maynard Johnson
2007-01-30 23:31 ` Carl Love
2007-01-31 1:25 ` Christian Krafft
2007-01-31 6:06 ` Arnd Bergmann
2007-01-31 5:57 ` Arnd Bergmann
2007-02-02 19:27 ` Maynard Johnson
2007-02-03 23:49 ` Maynard Johnson
2007-02-04 2:52 ` Arnd Bergmann
2007-02-04 17:33 ` Maynard Johnson
2007-01-31 9:24 ` Milton Miller
2007-01-31 15:42 ` Arnd Bergmann
2007-02-01 18:56 ` Milton Miller
2007-02-02 0:54 ` Arnd Bergmann
2007-01-30 8:37 ` [RFC, PATCH 0/4] " Arnd Bergmann
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=45BE4F55.8070801@us.ibm.com \
--to=maynardj@us.ibm.com \
--cc=cbe-oss-dev@ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=oprofile-list@lists.sourceforge.net \
/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;
as well as URLs for NNTP newsgroup(s).