@@ -2080,8 +2080,6 @@ struct pkg_data {
2080
2080
((node_no) * topo.cores_per_node) + \
2081
2081
(core_no))
2082
2082
2083
- #define GET_PKG (pkg_base , pkg_no ) (pkg_base + pkg_no)
2084
-
2085
2083
/*
2086
2084
* The accumulated sum of MSR is defined as a monotonic
2087
2085
* increasing MSR, it will be accumulated periodically,
@@ -2345,16 +2343,15 @@ int for_all_cpus(int (func) (struct thread_data *, struct core_data *, struct pk
2345
2343
for (thread_no = 0 ; thread_no < topo .threads_per_core ; ++ thread_no ) {
2346
2344
struct thread_data * t ;
2347
2345
struct core_data * c ;
2348
- struct pkg_data * p ;
2346
+
2349
2347
t = GET_THREAD (thread_base , thread_no , core_no , node_no , pkg_no );
2350
2348
2351
2349
if (cpu_is_not_allowed (t -> cpu_id ))
2352
2350
continue ;
2353
2351
2354
2352
c = GET_CORE (core_base , core_no , node_no , pkg_no );
2355
- p = GET_PKG (pkg_base , pkg_no );
2356
2353
2357
- retval |= func (t , c , p );
2354
+ retval |= func (t , c , & pkg_base [ pkg_no ] );
2358
2355
}
2359
2356
}
2360
2357
}
@@ -6119,7 +6116,6 @@ int for_all_cpus_2(int (func) (struct thread_data *, struct core_data *,
6119
6116
for (thread_no = 0 ; thread_no < topo .threads_per_core ; ++ thread_no ) {
6120
6117
struct thread_data * t , * t2 ;
6121
6118
struct core_data * c , * c2 ;
6122
- struct pkg_data * p , * p2 ;
6123
6119
6124
6120
t = GET_THREAD (thread_base , thread_no , core_no , node_no , pkg_no );
6125
6121
@@ -6131,10 +6127,7 @@ int for_all_cpus_2(int (func) (struct thread_data *, struct core_data *,
6131
6127
c = GET_CORE (core_base , core_no , node_no , pkg_no );
6132
6128
c2 = GET_CORE (core_base2 , core_no , node_no , pkg_no );
6133
6129
6134
- p = GET_PKG (pkg_base , pkg_no );
6135
- p2 = GET_PKG (pkg_base2 , pkg_no );
6136
-
6137
- retval |= func (t , c , p , t2 , c2 , p2 );
6130
+ retval |= func (t , c , & pkg_base [pkg_no ], t2 , c2 , & pkg_base2 [pkg_no ]);
6138
6131
}
6139
6132
}
6140
6133
}
@@ -9342,7 +9335,6 @@ void init_counter(struct thread_data *thread_base, struct core_data *core_base,
9342
9335
int thread_id = cpus [cpu_id ].thread_id ;
9343
9336
struct thread_data * t ;
9344
9337
struct core_data * c ;
9345
- struct pkg_data * p ;
9346
9338
9347
9339
/* Workaround for systems where physical_node_id==-1
9348
9340
* and logical_node_id==(-1 - topo.num_cpus)
@@ -9352,18 +9344,17 @@ void init_counter(struct thread_data *thread_base, struct core_data *core_base,
9352
9344
9353
9345
t = GET_THREAD (thread_base , thread_id , core_id , node_id , pkg_id );
9354
9346
c = GET_CORE (core_base , core_id , node_id , pkg_id );
9355
- p = GET_PKG (pkg_base , pkg_id );
9356
9347
9357
9348
t -> cpu_id = cpu_id ;
9358
9349
if (!cpu_is_not_allowed (cpu_id )) {
9359
9350
if (c -> base_cpu < 0 )
9360
9351
c -> base_cpu = t -> cpu_id ;
9361
- if (p -> base_cpu < 0 )
9362
- p -> base_cpu = t -> cpu_id ;
9352
+ if (pkg_base [ pkg_id ]. base_cpu < 0 )
9353
+ pkg_base [ pkg_id ]. base_cpu = t -> cpu_id ;
9363
9354
}
9364
9355
9365
9356
c -> core_id = core_id ;
9366
- p -> package_id = pkg_id ;
9357
+ pkg_base [ pkg_id ]. package_id = pkg_id ;
9367
9358
}
9368
9359
9369
9360
int initialize_counters (int cpu_id )
0 commit comments