Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4028
b: refs/heads/master
c: ed09415
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Jun 30, 2005
1 parent 0dd3e78 commit c8bfd2f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 74889802a1585af4e1652f0cb853ac22a65816a4
refs/heads/master: ed094150bdeb6eca691f1b7a05bd34d4d1a95488
44 changes: 29 additions & 15 deletions trunk/arch/ppc64/kernel/ItLpQueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
*/
struct hvlpevent_queue hvlpevent_queue __attribute__((__section__(".data")));

static char *event_types[9] = {
DEFINE_PER_CPU(unsigned long[HvLpEvent_Type_NumTypes], hvlpevent_counts);

static char *event_types[HvLpEvent_Type_NumTypes] = {
"Hypervisor\t\t",
"Machine Facilities\t",
"Session Manager\t",
Expand Down Expand Up @@ -129,7 +131,6 @@ static void hvlpevent_clear_valid( struct HvLpEvent * event )

void process_hvlpevents(struct pt_regs *regs)
{
unsigned numIntsProcessed = 0;
struct HvLpEvent * nextLpEvent;

/* If we have recursed, just return */
Expand All @@ -144,8 +145,6 @@ void process_hvlpevents(struct pt_regs *regs)
for (;;) {
nextLpEvent = get_next_hvlpevent();
if ( nextLpEvent ) {
++numIntsProcessed;
hvlpevent_queue.xLpIntCount++;
/* Call appropriate handler here, passing
* a pointer to the LpEvent. The handler
* must make a copy of the LpEvent if it
Expand All @@ -160,7 +159,7 @@ void process_hvlpevents(struct pt_regs *regs)
* here!
*/
if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes )
hvlpevent_queue.xLpIntCountByType[nextLpEvent->xType]++;
__get_cpu_var(hvlpevent_counts)[nextLpEvent->xType]++;
if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes &&
lpEventHandler[nextLpEvent->xType] )
lpEventHandler[nextLpEvent->xType](nextLpEvent, regs);
Expand All @@ -181,8 +180,6 @@ void process_hvlpevents(struct pt_regs *regs)
ItLpQueueInProcess = 0;
mb();
clear_inUse();

get_paca()->lpevent_count += numIntsProcessed;
}

static int set_spread_lpevents(char *str)
Expand Down Expand Up @@ -228,20 +225,37 @@ void setup_hvlpevent_queue(void)

static int proc_lpevents_show(struct seq_file *m, void *v)
{
unsigned int i;
int cpu, i;
unsigned long sum;
static unsigned long cpu_totals[NR_CPUS];

/* FIXME: do we care that there's no locking here? */
sum = 0;
for_each_online_cpu(cpu) {
cpu_totals[cpu] = 0;
for (i = 0; i < HvLpEvent_Type_NumTypes; i++) {
cpu_totals[cpu] += per_cpu(hvlpevent_counts, cpu)[i];
}
sum += cpu_totals[cpu];
}

seq_printf(m, "LpEventQueue 0\n");
seq_printf(m, " events processed:\t%lu\n",
(unsigned long)hvlpevent_queue.xLpIntCount);
seq_printf(m, " events processed:\t%lu\n", sum);

for (i = 0; i < 9; ++i)
seq_printf(m, " %s %10lu\n", event_types[i],
(unsigned long)hvlpevent_queue.xLpIntCountByType[i]);
for (i = 0; i < HvLpEvent_Type_NumTypes; ++i) {
sum = 0;
for_each_online_cpu(cpu) {
sum += per_cpu(hvlpevent_counts, cpu)[i];
}

seq_printf(m, " %s %10lu\n", event_types[i], sum);
}

seq_printf(m, "\n events processed by processor:\n");

for_each_online_cpu(i)
seq_printf(m, " CPU%02d %10u\n", i, paca[i].lpevent_count);
for_each_online_cpu(cpu) {
seq_printf(m, " CPU%02d %10lu\n", cpu, cpu_totals[cpu]);
}

return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-ppc64/iSeries/ItLpQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ struct hvlpevent_queue {
u8 xIndex; // 0x28 unique sequential index.
u8 xSlicRsvd[3]; // 0x29-2b
u32 xInUseWord; // 0x2C
u64 xLpIntCount; // 0x30 Total Lp Int msgs processed
u64 xLpIntCountByType[9]; // 0x38-0x7F Event counts by type
};

extern struct hvlpevent_queue hvlpevent_queue;
Expand Down
1 change: 0 additions & 1 deletion trunk/include/asm-ppc64/paca.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ struct paca_struct {
u64 next_jiffy_update_tb; /* TB value for next jiffy update */
u64 saved_r1; /* r1 save for RTAS calls */
u64 saved_msr; /* MSR saved here by enter_rtas */
u32 lpevent_count; /* lpevents processed */
u8 proc_enabled; /* irq soft-enable flag */

/* not yet used */
Expand Down

0 comments on commit c8bfd2f

Please sign in to comment.