Skip to content

Commit

Permalink
Intel Westmere (EX): Fix for Uncore units with ACCESSMODE=perf_event
Browse files Browse the repository at this point in the history
  • Loading branch information
TomTheBear committed Sep 17, 2024
1 parent 6b1627d commit e72c0d8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/includes/perfmon_nehalem_counters.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ static BoxMap nehalem_box_map[NUM_UNITS] = {
[UNCORE] = {MSR_UNCORE_PERF_GLOBAL_CTRL, MSR_UNCORE_PERF_GLOBAL_STATUS, MSR_UNCORE_PERF_GLOBAL_OVF_CTRL, -1, 0, 0, 48}
};

static char* nehalem_translate_types[NUM_UNITS] = {
[FIXED] = "/sys/bus/event_source/devices/cpu",
[PMC] = "/sys/bus/event_source/devices/cpu",
[UNCORE] = "/sys/bus/event_source/devices/uncore",
};

1 change: 1 addition & 0 deletions src/includes/perfmon_perfevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ int perfmon_setupCountersThread_perfevent(
is_uncore = 1;
break;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
case UNCORE:
case MBOX0:
case MBOX1:
case MBOX2:
Expand Down
4 changes: 2 additions & 2 deletions src/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ perfmon_init_maps(void)
counter_map = nehalem_counter_map;
perfmon_numCounters = perfmon_numCountersNehalem;
box_map = nehalem_box_map;
translate_types = default_translate_types;
translate_types = nehalem_translate_types;
break;

case NEHALEM_WESTMERE_M:
Expand All @@ -994,7 +994,7 @@ perfmon_init_maps(void)
counter_map = nehalem_counter_map;
perfmon_numCounters = perfmon_numCountersNehalem;
box_map = nehalem_box_map;
translate_types = default_translate_types;
translate_types = nehalem_translate_types;
break;

case IVYBRIDGE_EP:
Expand Down

0 comments on commit e72c0d8

Please sign in to comment.