diff options
| -rw-r--r-- | arch/ppc64/kernel/ItLpQueue.c | 44 | ||||
| -rw-r--r-- | include/asm-ppc64/iSeries/ItLpQueue.h | 2 | ||||
| -rw-r--r-- | include/asm-ppc64/paca.h | 1 |
3 files changed, 29 insertions, 18 deletions
diff --git a/arch/ppc64/kernel/ItLpQueue.c b/arch/ppc64/kernel/ItLpQueue.c index a849f6775ad6..4a6ab9de629d 100644 --- a/arch/ppc64/kernel/ItLpQueue.c +++ b/arch/ppc64/kernel/ItLpQueue.c | |||
| @@ -28,7 +28,9 @@ | |||
| 28 | */ | 28 | */ |
| 29 | struct hvlpevent_queue hvlpevent_queue __attribute__((__section__(".data"))); | 29 | struct hvlpevent_queue hvlpevent_queue __attribute__((__section__(".data"))); |
| 30 | 30 | ||
| 31 | static char *event_types[9] = { | 31 | DEFINE_PER_CPU(unsigned long[HvLpEvent_Type_NumTypes], hvlpevent_counts); |
| 32 | |||
| 33 | static char *event_types[HvLpEvent_Type_NumTypes] = { | ||
| 32 | "Hypervisor\t\t", | 34 | "Hypervisor\t\t", |
| 33 | "Machine Facilities\t", | 35 | "Machine Facilities\t", |
| 34 | "Session Manager\t", | 36 | "Session Manager\t", |
| @@ -129,7 +131,6 @@ static void hvlpevent_clear_valid( struct HvLpEvent * event ) | |||
| 129 | 131 | ||
| 130 | void process_hvlpevents(struct pt_regs *regs) | 132 | void process_hvlpevents(struct pt_regs *regs) |
| 131 | { | 133 | { |
| 132 | unsigned numIntsProcessed = 0; | ||
| 133 | struct HvLpEvent * nextLpEvent; | 134 | struct HvLpEvent * nextLpEvent; |
| 134 | 135 | ||
| 135 | /* If we have recursed, just return */ | 136 | /* If we have recursed, just return */ |
| @@ -144,8 +145,6 @@ void process_hvlpevents(struct pt_regs *regs) | |||
| 144 | for (;;) { | 145 | for (;;) { |
| 145 | nextLpEvent = get_next_hvlpevent(); | 146 | nextLpEvent = get_next_hvlpevent(); |
| 146 | if ( nextLpEvent ) { | 147 | if ( nextLpEvent ) { |
| 147 | ++numIntsProcessed; | ||
| 148 | hvlpevent_queue.xLpIntCount++; | ||
| 149 | /* Call appropriate handler here, passing | 148 | /* Call appropriate handler here, passing |
| 150 | * a pointer to the LpEvent. The handler | 149 | * a pointer to the LpEvent. The handler |
| 151 | * must make a copy of the LpEvent if it | 150 | * must make a copy of the LpEvent if it |
| @@ -160,7 +159,7 @@ void process_hvlpevents(struct pt_regs *regs) | |||
| 160 | * here! | 159 | * here! |
| 161 | */ | 160 | */ |
| 162 | if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes ) | 161 | if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes ) |
| 163 | hvlpevent_queue.xLpIntCountByType[nextLpEvent->xType]++; | 162 | __get_cpu_var(hvlpevent_counts)[nextLpEvent->xType]++; |
| 164 | if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes && | 163 | if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes && |
| 165 | lpEventHandler[nextLpEvent->xType] ) | 164 | lpEventHandler[nextLpEvent->xType] ) |
| 166 | lpEventHandler[nextLpEvent->xType](nextLpEvent, regs); | 165 | lpEventHandler[nextLpEvent->xType](nextLpEvent, regs); |
| @@ -181,8 +180,6 @@ void process_hvlpevents(struct pt_regs *regs) | |||
| 181 | ItLpQueueInProcess = 0; | 180 | ItLpQueueInProcess = 0; |
| 182 | mb(); | 181 | mb(); |
| 183 | clear_inUse(); | 182 | clear_inUse(); |
| 184 | |||
| 185 | get_paca()->lpevent_count += numIntsProcessed; | ||
| 186 | } | 183 | } |
| 187 | 184 | ||
| 188 | static int set_spread_lpevents(char *str) | 185 | static int set_spread_lpevents(char *str) |
| @@ -228,20 +225,37 @@ void setup_hvlpevent_queue(void) | |||
| 228 | 225 | ||
| 229 | static int proc_lpevents_show(struct seq_file *m, void *v) | 226 | static int proc_lpevents_show(struct seq_file *m, void *v) |
| 230 | { | 227 | { |
| 231 | unsigned int i; | 228 | int cpu, i; |
| 229 | unsigned long sum; | ||
| 230 | static unsigned long cpu_totals[NR_CPUS]; | ||
| 231 | |||
| 232 | /* FIXME: do we care that there's no locking here? */ | ||
| 233 | sum = 0; | ||
| 234 | for_each_online_cpu(cpu) { | ||
| 235 | cpu_totals[cpu] = 0; | ||
| 236 | for (i = 0; i < HvLpEvent_Type_NumTypes; i++) { | ||
| 237 | cpu_totals[cpu] += per_cpu(hvlpevent_counts, cpu)[i]; | ||
| 238 | } | ||
| 239 | sum += cpu_totals[cpu]; | ||
| 240 | } | ||
| 232 | 241 | ||
| 233 | seq_printf(m, "LpEventQueue 0\n"); | 242 | seq_printf(m, "LpEventQueue 0\n"); |
| 234 | seq_printf(m, " events processed:\t%lu\n", | 243 | seq_printf(m, " events processed:\t%lu\n", sum); |
| 235 | (unsigned long)hvlpevent_queue.xLpIntCount); | ||
| 236 | 244 | ||
| 237 | for (i = 0; i < 9; ++i) | 245 | for (i = 0; i < HvLpEvent_Type_NumTypes; ++i) { |
| 238 | seq_printf(m, " %s %10lu\n", event_types[i], | 246 | sum = 0; |
| 239 | (unsigned long)hvlpevent_queue.xLpIntCountByType[i]); | 247 | for_each_online_cpu(cpu) { |
| 248 | sum += per_cpu(hvlpevent_counts, cpu)[i]; | ||
| 249 | } | ||
| 250 | |||
| 251 | seq_printf(m, " %s %10lu\n", event_types[i], sum); | ||
| 252 | } | ||
| 240 | 253 | ||
| 241 | seq_printf(m, "\n events processed by processor:\n"); | 254 | seq_printf(m, "\n events processed by processor:\n"); |
| 242 | 255 | ||
| 243 | for_each_online_cpu(i) | 256 | for_each_online_cpu(cpu) { |
| 244 | seq_printf(m, " CPU%02d %10u\n", i, paca[i].lpevent_count); | 257 | seq_printf(m, " CPU%02d %10lu\n", cpu, cpu_totals[cpu]); |
| 258 | } | ||
| 245 | 259 | ||
| 246 | return 0; | 260 | return 0; |
| 247 | } | 261 | } |
diff --git a/include/asm-ppc64/iSeries/ItLpQueue.h b/include/asm-ppc64/iSeries/ItLpQueue.h index 6ba74c0d910b..51db08852dba 100644 --- a/include/asm-ppc64/iSeries/ItLpQueue.h +++ b/include/asm-ppc64/iSeries/ItLpQueue.h | |||
| @@ -70,8 +70,6 @@ struct hvlpevent_queue { | |||
| 70 | u8 xIndex; // 0x28 unique sequential index. | 70 | u8 xIndex; // 0x28 unique sequential index. |
| 71 | u8 xSlicRsvd[3]; // 0x29-2b | 71 | u8 xSlicRsvd[3]; // 0x29-2b |
| 72 | u32 xInUseWord; // 0x2C | 72 | u32 xInUseWord; // 0x2C |
| 73 | u64 xLpIntCount; // 0x30 Total Lp Int msgs processed | ||
| 74 | u64 xLpIntCountByType[9]; // 0x38-0x7F Event counts by type | ||
| 75 | }; | 73 | }; |
| 76 | 74 | ||
| 77 | extern struct hvlpevent_queue hvlpevent_queue; | 75 | extern struct hvlpevent_queue hvlpevent_queue; |
diff --git a/include/asm-ppc64/paca.h b/include/asm-ppc64/paca.h index 0146f51684e9..2f0f36f73d38 100644 --- a/include/asm-ppc64/paca.h +++ b/include/asm-ppc64/paca.h | |||
| @@ -89,7 +89,6 @@ struct paca_struct { | |||
| 89 | u64 next_jiffy_update_tb; /* TB value for next jiffy update */ | 89 | u64 next_jiffy_update_tb; /* TB value for next jiffy update */ |
| 90 | u64 saved_r1; /* r1 save for RTAS calls */ | 90 | u64 saved_r1; /* r1 save for RTAS calls */ |
| 91 | u64 saved_msr; /* MSR saved here by enter_rtas */ | 91 | u64 saved_msr; /* MSR saved here by enter_rtas */ |
| 92 | u32 lpevent_count; /* lpevents processed */ | ||
| 93 | u8 proc_enabled; /* irq soft-enable flag */ | 92 | u8 proc_enabled; /* irq soft-enable flag */ |
| 94 | 93 | ||
| 95 | /* not yet used */ | 94 | /* not yet used */ |
