1
1
/*
2
2
* Copyright © 2009 CNRS
3
- * Copyright © 2009-2022 Inria. All rights reserved.
3
+ * Copyright © 2009-2023 Inria. All rights reserved.
4
4
* Copyright © 2009-2013 Université Bordeaux
5
5
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
6
6
* See COPYING in top-level directory.
@@ -456,23 +456,26 @@ static void hwloc__darwin_look_perflevel_caches(struct hwloc_topology *topology,
456
456
int64_t size ;
457
457
458
458
snprintf (name , sizeof (name ), "hw.perflevel%u.l1icachesize" , level );
459
- if (!hwloc_get_sysctlbyname (name , & size )) {
459
+ if (hwloc_filter_check_keep_object_type (topology , HWLOC_OBJ_L1ICACHE )
460
+ && !hwloc_get_sysctlbyname (name , & size )) {
460
461
/* hw.perflevel%u.cpusperl1i missing, assume it's per PU */
461
462
hwloc_debug ("found perflevel %u l1icachesize %ld, assuming width 1\n" , level , (long ) size );
462
463
hwloc__darwin_build_perflevel_cache_level (topology , cpuset , 1 , HWLOC_OBJ_L1ICACHE , 1 , size , linesize );
463
464
gothybrid -> l1i ++ ;
464
465
}
465
466
466
467
snprintf (name , sizeof (name ), "hw.perflevel%u.l1dcachesize" , level );
467
- if (!hwloc_get_sysctlbyname (name , & size )) {
468
+ if (hwloc_filter_check_keep_object_type (topology , HWLOC_OBJ_L1CACHE )
469
+ && !hwloc_get_sysctlbyname (name , & size )) {
468
470
/* hw.perflevel%u.cpusperl1d missing, assume it's per PU */
469
471
hwloc_debug ("found perflevel %u l1dcachesize %ld, assuming width 1\n" , level , (long ) size );
470
472
hwloc__darwin_build_perflevel_cache_level (topology , cpuset , 1 , HWLOC_OBJ_L1CACHE , 1 , size , linesize );
471
473
gothybrid -> l1d ++ ;
472
474
}
473
475
474
476
snprintf (name , sizeof (name ), "hw.perflevel%u.l2cachesize" , level );
475
- if (!hwloc_get_sysctlbyname (name , & size )) {
477
+ if (hwloc_filter_check_keep_object_type (topology , HWLOC_OBJ_L2CACHE )
478
+ && !hwloc_get_sysctlbyname (name , & size )) {
476
479
int64_t cpus ;
477
480
478
481
hwloc_debug ("found perflevel %u l2cachesize %ld\n" , level , (long ) size );
@@ -499,10 +502,11 @@ static void hwloc__darwin_look_perflevel_caches(struct hwloc_topology *topology,
499
502
/* assume PUs are contigous for now. */
500
503
hwloc__darwin_build_perflevel_cache_level (topology , cpuset , cpus , HWLOC_OBJ_L2CACHE , 2 , size , linesize );
501
504
gothybrid -> l2 ++ ;
502
- }
505
+ }
503
506
504
507
snprintf (name , sizeof (name ), "hw.perflevel%u.l3cachesize" , level );
505
- if (!hwloc_get_sysctlbyname (name , & size )) {
508
+ if (hwloc_filter_check_keep_object_type (topology , HWLOC_OBJ_L3CACHE )
509
+ && !hwloc_get_sysctlbyname (name , & size )) {
506
510
int64_t cpus ;
507
511
508
512
hwloc_debug ("found perflevel %u l3cachesize %ld\n" , level , (long ) size );
0 commit comments