[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251029053413.355154-9-irogers@google.com>
Date: Tue, 28 Oct 2025 22:34:06 -0700
From: Ian Rogers <irogers@...gle.com>
To: Suzuki K Poulose <suzuki.poulose@....com>, Mike Leach <mike.leach@...aro.org>,
James Clark <james.clark@...aro.org>, John Garry <john.g.garry@...cle.com>,
Will Deacon <will@...nel.org>, Leo Yan <leo.yan@...ux.dev>,
Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Charlie Jenkins <charlie@...osinc.com>,
Thomas Falcon <thomas.falcon@...el.com>, Yicong Yang <yangyicong@...ilicon.com>,
Thomas Richter <tmricht@...ux.ibm.com>, Athira Rajeev <atrajeev@...ux.ibm.com>,
Howard Chu <howardchu95@...il.com>, Song Liu <song@...nel.org>,
Dapeng Mi <dapeng1.mi@...ux.intel.com>, Levi Yun <yeoreum.yun@....com>,
Zhongqiu Han <quic_zhonhan@...cinc.com>, Blake Jones <blakejones@...gle.com>,
Anubhav Shelat <ashelat@...hat.com>, Chun-Tse Shao <ctshao@...gle.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Jean-Philippe Romain <jean-philippe.romain@...s.st.com>, Gautam Menghani <gautam@...ux.ibm.com>,
Dmitry Vyukov <dvyukov@...gle.com>, Yang Li <yang.lee@...ux.alibaba.com>,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
Andi Kleen <ak@...ux.intel.com>, Weilin Wang <weilin.wang@...el.com>
Subject: [RFC PATCH v1 08/15] perf maps: Move getting debug_file to verbose path
Getting debug_file can trigger warnings if not set. Avoid getting
these warnings by pushing the use under the controlling if.
Signed-off-by: Ian Rogers <irogers@...gle.com>
---
tools/perf/util/maps.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/tools/perf/util/maps.c b/tools/perf/util/maps.c
index 779f6230130a..44cfd63f10dc 100644
--- a/tools/perf/util/maps.c
+++ b/tools/perf/util/maps.c
@@ -811,7 +811,6 @@ static int __maps__insert_sorted(struct maps *maps, unsigned int first_after_ind
static int __maps__fixup_overlap_and_insert(struct maps *maps, struct map *new)
{
int err = 0;
- FILE *fp = debug_file();
unsigned int i, ni = INT_MAX; // Some gcc complain, but depends on maps_by_name...
if (!maps__maps_by_address_sorted(maps))
@@ -839,8 +838,8 @@ static int __maps__fixup_overlap_and_insert(struct maps *maps, struct map *new)
dso__name(map__dso(new)));
} else if (verbose >= 2) {
pr_debug("overlapping maps:\n");
- map__fprintf(new, fp);
- map__fprintf(pos, fp);
+ map__fprintf(new, debug_file());
+ map__fprintf(pos, debug_file());
}
if (maps_by_name)
@@ -861,7 +860,7 @@ static int __maps__fixup_overlap_and_insert(struct maps *maps, struct map *new)
map__set_end(before, map__start(new));
if (verbose >= 2 && !use_browser)
- map__fprintf(before, fp);
+ map__fprintf(before, debug_file());
}
if (map__end(new) < map__end(pos)) {
/* The new map isn't as long as the existing map. */
@@ -879,7 +878,7 @@ static int __maps__fixup_overlap_and_insert(struct maps *maps, struct map *new)
map__map_ip(after, map__end(new)));
if (verbose >= 2 && !use_browser)
- map__fprintf(after, fp);
+ map__fprintf(after, debug_file());
}
/*
* If adding one entry, for `before` or `after`, we can replace
--
2.51.1.851.g4ebd6896fd-goog
Powered by blists - more mailing lists