Print this page
10951 10895 unfixed 10146


 977 static uint64_t
 978 core_pcbe_event_coverage(char *event)
 979 {
 980         uint64_t bitmap;
 981         uint64_t bitmask;
 982         const struct events_table_t *n;
 983         int i;
 984 
 985         bitmap = 0;
 986 
 987         /* Is it an event that a GPC can track? */
 988         if (versionid >= 3) {
 989                 n = find_gpcevent(event);
 990                 if (n != NULL) {
 991                         bitmap |= (n->supported_counters &
 992                             BITMASK_XBITS(num_gpc));
 993                 }
 994         } else {
 995                 if (find_generic_events(event, cmn_generic_events) != NULL) {
 996                         bitmap |= BITMASK_XBITS(num_gpc);
 997                 } if (find_generic_events(event, generic_events_pic0) != NULL) {

 998                         bitmap |= 1ULL;
 999                 } else if (find_gpcevent_core_uarch(event,
1000                     cmn_gpc_events_core_uarch) != NULL) {
1001                         bitmap |= BITMASK_XBITS(num_gpc);
1002                 } else if (find_gpcevent_core_uarch(event, pic0_events) !=
1003                     NULL) {
1004                         bitmap |= 1ULL;
1005                 } else if (find_gpcevent_core_uarch(event, pic1_events) !=
1006                     NULL) {
1007                         bitmap |= 1ULL << 1;
1008                 }
1009         }
1010 
1011         /* Check if the event can be counted in the fixed-function counters */
1012         if (num_ffc > 0) {
1013                 bitmask = 1ULL << num_gpc;
1014                 for (i = 0; i < num_ffc; i++) {
1015                         if (strcmp(event, ffc_names[i]) == 0) {
1016                                 bitmap |= bitmask;
1017                         } else if (strcmp(event, ffc_genericnames[i]) == 0) {




 977 static uint64_t
 978 core_pcbe_event_coverage(char *event)
 979 {
 980         uint64_t bitmap;
 981         uint64_t bitmask;
 982         const struct events_table_t *n;
 983         int i;
 984 
 985         bitmap = 0;
 986 
 987         /* Is it an event that a GPC can track? */
 988         if (versionid >= 3) {
 989                 n = find_gpcevent(event);
 990                 if (n != NULL) {
 991                         bitmap |= (n->supported_counters &
 992                             BITMASK_XBITS(num_gpc));
 993                 }
 994         } else {
 995                 if (find_generic_events(event, cmn_generic_events) != NULL) {
 996                         bitmap |= BITMASK_XBITS(num_gpc);
 997                 } else if (find_generic_events(event,
 998                     generic_events_pic0) != NULL) {
 999                         bitmap |= 1ULL;
1000                 } else if (find_gpcevent_core_uarch(event,
1001                     cmn_gpc_events_core_uarch) != NULL) {
1002                         bitmap |= BITMASK_XBITS(num_gpc);
1003                 } else if (find_gpcevent_core_uarch(event, pic0_events) !=
1004                     NULL) {
1005                         bitmap |= 1ULL;
1006                 } else if (find_gpcevent_core_uarch(event, pic1_events) !=
1007                     NULL) {
1008                         bitmap |= 1ULL << 1;
1009                 }
1010         }
1011 
1012         /* Check if the event can be counted in the fixed-function counters */
1013         if (num_ffc > 0) {
1014                 bitmask = 1ULL << num_gpc;
1015                 for (i = 0; i < num_ffc; i++) {
1016                         if (strcmp(event, ffc_names[i]) == 0) {
1017                                 bitmap |= bitmask;
1018                         } else if (strcmp(event, ffc_genericnames[i]) == 0) {