Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf util: Move input_name to util

'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>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
f12ad272 2176f9e2

+16 -14
+1 -1
tools/perf/builtin-annotate.c
··· 15 15 #include <linux/zalloc.h> 16 16 #include "util/symbol.h" 17 17 18 - #include "perf.h" 19 18 #include "util/debug.h" 20 19 21 20 #include "util/evlist.h" ··· 35 36 #include "util/block-range.h" 36 37 #include "util/map_symbol.h" 37 38 #include "util/branch.h" 39 + #include "util/util.h" 38 40 39 41 #include <dlfcn.h> 40 42 #include <errno.h>
+1 -1
tools/perf/builtin-buildid-list.c
··· 8 8 * Copyright (C) 2009, Arnaldo Carvalho de Melo <acme@redhat.com> 9 9 */ 10 10 #include "builtin.h" 11 - #include "perf.h" 12 11 #include "util/build-id.h" 13 12 #include "util/debug.h" 14 13 #include "util/dso.h" ··· 17 18 #include "util/session.h" 18 19 #include "util/symbol.h" 19 20 #include "util/data.h" 21 + #include "util/util.h" 20 22 #include <errno.h> 21 23 #include <inttypes.h> 22 24 #include <linux/err.h>
+1 -1
tools/perf/builtin-c2c.c
··· 41 41 #include "symbol.h" 42 42 #include "ui/ui.h" 43 43 #include "ui/progress.h" 44 - #include "../perf.h" 45 44 #include "pmu.h" 46 45 #include "pmu-hybrid.h" 47 46 #include "string2.h" 47 + #include "util/util.h" 48 48 49 49 struct c2c_hists { 50 50 struct hists hists;
+1 -1
tools/perf/builtin-data.c
··· 3 3 #include <stdio.h> 4 4 #include <string.h> 5 5 #include "builtin.h" 6 - #include "perf.h" 7 6 #include "debug.h" 8 7 #include <subcmd/parse-options.h> 9 8 #include "data-convert.h" 9 + #include "util/util.h" 10 10 11 11 typedef int (*data_cmd_fn_t)(int argc, const char **argv); 12 12
+1 -1
tools/perf/builtin-evlist.c
··· 7 7 8 8 #include <linux/list.h> 9 9 10 - #include "perf.h" 11 10 #include "util/evlist.h" 12 11 #include "util/evsel.h" 13 12 #include "util/evsel_fprintf.h" ··· 17 18 #include "util/debug.h" 18 19 #include <linux/err.h> 19 20 #include "util/tool.h" 21 + #include "util/util.h" 20 22 21 23 static int process_header_feature(struct perf_session *session __maybe_unused, 22 24 union perf_event *event __maybe_unused)
+1 -1
tools/perf/builtin-kmem.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include "builtin.h" 3 - #include "perf.h" 4 3 5 4 #include "util/dso.h" 6 5 #include "util/evlist.h" ··· 23 24 24 25 #include "util/debug.h" 25 26 #include "util/string2.h" 27 + #include "util/util.h" 26 28 27 29 #include <linux/kernel.h> 28 30 #include <linux/numa.h>
+1 -1
tools/perf/builtin-kwork.c
··· 6 6 */ 7 7 8 8 #include "builtin.h" 9 - #include "perf.h" 10 9 11 10 #include "util/data.h" 12 11 #include "util/evlist.h" ··· 19 20 #include "util/string2.h" 20 21 #include "util/callchain.h" 21 22 #include "util/evsel_fprintf.h" 23 + #include "util/util.h" 22 24 23 25 #include <subcmd/pager.h> 24 26 #include <subcmd/parse-options.h>
+1 -1
tools/perf/builtin-mem.c
··· 4 4 #include <sys/stat.h> 5 5 #include <unistd.h> 6 6 #include "builtin.h" 7 - #include "perf.h" 8 7 9 8 #include <subcmd/parse-options.h> 10 9 #include "util/auxtrace.h" ··· 21 22 #include "util/pmu-hybrid.h" 22 23 #include "util/sample.h" 23 24 #include "util/string2.h" 25 + #include "util/util.h" 24 26 #include <linux/err.h> 25 27 26 28 #define MEM_OPERATION_LOAD 0x1
+1 -1
tools/perf/builtin-sched.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include "builtin.h" 3 - #include "perf.h" 4 3 #include "perf-sys.h" 5 4 6 5 #include "util/cpumap.h" ··· 26 27 27 28 #include "util/debug.h" 28 29 #include "util/event.h" 30 + #include "util/util.h" 29 31 30 32 #include <linux/kernel.h> 31 33 #include <linux/log2.h>
+1 -1
tools/perf/builtin-stat.c
··· 41 41 */ 42 42 43 43 #include "builtin.h" 44 - #include "perf.h" 45 44 #include "util/cgroup.h" 46 45 #include <subcmd/parse-options.h> 47 46 #include "util/parse-events.h" ··· 70 71 #include "util/bpf_counter.h" 71 72 #include "util/iostat.h" 72 73 #include "util/pmu-hybrid.h" 74 + #include "util/util.h" 73 75 #include "asm/bug.h" 74 76 75 77 #include <linux/time64.h>
+1 -1
tools/perf/builtin-timechart.c
··· 24 24 #include "util/thread.h" 25 25 #include "util/callchain.h" 26 26 27 - #include "perf.h" 28 27 #include "util/header.h" 29 28 #include <subcmd/pager.h> 30 29 #include <subcmd/parse-options.h> ··· 36 37 #include "util/debug.h" 37 38 #include "util/string2.h" 38 39 #include "util/tracepoint.h" 40 + #include "util/util.h" 39 41 #include <linux/err.h> 40 42 #include <traceevent/event-parse.h> 41 43
-1
tools/perf/perf.c
··· 40 40 #include <linux/zalloc.h> 41 41 42 42 static int use_pager = -1; 43 - const char *input_name; 44 43 45 44 struct cmd_struct { 46 45 const char *cmd;
-1
tools/perf/perf.h
··· 8 8 #define MAX_NR_CPUS 2048 9 9 #endif 10 10 11 - extern const char *input_name; 12 11 extern bool perf_host, perf_guest; 13 12 14 13 enum perf_affinity {
+1 -1
tools/perf/ui/browsers/hists.c
··· 29 29 #include "../../util/top.h" 30 30 #include "../../util/thread.h" 31 31 #include "../../util/block-info.h" 32 + #include "../../util/util.h" 32 33 #include "../../arch/common.h" 33 - #include "../../perf.h" 34 34 35 35 #include "../browsers/hists.h" 36 36 #include "../helpline.h"
+2
tools/perf/util/util.c
··· 28 28 * XXX We need to find a better place for these things... 29 29 */ 30 30 31 + const char *input_name; 32 + 31 33 bool perf_singlethreaded = true; 32 34 33 35 void perf_set_singlethreaded(void)
+2
tools/perf/util/util.h
··· 18 18 extern const char perf_usage_string[]; 19 19 extern const char perf_more_info_string[]; 20 20 21 + extern const char *input_name; 22 + 21 23 /* General helper functions */ 22 24 void usage(const char *err) __noreturn; 23 25 void die(const char *err, ...) __noreturn __printf(1, 2);