File tree Expand file tree Collapse file tree 3 files changed +3
-17
lines changed Expand file tree Collapse file tree 3 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -1631,23 +1631,13 @@ static int perf_stat_init_aggr_mode(void)
1631
1631
1632
1632
static void cpu_aggr_map__delete (struct cpu_aggr_map * map )
1633
1633
{
1634
- if (map ) {
1635
- WARN_ONCE (refcount_read (& map -> refcnt ) != 0 ,
1636
- "cpu_aggr_map refcnt unbalanced\n" );
1637
- free (map );
1638
- }
1639
- }
1640
-
1641
- static void cpu_aggr_map__put (struct cpu_aggr_map * map )
1642
- {
1643
- if (map && refcount_dec_and_test (& map -> refcnt ))
1644
- cpu_aggr_map__delete (map );
1634
+ free (map );
1645
1635
}
1646
1636
1647
1637
static void perf_stat__exit_aggr_mode (void )
1648
1638
{
1649
- cpu_aggr_map__put (stat_config .aggr_map );
1650
- cpu_aggr_map__put (stat_config .cpus_aggr_map );
1639
+ cpu_aggr_map__delete (stat_config .aggr_map );
1640
+ cpu_aggr_map__delete (stat_config .cpus_aggr_map );
1651
1641
stat_config .aggr_map = NULL ;
1652
1642
stat_config .cpus_aggr_map = NULL ;
1653
1643
}
Original file line number Diff line number Diff line change @@ -180,8 +180,6 @@ struct cpu_aggr_map *cpu_aggr_map__empty_new(int nr)
180
180
cpus -> nr = nr ;
181
181
for (i = 0 ; i < nr ; i ++ )
182
182
cpus -> map [i ] = aggr_cpu_id__empty ();
183
-
184
- refcount_set (& cpus -> refcnt , 1 );
185
183
}
186
184
187
185
return cpus ;
Original file line number Diff line number Diff line change 5
5
#include <stdbool.h>
6
6
#include <stdio.h>
7
7
#include <perf/cpumap.h>
8
- #include <linux/refcount.h>
9
8
10
9
/** Identify where counts are aggregated, -1 implies not to aggregate. */
11
10
struct aggr_cpu_id {
@@ -37,7 +36,6 @@ struct aggr_cpu_id {
37
36
38
37
/** A collection of aggr_cpu_id values, the "built" version is sorted and uniqued. */
39
38
struct cpu_aggr_map {
40
- refcount_t refcnt ;
41
39
/** Number of valid entries. */
42
40
int nr ;
43
41
/** The entries. */
You can’t perform that action at this time.
0 commit comments