All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: Setup initial evlist::all_cpus value
@ 2020-01-10 15:15 Jiri Olsa
  2020-01-10 17:31 ` Andi Kleen
  2020-01-20  8:27 ` [tip: perf/core] libperf: " tip-bot2 for Jiri Olsa
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Olsa @ 2020-01-10 15:15 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jann Horn, lkml, Ingo Molnar, Namhyung Kim, Alexander Shishkin,
	Peter Zijlstra, Michael Petlan, Andi Kleen

Jann Horn reported crash in perf ftrace because evlist::all_cpus
isn't initialized if there's evlist without events, which is the
case for perf ftrace.

Adding initial initialization of evlist::all_cpus from given cpus,
regardless of events in the evlist.

Reported-by: Jann Horn <jannh@google.com>
Link: https://lkml.kernel.org/n/tip-kzioebqr5c3u4t7tafju8pbx@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/lib/perf/evlist.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c
index ae9e65aa2491..5b9f2ca50591 100644
--- a/tools/lib/perf/evlist.c
+++ b/tools/lib/perf/evlist.c
@@ -164,6 +164,9 @@ void perf_evlist__set_maps(struct perf_evlist *evlist,
 		evlist->threads = perf_thread_map__get(threads);
 	}
 
+	if (!evlist->all_cpus && cpus)
+		evlist->all_cpus = perf_cpu_map__get(cpus);
+
 	perf_evlist__propagate_maps(evlist);
 }
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf tools: Setup initial evlist::all_cpus value
  2020-01-10 15:15 [PATCH] perf tools: Setup initial evlist::all_cpus value Jiri Olsa
@ 2020-01-10 17:31 ` Andi Kleen
  2020-01-20  8:27 ` [tip: perf/core] libperf: " tip-bot2 for Jiri Olsa
  1 sibling, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2020-01-10 17:31 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaldo Carvalho de Melo, Jann Horn, lkml, Ingo Molnar,
	Namhyung Kim, Alexander Shishkin, Peter Zijlstra, Michael Petlan

On Fri, Jan 10, 2020 at 04:15:37PM +0100, Jiri Olsa wrote:
> Jann Horn reported crash in perf ftrace because evlist::all_cpus
> isn't initialized if there's evlist without events, which is the
> case for perf ftrace.
> 
> Adding initial initialization of evlist::all_cpus from given cpus,
> regardless of events in the evlist.

Acked-by: Andi Kleen <ak@linux.intel.com>

> 
> Reported-by: Jann Horn <jannh@google.com>
> Link: https://lkml.kernel.org/n/tip-kzioebqr5c3u4t7tafju8pbx@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/lib/perf/evlist.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c
> index ae9e65aa2491..5b9f2ca50591 100644
> --- a/tools/lib/perf/evlist.c
> +++ b/tools/lib/perf/evlist.c
> @@ -164,6 +164,9 @@ void perf_evlist__set_maps(struct perf_evlist *evlist,
>  		evlist->threads = perf_thread_map__get(threads);
>  	}
>  
> +	if (!evlist->all_cpus && cpus)
> +		evlist->all_cpus = perf_cpu_map__get(cpus);
> +
>  	perf_evlist__propagate_maps(evlist);
>  }
>  
> -- 
> 2.24.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: perf/core] libperf: Setup initial evlist::all_cpus value
  2020-01-10 15:15 [PATCH] perf tools: Setup initial evlist::all_cpus value Jiri Olsa
  2020-01-10 17:31 ` Andi Kleen
@ 2020-01-20  8:27 ` tip-bot2 for Jiri Olsa
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Jiri Olsa @ 2020-01-20  8:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Jann Horn, Jiri Olsa, Andi Kleen, Alexander Shishkin,
	Michael Petlan, Namhyung Kim, Peter Zijlstra,
	Arnaldo Carvalho de Melo, x86, LKML

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     cb71f7d43ece3d5a4f400f510c61b2ec7c9ce9a1
Gitweb:        https://git.kernel.org/tip/cb71f7d43ece3d5a4f400f510c61b2ec7c9ce9a1
Author:        Jiri Olsa <jolsa@kernel.org>
AuthorDate:    Fri, 10 Jan 2020 16:15:37 +01:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Tue, 14 Jan 2020 12:02:19 -03:00

libperf: Setup initial evlist::all_cpus value

Jann Horn reported crash in perf ftrace because evlist::all_cpus isn't
initialized if there's evlist without events, which is the case for perf
ftrace.

Adding initial initialization of evlist::all_cpus from given cpus,
regardless of events in the evlist.

Fixes: 7736627b865d ("perf stat: Use affinity for closing file descriptors")
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Andi Kleen <ak@linux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20200110151537.153012-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/perf/evlist.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c
index ae9e65a..5b9f2ca 100644
--- a/tools/lib/perf/evlist.c
+++ b/tools/lib/perf/evlist.c
@@ -164,6 +164,9 @@ void perf_evlist__set_maps(struct perf_evlist *evlist,
 		evlist->threads = perf_thread_map__get(threads);
 	}
 
+	if (!evlist->all_cpus && cpus)
+		evlist->all_cpus = perf_cpu_map__get(cpus);
+
 	perf_evlist__propagate_maps(evlist);
 }
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-20  8:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-10 15:15 [PATCH] perf tools: Setup initial evlist::all_cpus value Jiri Olsa
2020-01-10 17:31 ` Andi Kleen
2020-01-20  8:27 ` [tip: perf/core] libperf: " tip-bot2 for Jiri Olsa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.