@@ -4510,6 +4510,7 @@ look_sysfscpukinds(struct hwloc_topology *topology,
4510
4510
int max_without_basefreq = 0 ; /* any cpu where we have maxfreq without basefreq? */
4511
4511
char str [293 ];
4512
4512
char * env ;
4513
+ hwloc_bitmap_t atom_pmu_set , core_pmu_set ;
4513
4514
int maxfreq_enabled = -1 ; /* -1 means adjust (default), 0 means ignore, 1 means enforce */
4514
4515
unsigned adjust_max = 10 ;
4515
4516
int i ;
@@ -4573,6 +4574,28 @@ look_sysfscpukinds(struct hwloc_topology *topology,
4573
4574
hwloc_linux_cpukinds_register (& cpu_capacity , topology , "LinuxCapacity" , 1 );
4574
4575
hwloc_linux_cpukinds_destroy (& cpu_capacity );
4575
4576
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
+
4576
4599
return 0 ;
4577
4600
}
4578
4601
0 commit comments