perf util: Move input_name to util
authorIan Rogers <irogers@google.com>
Mon, 10 Apr 2023 16:25:10 +0000 (09:25 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 10 Apr 2023 22:21:31 +0000 (19:21 -0300)
'input_name' is the name of the input perf.data file, it is used by data
convert and ui code. Move it to util to make it more consistent with
other global state.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Chengdong Li <chengdongli@tencent.com>
Cc: Denis Nikitin <denik@chromium.org>
Cc: Florian Fischer <florian.fischer@muhq.space>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Martin Liška <mliska@suse.cz>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Raul Silvera <rsilvera@google.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230410162511.3055900-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
16 files changed:
tools/perf/builtin-annotate.c
tools/perf/builtin-buildid-list.c
tools/perf/builtin-c2c.c
tools/perf/builtin-data.c
tools/perf/builtin-evlist.c
tools/perf/builtin-kmem.c
tools/perf/builtin-kwork.c
tools/perf/builtin-mem.c
tools/perf/builtin-sched.c
tools/perf/builtin-stat.c
tools/perf/builtin-timechart.c
tools/perf/perf.c
tools/perf/perf.h
tools/perf/ui/browsers/hists.c
tools/perf/util/util.c
tools/perf/util/util.h

index 63fd2080b8033f6478e83c882c58d4bd70653f29..63cdf6ea6f6d533a323e1617722104024de2a683 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/zalloc.h>
 #include "util/symbol.h"
 
-#include "perf.h"
 #include "util/debug.h"
 
 #include "util/evlist.h"
@@ -36,6 +35,7 @@
 #include "util/block-range.h"
 #include "util/map_symbol.h"
 #include "util/branch.h"
+#include "util/util.h"
 
 #include <dlfcn.h>
 #include <errno.h>
index eea28cbcc0b7ae6c64d53e1246f73d4c9b2ec1f6..c9037477865a79aa9ad7e6f9df8053e8c3b778ff 100644 (file)
@@ -8,7 +8,6 @@
  * Copyright (C) 2009, Arnaldo Carvalho de Melo <acme@redhat.com>
  */
 #include "builtin.h"
-#include "perf.h"
 #include "util/build-id.h"
 #include "util/debug.h"
 #include "util/dso.h"
@@ -18,6 +17,7 @@
 #include "util/session.h"
 #include "util/symbol.h"
 #include "util/data.h"
+#include "util/util.h"
 #include <errno.h>
 #include <inttypes.h>
 #include <linux/err.h>
index d3181fee4d3da17e94fcef0c053fed6757972671..6c12f08658606e4590c6535668148e7f0cabf5ee 100644 (file)
 #include "symbol.h"
 #include "ui/ui.h"
 #include "ui/progress.h"
-#include "../perf.h"
 #include "pmu.h"
 #include "pmu-hybrid.h"
 #include "string2.h"
+#include "util/util.h"
 
 struct c2c_hists {
        struct hists            hists;
index b2a9a3b7f68d7f6f392bfa6dfd60408efad51dd5..ce51cbf6dc97e6ff12816bdbed18ef3baa8c2cf7 100644 (file)
@@ -3,10 +3,10 @@
 #include <stdio.h>
 #include <string.h>
 #include "builtin.h"
-#include "perf.h"
 #include "debug.h"
 #include <subcmd/parse-options.h>
 #include "data-convert.h"
+#include "util/util.h"
 
 typedef int (*data_cmd_fn_t)(int argc, const char **argv);
 
index b1076177c37ff440db9b82e94e7caf682402879b..7117656939e7f59e7b46730ecf36643462bc511d 100644 (file)
@@ -7,7 +7,6 @@
 
 #include <linux/list.h>
 
-#include "perf.h"
 #include "util/evlist.h"
 #include "util/evsel.h"
 #include "util/evsel_fprintf.h"
@@ -18,6 +17,7 @@
 #include "util/debug.h"
 #include <linux/err.h>
 #include "util/tool.h"
+#include "util/util.h"
 
 static int process_header_feature(struct perf_session *session __maybe_unused,
                                  union perf_event *event __maybe_unused)
index fcd2ef3bd3f51834331223b12e35be06ec959150..2150eeced892c7cae5386f4ca8f19f90ccbe8483 100644 (file)
@@ -1,6 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "builtin.h"
-#include "perf.h"
 
 #include "util/dso.h"
 #include "util/evlist.h"
@@ -24,6 +23,7 @@
 
 #include "util/debug.h"
 #include "util/string2.h"
+#include "util/util.h"
 
 #include <linux/kernel.h>
 #include <linux/numa.h>
index dc59d75180d143ce4a8ef181c2a5e55b9a2f635d..a9395c52b23b7905e06ff4876cc7e19d8929ceb0 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 #include "builtin.h"
-#include "perf.h"
 
 #include "util/data.h"
 #include "util/evlist.h"
@@ -20,6 +19,7 @@
 #include "util/string2.h"
 #include "util/callchain.h"
 #include "util/evsel_fprintf.h"
+#include "util/util.h"
 
 #include <subcmd/pager.h>
 #include <subcmd/parse-options.h>
index 1e27188b0de1583e6d1924de5f9d4d4a9a4a1db7..65465930ef8e4fe5cf7409d516b23c8c3f723794 100644 (file)
@@ -4,7 +4,6 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include "builtin.h"
-#include "perf.h"
 
 #include <subcmd/parse-options.h>
 #include "util/auxtrace.h"
@@ -22,6 +21,7 @@
 #include "util/pmu-hybrid.h"
 #include "util/sample.h"
 #include "util/string2.h"
+#include "util/util.h"
 #include <linux/err.h>
 
 #define MEM_OPERATION_LOAD     0x1
index 86e18575c9beee8eab168a088b716df37066d64d..96a0dceadeffd37802527d3b53a1081660e5b576 100644 (file)
@@ -1,6 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "builtin.h"
-#include "perf.h"
 #include "perf-sys.h"
 
 #include "util/cpumap.h"
@@ -27,6 +26,7 @@
 
 #include "util/debug.h"
 #include "util/event.h"
+#include "util/util.h"
 
 #include <linux/kernel.h>
 #include <linux/log2.h>
index 40770926a2309dcde18daf9905c10093e294e3b1..d3cbee7460fcc48eb558a58379762df8ca02329b 100644 (file)
@@ -41,7 +41,6 @@
  */
 
 #include "builtin.h"
-#include "perf.h"
 #include "util/cgroup.h"
 #include <subcmd/parse-options.h>
 #include "util/parse-events.h"
@@ -71,6 +70,7 @@
 #include "util/bpf_counter.h"
 #include "util/iostat.h"
 #include "util/pmu-hybrid.h"
+#include "util/util.h"
 #include "asm/bug.h"
 
 #include <linux/time64.h>
index 6c629e7d370ad4f1880e674dc7b97e788b22a958..bce1cf896f9c992f2e6e675cf5488d6409cd92b5 100644 (file)
@@ -24,7 +24,6 @@
 #include "util/thread.h"
 #include "util/callchain.h"
 
-#include "perf.h"
 #include "util/header.h"
 #include <subcmd/pager.h>
 #include <subcmd/parse-options.h>
@@ -37,6 +36,7 @@
 #include "util/debug.h"
 #include "util/string2.h"
 #include "util/tracepoint.h"
+#include "util/util.h"
 #include <linux/err.h>
 #include <traceevent/event-parse.h>
 
index 441c354b83046e711e4a81fac8aaa795ea94076e..38cae4721583d1998b0484954fa4b866a773d4cb 100644 (file)
@@ -40,7 +40,6 @@
 #include <linux/zalloc.h>
 
 static int use_pager = -1;
-const char *input_name;
 
 struct cmd_struct {
        const char *cmd;
index 989eb17ec474869ffbada653309ae45d5b8a9d7a..49e15e2be49e43bf14d336a767f1008f47e996d2 100644 (file)
@@ -8,7 +8,6 @@
 #define MAX_NR_CPUS                    2048
 #endif
 
-extern const char *input_name;
 extern bool perf_host, perf_guest;
 
 enum perf_affinity {
index 9f9f622325ae379e425c7a01e9010d9829ab4380..ab70e5f5fad236e5e9ca751872be71eeffa8b467 100644 (file)
@@ -29,8 +29,8 @@
 #include "../../util/top.h"
 #include "../../util/thread.h"
 #include "../../util/block-info.h"
+#include "../../util/util.h"
 #include "../../arch/common.h"
-#include "../../perf.h"
 
 #include "../browsers/hists.h"
 #include "../helpline.h"
index 089208b51e68bcf208c33f98881955fd7e935e09..c1fd9ba6d697dd4319defb15c219cc4d8fc5b874 100644 (file)
@@ -28,6 +28,8 @@
  * XXX We need to find a better place for these things...
  */
 
+const char *input_name;
+
 bool perf_singlethreaded = true;
 
 void perf_set_singlethreaded(void)
index 5010abf9e01e8a15fcd80888ea691771504c698d..8bd515b6773964e892c3339597dd16a741cc3f62 100644 (file)
@@ -18,6 +18,8 @@
 extern const char perf_usage_string[];
 extern const char perf_more_info_string[];
 
+extern const char *input_name;
+
 /* General helper functions */
 void usage(const char *err) __noreturn;
 void die(const char *err, ...) __noreturn __printf(1, 2);