All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf evsel: Make evsel__env always return a valid env
@ 2021-10-04 21:41 Kim Phillips
  2021-10-04 21:41 ` [PATCH 2/2] perf tools: Improve IBS error handling Kim Phillips
  2021-11-23  8:26 ` [PATCH 1/2] perf evsel: Make evsel__env always return a valid env kajoljain
  0 siblings, 2 replies; 13+ messages in thread
From: Kim Phillips @ 2021-10-04 21:41 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, kim.phillips
  Cc: linux-kernel, linux-perf-users, Alexander Shishkin,
	Boris Ostrovsky, Ian Rogers, Ingo Molnar, Jiri Olsa, Joao Martins,
	Konrad Rzeszutek Wilk, Mark Rutland, Michael Petlan, Namhyung Kim,
	Peter Zijlstra, Robert Richter, Stephane Eranian

It's possible to have an evsel and evsel->evlist populated without
an evsel->evlist->env, when, e.g., cmd_record is in its error path.

Future patches will add support for evsel__open_strerror to be able
to customize error messaging based on perf_env__{arch,cpuid}, so
let's have evsel__env return &perf_env instead of NULL in that case.

Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/util/evsel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index dbfeceb2546c..b915840690d4 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2857,7 +2857,7 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target,
 
 struct perf_env *evsel__env(struct evsel *evsel)
 {
-	if (evsel && evsel->evlist)
+	if (evsel && evsel->evlist && evsel->evlist->env)
 		return evsel->evlist->env;
 	return &perf_env;
 }
-- 
2.31.1


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

end of thread, other threads:[~2022-03-22 21:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-04 21:41 [PATCH 1/2] perf evsel: Make evsel__env always return a valid env Kim Phillips
2021-10-04 21:41 ` [PATCH 2/2] perf tools: Improve IBS error handling Kim Phillips
2021-10-07 17:28   ` Jiri Olsa
2021-10-07 19:17     ` Kim Phillips
2021-11-18 22:45       ` Kim Phillips
2021-11-23  8:40       ` kajoljain
2021-11-23 15:25         ` Kim Phillips
2021-11-24  8:00           ` kajoljain
2021-11-29 22:09             ` Kim Phillips
2021-12-08  6:33               ` kajoljain
2021-12-08 17:14                 ` Kim Phillips
2021-11-23  8:26 ` [PATCH 1/2] perf evsel: Make evsel__env always return a valid env kajoljain
2022-03-22 21:36   ` Arnaldo Carvalho de Melo

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.