summaryrefslogtreecommitdiff
path: root/tools/perf/util/data-convert-json.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2023-08-30 16:06:38 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2023-08-30 16:06:38 -0700
commit1ac731c529cd4d6adbce134754b51ff7d822b145 (patch)
tree143ab3f35ca5f3b69f583c84e6964b17139c2ec1 /tools/perf/util/data-convert-json.c
parent07b4c950f27bef0362dc6ad7ee713aab61d58149 (diff)
parent54116d442e001e1b6bd482122043b1870998a1f3 (diff)
Merge branch 'next' into for-linus
Prepare input updates for 6.6 merge window.
Diffstat (limited to 'tools/perf/util/data-convert-json.c')
-rw-r--r--tools/perf/util/data-convert-json.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/perf/util/data-convert-json.c b/tools/perf/util/data-convert-json.c
index ba9d93ce9463..653709ab867a 100644
--- a/tools/perf/util/data-convert-json.c
+++ b/tools/perf/util/data-convert-json.c
@@ -128,15 +128,17 @@ static void output_sample_callchain_entry(struct perf_tool *tool,
output_json_key_format(out, false, 5, "ip", "\"0x%" PRIx64 "\"", ip);
if (al && al->sym && al->sym->namelen) {
+ struct dso *dso = al->map ? map__dso(al->map) : NULL;
+
fputc(',', out);
output_json_key_string(out, false, 5, "symbol", al->sym->name);
- if (al->map && al->map->dso) {
- const char *dso = al->map->dso->short_name;
+ if (dso) {
+ const char *dso_name = dso->short_name;
- if (dso && strlen(dso) > 0) {
+ if (dso_name && strlen(dso_name) > 0) {
fputc(',', out);
- output_json_key_string(out, false, 5, "dso", dso);
+ output_json_key_string(out, false, 5, "dso", dso_name);
}
}
}