[RFC, Patch 1/1] OProfile for Cell: Initial profiling support -- new patch

STALE7278d

4 messages, 2 authors, 2006-11-16 · open the first message on its own page

[RFC, Patch 1/1] OProfile for Cell: Initial profiling support -- new patch

From: Maynard Johnson <hidden>
Date: 2006-11-15 18:51:48


Re: [RFC, Patch 1/1] OProfile for Cell: Initial profiling support -- new patch

From: Maynard Johnson <hidden>
Date: 2006-11-15 19:15:55

Sorry for the spam, but I forgot to add the header into the patch, which includes the description of the patch, along with signed-off lines.  I'll repost.

[snip]

Maynard Johnson
IBM LTC Power Linux Toolchain

[RFC, Patch 1/1] OProfile for Cell: Initial profiling support -- corrected patch with header

From: Maynard Johnson <hidden>
Date: 2006-11-15 19:19:12


Re: [RFC, Patch 1/1] OProfile for Cell: Initial profiling support -- new patch

From: Heikki Orsila <hidden>
Date: 2006-11-16 14:02:39

On Wed, Nov 15, 2006 at 12:51:08PM -0600, Maynard Johnson wrote:
+/* This function is called once for all cpus combined */
+static void
+cell_reg_setup(struct op_counter_config *ctr,
+	       struct op_system_config *sys, int num_ctrs)
+{
[SNIP]
+	for (i = 0; i < num_ctrs; ++i) {
+
+		if ((ctr[i].event >= 2100) && (ctr[i].event <= 2111))
+			pmc_cntrl[1][i].evnts = ctr[i].event + 19;
+		else if (ctr[i].event == 2203)
+			pmc_cntrl[1][i].evnts = ctr[i].event;
+		else if ((ctr[i].event >= 2200) && (ctr[i].event <= 2215))
+			pmc_cntrl[1][i].evnts = ctr[i].event + 16;
+		else
+			pmc_cntrl[1][i].evnts = ctr[i].event;
+
I think the previous code would be more readable with a switch() 
statement. 

	switch (ctr[i].event) {
	case 2100 ... 2111:
		pmc_cntrl[1][i] = ctr[i].event + 19;
		break;
	case 2200 ... 2202:
	case 2204 ... 2215:
		pmc_cntrl[1][i] = ctr[i].event + 16;
		break;
	default:
		pmc_cntrl[1][i] = ctr[i].event;
	}

 - Heikki
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help