File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 2626
2727void perf_evlist__init (struct perf_evlist * evlist )
2828{
29- int i ;
30-
31- for (i = 0 ; i < PERF_EVLIST__HLIST_SIZE ; ++ i )
32- INIT_HLIST_HEAD (& evlist -> heads [i ]);
3329 INIT_LIST_HEAD (& evlist -> entries );
3430 evlist -> nr_entries = 0 ;
3531 fdarray__init (& evlist -> pollfd , 64 );
32+ perf_evlist__reset_id_hash (evlist );
3633}
3734
3835static void __perf_evlist__propagate_maps (struct perf_evlist * evlist ,
@@ -237,6 +234,14 @@ static void perf_evlist__id_hash(struct perf_evlist *evlist,
237234 hlist_add_head (& sid -> node , & evlist -> heads [hash ]);
238235}
239236
237+ void perf_evlist__reset_id_hash (struct perf_evlist * evlist )
238+ {
239+ int i ;
240+
241+ for (i = 0 ; i < PERF_EVLIST__HLIST_SIZE ; ++ i )
242+ INIT_HLIST_HEAD (& evlist -> heads [i ]);
243+ }
244+
240245void perf_evlist__id_add (struct perf_evlist * evlist ,
241246 struct perf_evsel * evsel ,
242247 int cpu , int thread , u64 id )
Original file line number Diff line number Diff line change @@ -124,4 +124,6 @@ int perf_evlist__id_add_fd(struct perf_evlist *evlist,
124124 struct perf_evsel * evsel ,
125125 int cpu , int thread , int fd );
126126
127+ void perf_evlist__reset_id_hash (struct perf_evlist * evlist );
128+
127129#endif /* __LIBPERF_INTERNAL_EVLIST_H */
You can’t perform that action at this time.
0 commit comments