@@ -217,11 +217,11 @@ struct pkg_data {
217
217
#define EVEN_COUNTERS thread_even, core_even, package_even
218
218
219
219
#define GET_THREAD (thread_base , thread_no , core_no , pkg_no ) \
220
- (thread_base + (pkg_no) * topo.num_cores_per_pkg * \
220
+ (thread_base + (pkg_no) * topo.num_cores_per_node * \
221
221
topo.num_threads_per_core + \
222
222
(core_no) * topo.num_threads_per_core + (thread_no))
223
223
#define GET_CORE (core_base , core_no , pkg_no ) \
224
- (core_base + (pkg_no) * topo.num_cores_per_pkg + (core_no))
224
+ (core_base + (pkg_no) * topo.num_cores_per_node + (core_no))
225
225
#define GET_PKG (pkg_base , pkg_no ) (pkg_base + pkg_no)
226
226
227
227
enum counter_scope {SCOPE_CPU , SCOPE_CORE , SCOPE_PACKAGE };
@@ -274,7 +274,7 @@ struct topo_params {
274
274
int max_cpu_num ;
275
275
int max_node_num ;
276
276
int num_nodes_per_pkg ;
277
- int num_cores_per_pkg ;
277
+ int num_cores_per_node ;
278
278
int num_threads_per_core ;
279
279
} topo ;
280
280
@@ -300,7 +300,8 @@ int for_all_cpus(int (func)(struct thread_data *, struct core_data *, struct pkg
300
300
int retval , pkg_no , core_no , thread_no ;
301
301
302
302
for (pkg_no = 0 ; pkg_no < topo .num_packages ; ++ pkg_no ) {
303
- for (core_no = 0 ; core_no < topo .num_cores_per_pkg ; ++ core_no ) {
303
+ for (core_no = 0 ; core_no < topo .num_cores_per_node ;
304
+ ++ core_no ) {
304
305
for (thread_no = 0 ; thread_no <
305
306
topo .num_threads_per_core ; ++ thread_no ) {
306
307
struct thread_data * t ;
@@ -2491,7 +2492,8 @@ int for_all_cpus_2(int (func)(struct thread_data *, struct core_data *,
2491
2492
int retval , pkg_no , core_no , thread_no ;
2492
2493
2493
2494
for (pkg_no = 0 ; pkg_no < topo .num_packages ; ++ pkg_no ) {
2494
- for (core_no = 0 ; core_no < topo .num_cores_per_pkg ; ++ core_no ) {
2495
+ for (core_no = 0 ; core_no < topo .num_cores_per_node ;
2496
+ ++ core_no ) {
2495
2497
for (thread_no = 0 ; thread_no <
2496
2498
topo .num_threads_per_core ; ++ thread_no ) {
2497
2499
struct thread_data * t , * t2 ;
@@ -4728,11 +4730,11 @@ void topology_probe()
4728
4730
cpus [i ].thread_id );
4729
4731
}
4730
4732
4731
- topo .num_cores_per_pkg = max_core_id + 1 ;
4733
+ topo .num_cores_per_node = max_core_id + 1 ;
4732
4734
if (debug > 1 )
4733
4735
fprintf (outf , "max_core_id %d, sizing for %d cores per package\n" ,
4734
- max_core_id , topo .num_cores_per_pkg );
4735
- if (!summary_only && topo .num_cores_per_pkg > 1 )
4736
+ max_core_id , topo .num_cores_per_node );
4737
+ if (!summary_only && topo .num_cores_per_node > 1 )
4736
4738
BIC_PRESENT (BIC_Core );
4737
4739
4738
4740
topo .num_packages = max_package_id + 1 ;
@@ -4756,21 +4758,21 @@ allocate_counters(struct thread_data **t, struct core_data **c, struct pkg_data
4756
4758
{
4757
4759
int i ;
4758
4760
4759
- * t = calloc (topo .num_threads_per_core * topo .num_cores_per_pkg *
4761
+ * t = calloc (topo .num_threads_per_core * topo .num_cores_per_node *
4760
4762
topo .num_packages , sizeof (struct thread_data ));
4761
4763
if (* t == NULL )
4762
4764
goto error ;
4763
4765
4764
4766
for (i = 0 ; i < topo .num_threads_per_core *
4765
- topo .num_cores_per_pkg * topo .num_packages ; i ++ )
4767
+ topo .num_cores_per_node * topo .num_packages ; i ++ )
4766
4768
(* t )[i ].cpu_id = -1 ;
4767
4769
4768
- * c = calloc (topo .num_cores_per_pkg * topo .num_packages ,
4770
+ * c = calloc (topo .num_cores_per_node * topo .num_packages ,
4769
4771
sizeof (struct core_data ));
4770
4772
if (* c == NULL )
4771
4773
goto error ;
4772
4774
4773
- for (i = 0 ; i < topo .num_cores_per_pkg * topo .num_packages ; i ++ )
4775
+ for (i = 0 ; i < topo .num_cores_per_node * topo .num_packages ; i ++ )
4774
4776
(* c )[i ].core_id = -1 ;
4775
4777
4776
4778
* p = calloc (topo .num_packages , sizeof (struct pkg_data ));
0 commit comments