[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221215192817.2734573-2-namhyung@kernel.org>
Date: Thu, 15 Dec 2022 11:28:09 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-perf-users@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>,
Milian Wolff <milian.wolff@...b.com>,
Leo Yan <leo.yan@...aro.org>
Subject: [PATCH 1/9] perf srcline: Do not return NULL for srcline
The code assumes non-NULL srcline value always, let's return the usual
SRCLINE_UNKNOWN ("??:0") string instead.
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
tools/perf/util/srcline.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index af468e3bb6fa..5319efb16a5a 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -716,7 +716,7 @@ char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
if (!show_addr)
return (show_sym && sym) ?
- strndup(sym->name, sym->namelen) : NULL;
+ strndup(sym->name, sym->namelen) : SRCLINE_UNKNOWN;
if (sym) {
if (asprintf(&srcline, "%s+%" PRIu64, show_sym ? sym->name : "",
--
2.39.0.314.g84b9a713c41-goog
Powered by blists - more mailing lists