@@ -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_node * \
221
- topo.num_threads_per_core + \
222
- (core_no) * topo.num_threads_per_core + (thread_no))
220
+ (thread_base + (pkg_no) * topo.cores_per_node * \
221
+ topo.threads_per_core + \
222
+ (core_no) * topo.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_node + (core_no))
224
+ (core_base + (pkg_no) * topo.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 };
@@ -273,9 +273,9 @@ struct topo_params {
273
273
int num_cores ;
274
274
int max_cpu_num ;
275
275
int max_node_num ;
276
- int num_nodes_per_pkg ;
277
- int num_cores_per_node ;
278
- int num_threads_per_core ;
276
+ int nodes_per_pkg ;
277
+ int cores_per_node ;
278
+ int threads_per_core ;
279
279
} topo ;
280
280
281
281
struct timeval tv_even , tv_odd , tv_delta ;
@@ -300,10 +300,9 @@ 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_node ;
304
- ++ core_no ) {
303
+ for (core_no = 0 ; core_no < topo .cores_per_node ; ++ core_no ) {
305
304
for (thread_no = 0 ; thread_no <
306
- topo .num_threads_per_core ; ++ thread_no ) {
305
+ topo .threads_per_core ; ++ thread_no ) {
307
306
struct thread_data * t ;
308
307
struct core_data * c ;
309
308
struct pkg_data * p ;
@@ -2401,8 +2400,8 @@ void set_node_data(void)
2401
2400
}
2402
2401
2403
2402
for (pkg = 0 ; pkg < topo .num_packages ; pkg ++ )
2404
- if (pni [pkg ].count > topo .num_nodes_per_pkg )
2405
- topo .num_nodes_per_pkg = pni [0 ].count ;
2403
+ if (pni [pkg ].count > topo .nodes_per_pkg )
2404
+ topo .nodes_per_pkg = pni [0 ].count ;
2406
2405
2407
2406
for (cpu = 0 ; cpu < topo .num_cpus ; cpu ++ ) {
2408
2407
pkg = cpus [cpu ].physical_package_id ;
@@ -2492,10 +2491,9 @@ int for_all_cpus_2(int (func)(struct thread_data *, struct core_data *,
2492
2491
int retval , pkg_no , core_no , thread_no ;
2493
2492
2494
2493
for (pkg_no = 0 ; pkg_no < topo .num_packages ; ++ pkg_no ) {
2495
- for (core_no = 0 ; core_no < topo .num_cores_per_node ;
2496
- ++ core_no ) {
2494
+ for (core_no = 0 ; core_no < topo .cores_per_node ; ++ core_no ) {
2497
2495
for (thread_no = 0 ; thread_no <
2498
- topo .num_threads_per_core ; ++ thread_no ) {
2496
+ topo .threads_per_core ; ++ thread_no ) {
2499
2497
struct thread_data * t , * t2 ;
2500
2498
struct core_data * c , * c2 ;
2501
2499
struct pkg_data * p , * p2 ;
@@ -4730,11 +4728,11 @@ void topology_probe()
4730
4728
cpus [i ].thread_id );
4731
4729
}
4732
4730
4733
- topo .num_cores_per_node = max_core_id + 1 ;
4731
+ topo .cores_per_node = max_core_id + 1 ;
4734
4732
if (debug > 1 )
4735
4733
fprintf (outf , "max_core_id %d, sizing for %d cores per package\n" ,
4736
- max_core_id , topo .num_cores_per_node );
4737
- if (!summary_only && topo .num_cores_per_node > 1 )
4734
+ max_core_id , topo .cores_per_node );
4735
+ if (!summary_only && topo .cores_per_node > 1 )
4738
4736
BIC_PRESENT (BIC_Core );
4739
4737
4740
4738
topo .num_packages = max_package_id + 1 ;
@@ -4746,9 +4744,9 @@ void topology_probe()
4746
4744
4747
4745
set_node_data ();
4748
4746
if (debug > 1 )
4749
- fprintf (outf , "num_nodes_per_pkg %d\n" , topo .num_nodes_per_pkg );
4747
+ fprintf (outf , "nodes_per_pkg %d\n" , topo .nodes_per_pkg );
4750
4748
4751
- topo .num_threads_per_core = max_siblings ;
4749
+ topo .threads_per_core = max_siblings ;
4752
4750
if (debug > 1 )
4753
4751
fprintf (outf , "max_siblings %d\n" , max_siblings );
4754
4752
}
@@ -4758,21 +4756,21 @@ allocate_counters(struct thread_data **t, struct core_data **c, struct pkg_data
4758
4756
{
4759
4757
int i ;
4760
4758
4761
- * t = calloc (topo .num_threads_per_core * topo .num_cores_per_node *
4759
+ * t = calloc (topo .threads_per_core * topo .cores_per_node *
4762
4760
topo .num_packages , sizeof (struct thread_data ));
4763
4761
if (* t == NULL )
4764
4762
goto error ;
4765
4763
4766
- for (i = 0 ; i < topo .num_threads_per_core *
4767
- topo .num_cores_per_node * topo .num_packages ; i ++ )
4764
+ for (i = 0 ; i < topo .threads_per_core *
4765
+ topo .cores_per_node * topo .num_packages ; i ++ )
4768
4766
(* t )[i ].cpu_id = -1 ;
4769
4767
4770
- * c = calloc (topo .num_cores_per_node * topo .num_packages ,
4768
+ * c = calloc (topo .cores_per_node * topo .num_packages ,
4771
4769
sizeof (struct core_data ));
4772
4770
if (* c == NULL )
4773
4771
goto error ;
4774
4772
4775
- for (i = 0 ; i < topo .num_cores_per_node * topo .num_packages ; i ++ )
4773
+ for (i = 0 ; i < topo .cores_per_node * topo .num_packages ; i ++ )
4776
4774
(* c )[i ].core_id = -1 ;
4777
4775
4778
4776
* p = calloc (topo .num_packages , sizeof (struct pkg_data ));
0 commit comments