@@ -4510,6 +4510,7 @@ look_sysfscpukinds(struct hwloc_topology *topology,
45104510 int max_without_basefreq = 0 ; /* any cpu where we have maxfreq without basefreq? */
45114511 char str [293 ];
45124512 char * env ;
4513+ hwloc_bitmap_t atom_pmu_set , core_pmu_set ;
45134514 int maxfreq_enabled = -1 ; /* -1 means adjust (default), 0 means ignore, 1 means enforce */
45144515 unsigned adjust_max = 10 ;
45154516 int i ;
@@ -4573,6 +4574,28 @@ look_sysfscpukinds(struct hwloc_topology *topology,
45734574 hwloc_linux_cpukinds_register (& cpu_capacity , topology , "LinuxCapacity" , 1 );
45744575 hwloc_linux_cpukinds_destroy (& cpu_capacity );
45754576
4577+ /* look at Intel core/atom PMUs */
4578+ atom_pmu_set = hwloc__alloc_read_path_as_cpulist ("/sys/devices/cpu_atom/cpus" , data -> root_fd );
4579+ core_pmu_set = hwloc__alloc_read_path_as_cpulist ("/sys/devices/cpu_core/cpus" , data -> root_fd );
4580+ if (atom_pmu_set ) {
4581+ struct hwloc_info_s infoattr ;
4582+ infoattr .name = (char * ) "CoreType" ;
4583+ infoattr .value = (char * ) "IntelAtom" ;
4584+ hwloc_internal_cpukinds_register (topology , atom_pmu_set , HWLOC_CPUKIND_EFFICIENCY_UNKNOWN , & infoattr , 1 , 0 );
4585+ /* the cpuset is given to the callee */
4586+ } else {
4587+ hwloc_bitmap_free (atom_pmu_set );
4588+ }
4589+ if (core_pmu_set ) {
4590+ struct hwloc_info_s infoattr ;
4591+ infoattr .name = (char * ) "CoreType" ;
4592+ infoattr .value = (char * ) "IntelCore" ;
4593+ hwloc_internal_cpukinds_register (topology , core_pmu_set , HWLOC_CPUKIND_EFFICIENCY_UNKNOWN , & infoattr , 1 , 0 );
4594+ /* the cpuset is given to the callee */
4595+ } else {
4596+ hwloc_bitmap_free (core_pmu_set );
4597+ }
4598+
45764599 return 0 ;
45774600}
45784601
0 commit comments