PAPI 7.1.0.0
Loading...
Searching...
No Matches
pfmlib_gen_powerpc.c
Go to the documentation of this file.
1/*
2 * Copyright (C) IBM Corporation, 2007. All rights reserved.
3 * Contributed by Corey Ashford (cjashfor@us.ibm.com)
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 * pfmlib_gen_powerpc.c
24 *
25 * Support for libpfm for the PowerPC970, POWER4,4+,5,5+,6 processors.
26 */
27
28#ifndef _GNU_SOURCE
29 #define _GNU_SOURCE /* for getline */
30#endif
31#include <stdio.h>
32#include <stdlib.h>
33#include <string.h>
34#include <limits.h>
35
36
37/* private headers */
38#include "powerpc_reg.h"
39
40#include "pfmlib_priv.h"
41
42#include "pfmlib_power_priv.h"
43#include "pfmlib_ppc970_priv.h"
45#include "pfmlib_power4_priv.h"
46#include "pfmlib_power5_priv.h"
47#include "pfmlib_power5+_priv.h"
48#include "pfmlib_power6_priv.h"
49#include "pfmlib_power7_priv.h"
50
51#include "ppc970_events.h"
52#include "ppc970mp_events.h"
53#include "power4_events.h"
54#include "power5_events.h"
55#include "power5+_events.h"
56#include "power6_events.h"
57#include "power7_events.h"
58
59#define FIRST_POWER_PMU PFMLIB_PPC970_PMU
60
61static const int num_group_vec[] = {
69};
70
71static const int event_count[] = {
78};
79
80unsigned *pmd_priv_vec;
81
82static unsigned long long mmcr0_fc5_6_mask;
83static unsigned long long *mmcr0_counter_mask;
84static unsigned long long *mmcr1_counter_mask;
85static unsigned long long *mmcr0_counter_off_val;
86static unsigned long long *mmcr1_counter_off_val;
87
88static const pme_power_entry_t *pe;
90
91static inline int get_num_event_counters() {
93}
94
95static inline int get_num_control_regs() {
97}
98
99static inline const unsigned long long *get_group_vector(int event) {
100 return pe[event].pme_group_vector;
101}
102
103static inline int get_event_id(int event, int counter) {
104 return pe[event].pme_event_ids[counter];
105}
106
107static inline char *get_event_name(int event) {
108 return pe[event].pme_name;
109}
110
111static inline char *get_long_desc(int event) {
112 return pe[event].pme_long_desc;
113}
114
115static inline int get_group_event_id(int group, int counter) {
116 return groups[group].pmg_event_ids[counter];
117}
118
119static inline unsigned long long get_mmcr0(int group) {
120 return groups[group].pmg_mmcr0;
121}
122
123static inline unsigned long long get_mmcr1(int group) {
124 return groups[group].pmg_mmcr1;
125}
126
127static inline unsigned long long get_mmcra(int group) {
128 return groups[group].pmg_mmcra;
129}
130
131
138static int pfm_gen_powerpc_get_event_code(unsigned int event,
139 unsigned int pmd,
140 int *code)
141{
143 *code = pe[event].pme_code;
144 return PFMLIB_SUCCESS;
145 } else
146 return PFMLIB_ERR_INVAL;
147}
148
154static char *pfm_gen_powerpc_get_event_name(unsigned int event)
155{
156 return get_event_name(event);
157}
158
164static char *pfm_gen_powerpc_get_event_mask_name(unsigned int event, unsigned int mask)
165{
166 return "";
167}
168
175static void pfm_gen_powerpc_get_event_counters(unsigned int event,
176 pfmlib_regmask_t *counters)
177{
178 int i;
179
180 counters->bits[0] = 0;
181 for (i = 0; i < get_num_event_counters(); i++) {
182 if (get_event_id(event, i) != -1) {
183 counters->bits[0] |= (1 << i);
184 }
185 }
186}
187
193static unsigned int pfm_gen_powerpc_get_num_event_masks(unsigned int event)
194{
195 /* POWER arch doesn't use event masks */
196 return 0;
197}
198
199static void remove_group(unsigned long long *group_vec, int group)
200{
201 group_vec[group / 64] &= ~(1ULL << (group % 64));
202}
203
204static void intersect_groups(unsigned long long *result, const unsigned long long *operand)
205{
206 int i;
207
209 result[i] &= operand[i];
210 }
211}
212
213static int first_group(unsigned long long *group_vec)
214{
215 int i, bit;
216
218 bit = ffsll(group_vec[i]);
219 if (bit) {
220 return (bit - 1) + (i * 64);
221 }
222 }
223 /* There were no groups */
224 return -1;
225}
226
227
228static unsigned gq_pmd_priv_vec[8] = {
229 0x0f0e,
230 0x0f0e,
231 0x0f0e,
232 0x0f0e,
233 0x0f0e,
234 0x0f0e,
235 0x0f0e,
236 0x0f0e
237};
238
239static unsigned gr_pmd_priv_vec[6] = {
240 0x0f0e,
241 0x0f0e,
242 0x0f0e,
243 0x0f0e,
244 0x0f0e,
245 0x0f0e,
246};
247
248static unsigned gs_pmd_priv_vec[6] = {
249 0x0f0e,
250 0x0f0e,
251 0x0f0e,
252 0x0f0e,
253 0x0800,
254 0x0800,
255};
256
257/* These masks are used on the PPC970*, and POWER4,4+ chips */
259 0x1fUL << (63 - 55), /* PMC1 */
260 0x1fUL << (63 - 62), /* PMC2 */
261 0,
262 0,
263 0,
264 0,
265 0,
266 0
267};
269 0,
270 0,
271 0x1fUL << (63 - 36), /* PMC3 */
272 0x1fUL << (63 - 41), /* PMC4 */
273 0x1fUL << (63 - 46), /* PMC5 */
274 0x1fUL << (63 - 51), /* PMC6 */
275 0x1fUL << (63 - 56), /* PMC7 */
276 0x1fUL << (63 - 61) /* PMC8 */
277};
278
280 0, /* PMC1 */
281 0, /* PMC2 */
282 0,
283 0,
284 0,
285 0,
286 0,
287 0
288};
290 0,
291 0,
292 0, /* PMC3 */
293 0, /* PMC4 */
294 0, /* PMC5 */
295 0, /* PMC6 */
296 0, /* PMC7 */
297 0 /* PMC8 */
298};
299
301 0x8UL << (63 - 55), /* PMC1 */
302 0x8UL << (63 - 62), /* PMC2 */
303 0,
304 0,
305 0,
306 0,
307 0,
308 0
309};
311 0,
312 0,
313 0x8UL << (63 - 36), /* PMC3 */
314 0x8UL << (63 - 41), /* PMC4 */
315 0x8UL << (63 - 46), /* PMC5 */
316 0x8UL << (63 - 51), /* PMC6 */
317 0x8UL << (63 - 56), /* PMC7 */
318 0x8UL << (63 - 61) /* PMC8 */
319};
320
321/* These masks are used on POWER5,5+,5++,6,7 */
323 0,
324 0,
325 0,
326 0,
327 0,
328 0
329};
331 0xffUL << (63 - 39), /* PMC1 */
332 0xffUL << (63 - 47), /* PMC2 */
333 0xffUL << (63 - 55), /* PMC3 */
334 0xffUL << (63 - 63), /* PMC4 */
335 0,
336 0
337};
338
340 0,
341 0,
342 0,
343 0,
344 0,
345 0
346};
347
349 0, /* PMC1 */
350 0, /* PMC2 */
351 0, /* PMC3 */
352 0, /* PMC4 */
353 0,
354 0
355};
356
357
365 void *model_input,
366 pfmlib_output_param_t *output,
367
368 void *model_output)
369{
370 /* model_input and model_output are unused on POWER */
371
372 int i, j, group;
373 int counters_used = 0;
374 unsigned long long mmcr0_val, mmcr1_val;
375 unsigned long long group_vector[num_group_vec[gen_powerpc_support.pmu_type - FIRST_POWER_PMU]];
376 unsigned int plm;
377
378 plm = (input->pfp_events[0].plm != 0) ? input->pfp_events[0].plm : input->pfp_dfl_plm;
379
380 /*
381 * Verify that all of the privilege level masks are identical, as
382 * we cannot have mixed levels on POWER
383 */
384
385 for (i = 1; i < input->pfp_event_count; i++) {
386 if (input->pfp_events[i].plm == 0) {
387 /* it's ok if the default is the same as plm */
388 if (plm != input->pfp_dfl_plm)
389 return PFMLIB_ERR_NOASSIGN;
390 } else {
391 if (plm != input->pfp_events[i].plm)
392 return PFMLIB_ERR_NOASSIGN;
393 }
394 }
395
396 /* start by setting all of the groups as available */
397 memset(group_vector, 0xff, sizeof(unsigned long long) * num_group_vec[gen_powerpc_support.pmu_type - FIRST_POWER_PMU]);
398
399 for (i = 0; i < input->pfp_event_count; i++) {
400 mmcr0_val |= mmcr0_counter_off_val[i];
401 intersect_groups(group_vector, get_group_vector(input->pfp_events[i].event));
402 mmcr1_val |= mmcr1_counter_off_val[i];
403 }
404 group = first_group(group_vector);
405 while (group != -1) {
406 /* find out if the the privilege levels are compatible with each counter */
407 for (i = 0; i < input->pfp_event_count; i++) {
408 /* find event counter in group */
409 for (j = 0; j < get_num_event_counters(); j++) {
410 if (get_event_id(input->pfp_events[i].event,j) == get_group_event_id(group, j)) {
411 /* found counter */
412 if (input->pfp_events[i].plm != 0) {
413 if (! (pmd_priv_vec[j] & (1 << input->pfp_events[0].plm))) {
414 remove_group(group_vector, group);
415 group = first_group(group_vector);
416 goto try_next_group;
417 }
418 } else {
419 if (! (pmd_priv_vec[j] & (1 << input->pfp_dfl_plm))) {
420 remove_group(group_vector, group);
421 group = first_group(group_vector);
422 goto try_next_group;
423 }
424 }
425 /* We located this counter and its privilege checks out ok. */
426 counters_used |= (1 << j);
427 output->pfp_pmds[i].reg_value = 0;
428 output->pfp_pmds[i].reg_addr = 0;
429 output->pfp_pmds[i].reg_alt_addr = 0;
430 output->pfp_pmds[i].reg_num = j + 1;
431 output->pfp_pmds[i].reg_reserved1 = 0;
432 output->pfp_pmd_count = i + 1;
433
434 /* Find the next counter */
435 break;
436 }
437 }
438 if (j == get_num_event_counters()) {
439 printf ("libpfm: Internal error. Unable to find counter in group.\n");
440 }
441 }
442 /*
443 * Success! We found a group (group) that meets the
444 * privilege constraints
445 */
446 break;
447try_next_group: ;
448 }
449 if (group == -1)
450 /* We did not find a group that meets the constraints */
451 return PFMLIB_ERR_NOASSIGN;
452
453 /* We now have a group that meets the constraints */
454
455 mmcr0_val = get_mmcr0(group);
456 mmcr1_val = get_mmcr1(group);
457 for (i = 0; i < get_num_event_counters(); i++) {
458 if (! (counters_used & (1 << i))) {
459 /*
460 * This counter is not used, so set that
461 * selector to its off value.
462 */
463 mmcr0_val &= ~mmcr0_counter_mask[i];
464 mmcr0_val |= mmcr0_counter_off_val[i];
465 mmcr1_val &= ~mmcr1_counter_mask[i];
466 mmcr1_val |= mmcr1_counter_off_val[i];
467 }
468 }
469 /*
470 * As a special case for PMC5 and PMC6 on POWER5/5+, freeze these
471 * two counters if neither are used. Note that the
472 * mmcr0_fc5_6_mask is zero for all processors except POWER5/5+
473 */
474 if ((counters_used & ((1 << (5 - 1)) | (1 << (6 - 1)))) == 0)
475 mmcr0_val |= mmcr0_fc5_6_mask;
476
477 /*
478 * Enable counter "exception on negative" and performance monitor
479 * exceptions
480 */
481 mmcr0_val |= MMCR0_PMXE | MMCR0_PMC1CE | MMCR0_PMCjCE;
482
483 /* Start with the counters frozen in every state, then selectively
484 enable them */
485
486 mmcr0_val |= MMCR0_FCP | MMCR0_FCS | MMCR0_FCHV;
487
488 if (plm & PFM_PLM3) {
489 /* user */
490 mmcr0_val &= ~MMCR0_FCP;
491 }
492 if (plm & PFM_PLM0) {
493 /* kernel */
494 mmcr0_val &= ~MMCR0_FCS;
495 }
496 if (plm & PFM_PLM1) {
497 /* hypervisor */
498 mmcr0_val &= ~MMCR0_FCHV;
499 }
500 /* PFM_PLM2 is not supported */
501
502 output->pfp_pmcs[0].reg_value = mmcr0_val;
503 output->pfp_pmcs[0].reg_addr = 0;
504 output->pfp_pmcs[0].reg_alt_addr = 0;
505 output->pfp_pmcs[0].reg_num = 0;
506 output->pfp_pmcs[0].reg_reserved1 = 0;
507
508 output->pfp_pmcs[1].reg_value = mmcr1_val;
509 output->pfp_pmcs[1].reg_addr = 0;
510 output->pfp_pmcs[1].reg_alt_addr = 0;
511 output->pfp_pmcs[1].reg_num = 1;
512 output->pfp_pmcs[1].reg_reserved1 = 0;
513
514 output->pfp_pmcs[2].reg_value = get_mmcra(group);
515 output->pfp_pmcs[2].reg_addr = 0;
516 output->pfp_pmcs[2].reg_alt_addr = 0;
517 output->pfp_pmcs[2].reg_num = 2;
518 output->pfp_pmcs[2].reg_reserved1 = 0;
519
520 /* We always use the same number of control regs */
522
523 return PFMLIB_SUCCESS;
524}
525
526
542{
545 gen_powerpc_support.pmu_name = "PPC970";
556 pe = ppc970_pe;
558 return PFMLIB_SUCCESS;
559 }
562 gen_powerpc_support.pmu_name = "PPC970MP";
573 pe = ppc970mp_pe;
575 return PFMLIB_SUCCESS;
576 }
579 gen_powerpc_support.pmu_name = "POWER4";
592 pe = power4_pe;
594 return PFMLIB_SUCCESS;
595 }
598 gen_powerpc_support.pmu_name = "POWER5";
611 pe = power5_pe;
613 return PFMLIB_SUCCESS;
614 }
617 gen_powerpc_support.pmu_name = "POWER5+";
628 if (PVR_VER(mfspr(SPRN_PVR)) >= 0x300) {
629 /* this is a newer, GS model POWER5+ */
632 } else {
635 }
638 pe = power5p_pe;
640 return PFMLIB_SUCCESS;
641 }
644 gen_powerpc_support.pmu_name = "POWER6";
657 pe = power6_pe;
659 return PFMLIB_SUCCESS;
660 }
663 gen_powerpc_support.pmu_name = "POWER7";
676 pe = power7_pe;
678 return PFMLIB_SUCCESS;
679 }
680
681 return PFMLIB_ERR_NOTSUPP;
682}
683
691{
692 impl_pmcs->bits[0] = (0xffffffff >> (32 - get_num_control_regs()));
693}
694
703{
704 impl_pmds->bits[0] = (0xffffffff >> (32 - get_num_event_counters()));
705}
706
716{
717 pfm_gen_powerpc_get_impl_pmds(impl_counters);
718}
719
725static void pfm_gen_powerpc_get_hw_counter_width(unsigned int *width)
726{
727 *width = 64;
728}
729
735static int pfm_gen_powerpc_get_event_desc(unsigned int event, char **desc)
736{
737 *desc = strdup(get_long_desc(event));
738 return 0;
739}
740
746static int pfm_gen_powerpc_get_event_mask_desc(unsigned int event,
747 unsigned int mask, char **desc)
748{
749 *desc = strdup("");
750 return 0;
751}
752
753static int pfm_gen_powerpc_get_event_mask_code(unsigned int event,
754 unsigned int mask, unsigned int *code)
755{
756 *code = 0;
757 return 0;
758}
759
760static int
762{
766 break;
769 break;
772 break;
775 break;
778 break;
781 break;
784 break;
785 default:
786 /* perhaps gen_powerpc_suport.pmu_type wasn't initialized? */
787 return PFMLIB_ERR_NOINIT;
788 }
789 e->num_masks = 0;
790 e->unit_masks[0] = 0;
791 return PFMLIB_SUCCESS;
792
793}
794
795static int
797{
801 break;
804 break;
807 break;
810 break;
813 break;
816 break;
819 break;
820 default:
821 /* perhaps gen_powerpc_suport.pmu_type wasn't initialized? */
822 return PFMLIB_ERR_NOINIT;
823 }
824 e->num_masks = 0;
825 e->unit_masks[0] = 0;
826 return 0;
827}
828
833 /* the next 6 fields are initialized in pfm_gen_powerpc_pmu_detect */
834 .pmu_name = NULL,
835 .pmu_type = PFMLIB_UNKNOWN_PMU,
836 .pme_count = 0,
837 .pmd_count = 0,
838 .pmc_count = 0,
839 .num_cnt = 0,
840
841 .get_event_code = pfm_gen_powerpc_get_event_code,
842 .get_event_name = pfm_gen_powerpc_get_event_name,
843 .get_event_mask_name = pfm_gen_powerpc_get_event_mask_name,
844 .get_event_counters = pfm_gen_powerpc_get_event_counters,
845 .get_num_event_masks = pfm_gen_powerpc_get_num_event_masks,
846 .dispatch_events = pfm_gen_powerpc_dispatch_events,
847 .pmu_detect = pfm_gen_powerpc_pmu_detect,
848 .get_impl_pmcs = pfm_gen_powerpc_get_impl_pmcs,
849 .get_impl_pmds = pfm_gen_powerpc_get_impl_pmds,
850 .get_impl_counters = pfm_gen_powerpc_get_impl_counters,
851 .get_hw_counter_width = pfm_gen_powerpc_get_hw_counter_width,
852 .get_event_desc = pfm_gen_powerpc_get_event_desc,
853 .get_event_mask_desc = pfm_gen_powerpc_get_event_mask_desc,
854 .get_event_mask_code = pfm_gen_powerpc_get_event_mask_code,
855 .get_cycle_event = pfm_gen_powerpc_get_cycle_event,
856 .get_inst_retired_event = pfm_gen_powerpc_get_inst_retired
857};
volatile int result
int i
static const pme_power_entry_t power5p_pe[]
#define POWER5p_PME_PM_INST_CMPL
#define POWER5p_PME_PM_RUN_CYC
static const pmg_power_group_t power5p_groups[]
#define POWER5p_PME_EVENT_COUNT
static const pmg_power_group_t power5_groups[]
#define POWER5_PME_PM_INST_CMPL
#define POWER5_PME_EVENT_COUNT
static const pme_power_entry_t power5_pe[]
#define POWER5_PME_PM_CYC
#define POWER6_PME_EVENT_COUNT
#define POWER6_PME_PM_INST_CMPL
#define POWER6_PME_PM_RUN_CYC
static const pme_power_entry_t power6_pe[]
static const pmg_power_group_t power6_groups[]
static const pme_power_entry_t power7_pe[]
static pmg_power_group_t power7_groups[]
#define POWER7_PME_PM_INST_CMPL
#define POWER7_PME_PM_RUN_CYC
#define POWER7_PME_EVENT_COUNT
#define PPC970_PME_PM_CYC
static const pme_power_entry_t ppc970_pe[]
static const pmg_power_group_t ppc970_groups[]
#define PPC970_PME_EVENT_COUNT
#define PPC970_PME_PM_INST_CMPL
#define PFMLIB_POWER4_PMU
Definition: pfmlib.h:266
#define PFMLIB_SUCCESS
Definition: pfmlib.h:283
#define PFM_PLM3
Definition: pfmlib.h:53
#define PFMLIB_POWER6_PMU
Definition: pfmlib.h:269
#define PFMLIB_PPC970_PMU
Definition: pfmlib.h:263
#define PFMLIB_POWER5p_PMU
Definition: pfmlib.h:268
#define PFMLIB_POWER5_PMU
Definition: pfmlib.h:267
#define PFMLIB_POWER7_PMU
Definition: pfmlib.h:270
#define PFMLIB_ERR_INVAL
Definition: pfmlib.h:285
#define PFMLIB_PPC970MP_PMU
Definition: pfmlib.h:264
#define PFM_PLM0
Definition: pfmlib.h:50
#define PFMLIB_ERR_NOINIT
Definition: pfmlib.h:286
#define PFMLIB_ERR_NOASSIGN
Definition: pfmlib.h:288
#define PFM_PLM1
Definition: pfmlib.h:51
#define PFMLIB_ERR_NOTSUPP
Definition: pfmlib.h:284
#define PFMLIB_UNKNOWN_PMU
Definition: pfmlib.h:222
static int pfm_gen_powerpc_get_cycle_event(pfmlib_event_t *e)
static void intersect_groups(unsigned long long *result, const unsigned long long *operand)
static int get_num_event_counters()
#define FIRST_POWER_PMU
static unsigned long long power4_mmcr1_counter_mask[POWER4_NUM_EVENT_COUNTERS]
static int get_group_event_id(int group, int counter)
static unsigned long long * mmcr1_counter_mask
static unsigned long long power4_mmcr0_counter_mask[POWER4_NUM_EVENT_COUNTERS]
static unsigned long long get_mmcr0(int group)
static unsigned long long get_mmcra(int group)
static void pfm_gen_powerpc_get_event_counters(unsigned int event, pfmlib_regmask_t *counters)
static int pfm_gen_powerpc_dispatch_events(pfmlib_input_param_t *input, void *model_input, pfmlib_output_param_t *output, void *model_output)
static unsigned gq_pmd_priv_vec[8]
static void pfm_gen_powerpc_get_impl_pmcs(pfmlib_regmask_t *impl_pmcs)
static const int num_group_vec[]
static unsigned int pfm_gen_powerpc_get_num_event_masks(unsigned int event)
static int first_group(unsigned long long *group_vec)
static void pfm_gen_powerpc_get_impl_counters(pfmlib_regmask_t *impl_counters)
static unsigned long long * mmcr1_counter_off_val
static char * pfm_gen_powerpc_get_event_mask_name(unsigned int event, unsigned int mask)
static const pme_power_entry_t * pe
static const unsigned long long * get_group_vector(int event)
unsigned * pmd_priv_vec
static int get_event_id(int event, int counter)
static unsigned long long power5_mmcr1_counter_mask[POWER5_NUM_EVENT_COUNTERS]
static unsigned long long power4_mmcr1_counter_off_val[POWER4_NUM_EVENT_COUNTERS]
static unsigned long long power5_mmcr0_counter_off_val[POWER5_NUM_EVENT_COUNTERS]
static int pfm_gen_powerpc_get_event_mask_desc(unsigned int event, unsigned int mask, char **desc)
static unsigned long long power4_mmcr0_counter_off_val[POWER4_NUM_EVENT_COUNTERS]
static unsigned gr_pmd_priv_vec[6]
static unsigned long long power5_mmcr0_counter_mask[POWER5_NUM_EVENT_COUNTERS]
static char * get_event_name(int event)
static int get_num_control_regs()
static int pfm_gen_powerpc_get_event_code(unsigned int event, unsigned int pmd, int *code)
static void remove_group(unsigned long long *group_vec, int group)
static unsigned long long ppc970_mmcr1_counter_off_val[POWER4_NUM_EVENT_COUNTERS]
static int pfm_gen_powerpc_pmu_detect(void)
static int pfm_gen_powerpc_get_inst_retired(pfmlib_event_t *e)
static int pfm_gen_powerpc_get_event_desc(unsigned int event, char **desc)
static void pfm_gen_powerpc_get_impl_pmds(pfmlib_regmask_t *impl_pmds)
static const pmg_power_group_t * groups
static unsigned gs_pmd_priv_vec[6]
static unsigned long long ppc970_mmcr0_counter_off_val[POWER4_NUM_EVENT_COUNTERS]
static const int event_count[]
pfm_pmu_support_t gen_powerpc_support
static unsigned long long mmcr0_fc5_6_mask
static unsigned long long * mmcr0_counter_off_val
static char * pfm_gen_powerpc_get_event_name(unsigned int event)
static unsigned long long * mmcr0_counter_mask
static unsigned long long power5_mmcr1_counter_off_val[POWER5_NUM_EVENT_COUNTERS]
static void pfm_gen_powerpc_get_hw_counter_width(unsigned int *width)
static char * get_long_desc(int event)
static unsigned long long get_mmcr1(int group)
static int pfm_gen_powerpc_get_event_mask_code(unsigned int event, unsigned int mask, unsigned int *code)
#define POWER4_NUM_GROUP_VEC
#define POWER4_NUM_EVENT_COUNTERS
#define POWER4_NUM_CONTROL_REGS
#define POWER5p_NUM_EVENT_COUNTERS
#define POWER5p_NUM_GROUP_VEC
#define POWER5p_NUM_CONTROL_REGS
#define POWER5_NUM_CONTROL_REGS
#define POWER5_NUM_GROUP_VEC
#define POWER5_NUM_EVENT_COUNTERS
#define POWER6_NUM_GROUP_VEC
#define POWER6_NUM_CONTROL_REGS
#define POWER6_NUM_EVENT_COUNTERS
#define POWER7_NUM_CONTROL_REGS
#define POWER7_NUM_EVENT_COUNTERS
#define POWER7_NUM_GROUP_VEC
#define PPC970_NUM_EVENT_COUNTERS
#define PPC970_NUM_CONTROL_REGS
#define PPC970_NUM_GROUP_VEC
#define PPC970MP_NUM_CONTROL_REGS
#define PPC970MP_NUM_GROUP_VEC
#define PPC970MP_NUM_EVENT_COUNTERS
#define POWER4_PME_PM_INST_CMPL
static const pme_power_entry_t power4_pe[]
#define POWER4_PME_EVENT_COUNT
#define POWER4_PME_PM_CYC
static const pmg_power_group_t power4_groups[]
#define SPRN_PVR
#define MMCR0_FC5_6
Definition: powerpc_reg.h:39
#define MMCR0_FCP
Definition: powerpc_reg.h:26
#define PV_POWER5p
Definition: powerpc_reg.h:77
#define __is_processor(pv)
Definition: powerpc_reg.h:65
#define MMCR0_PMC1CE
Definition: powerpc_reg.h:33
#define mfspr(rn)
Definition: powerpc_reg.h:14
#define MMCR0_FCHV
Definition: powerpc_reg.h:43
#define PV_970MP
Definition: powerpc_reg.h:83
#define PVR_VER(pvr)
Definition: powerpc_reg.h:62
#define PV_970
Definition: powerpc_reg.h:75
#define MMCR0_FCS
Definition: powerpc_reg.h:24
#define MMCR0_PMCjCE
Definition: powerpc_reg.h:34
#define PV_POWER7
Definition: powerpc_reg.h:80
#define PV_POWER4
Definition: powerpc_reg.h:71
#define PV_970GX
Definition: powerpc_reg.h:84
#define PV_970FX
Definition: powerpc_reg.h:78
#define MMCR0_PMXE
Definition: powerpc_reg.h:30
#define PV_POWER6
Definition: powerpc_reg.h:79
#define PV_POWER4p
Definition: powerpc_reg.h:74
#define PV_POWER5
Definition: powerpc_reg.h:76
static const pme_power_entry_t ppc970mp_pe[]
#define PPC970MP_PME_EVENT_COUNT
#define PPC970MP_PME_PM_CYC
#define PPC970MP_PME_PM_INST_CMPL
static const pmg_power_group_t ppc970mp_groups[]
unsigned int pmc_count
Definition: pfmlib_priv.h:37
unsigned int num_cnt
Definition: pfmlib_priv.h:38
unsigned int pmd_count
Definition: pfmlib_priv.h:36
unsigned int pme_count
Definition: pfmlib_priv.h:35
unsigned int num_masks
Definition: pfmlib.h:90
unsigned int plm
Definition: pfmlib.h:87
unsigned int unit_masks[PFMLIB_MAX_MASKS_PER_EVENT]
Definition: pfmlib.h:89
unsigned int event
Definition: pfmlib.h:86
unsigned int pfp_dfl_plm
Definition: pfmlib.h:110
pfmlib_event_t pfp_events[PFMLIB_MAX_PMCS]
Definition: pfmlib.h:113
unsigned int pfp_event_count
Definition: pfmlib.h:109
pfmlib_reg_t pfp_pmds[PFMLIB_MAX_PMDS]
Definition: pfmlib.h:130
pfmlib_reg_t pfp_pmcs[PFMLIB_MAX_PMCS]
Definition: pfmlib.h:129
unsigned int pfp_pmc_count
Definition: pfmlib.h:127
unsigned int pfp_pmd_count
Definition: pfmlib.h:128
unsigned int reg_reserved1
Definition: pfmlib.h:101
unsigned long long reg_value
Definition: pfmlib.h:98
unsigned int reg_num
Definition: pfmlib.h:100
unsigned long reg_alt_addr
Definition: pfmlib.h:102
unsigned long long reg_addr
Definition: pfmlib.h:99
pfmlib_regmask_bits_t bits[PFMLIB_REG_BV]
Definition: pfmlib.h:76
char * pme_long_desc
const int * pme_event_ids
char * pme_name
const unsigned long long * pme_group_vector
unsigned pme_code
unsigned long long pmg_mmcra
unsigned long long pmg_mmcr0
const int * pmg_event_ids
unsigned long long pmg_mmcr1