lkml.org 
[lkml]   [2023]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 1/7] perf evlist: Add perf_evlist__go_system_wide() helper
From
On 4/08/23 05:07, Yang Jihong wrote:
> For dummy events that keep tracking, we may need to modify its cpu_maps.
> For example, change the cpu_maps to record sideband events for all CPUS.
> Add perf_evlist__go_system_wide() helper to support this scenario.
>
> Signed-off-by: Yang Jihong <yangjihong1@huawei.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
> tools/lib/perf/evlist.c | 9 +++++++++
> tools/lib/perf/include/internal/evlist.h | 2 ++
> 2 files changed, 11 insertions(+)
>
> diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c
> index b8b066d0dc5e..3acbbccc1901 100644
> --- a/tools/lib/perf/evlist.c
> +++ b/tools/lib/perf/evlist.c
> @@ -738,3 +738,12 @@ int perf_evlist__nr_groups(struct perf_evlist *evlist)
> }
> return nr_groups;
> }
> +
> +void perf_evlist__go_system_wide(struct perf_evlist *evlist, struct perf_evsel *evsel)
> +{
> + if (!evsel->system_wide) {
> + evsel->system_wide = true;
> + if (evlist->needs_map_propagation)
> + __perf_evlist__propagate_maps(evlist, evsel);
> + }
> +}
> diff --git a/tools/lib/perf/include/internal/evlist.h b/tools/lib/perf/include/internal/evlist.h
> index 3339bc2f1765..d86ffe8ed483 100644
> --- a/tools/lib/perf/include/internal/evlist.h
> +++ b/tools/lib/perf/include/internal/evlist.h
> @@ -135,4 +135,6 @@ int perf_evlist__id_add_fd(struct perf_evlist *evlist,
> void perf_evlist__reset_id_hash(struct perf_evlist *evlist);
>
> void __perf_evlist__set_leader(struct list_head *list, struct perf_evsel *leader);
> +
> +void perf_evlist__go_system_wide(struct perf_evlist *evlist, struct perf_evsel *evsel);
> #endif /* __LIBPERF_INTERNAL_EVLIST_H */

\
 
 \ /
  Last update: 2023-08-04 08:58    [W:0.121 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site