perf evsel: Move config terms to a separate header
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 24 Sep 2019 18:56:14 +0000 (15:56 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 25 Sep 2019 19:26:40 +0000 (16:26 -0300)
Further reducing the size of util/evsel.h.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-20zr7di9eynm0272mtjfdhfc@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/arm/util/cs-etm.c
tools/perf/builtin-top.c
tools/perf/util/evsel.c
tools/perf/util/evsel.h
tools/perf/util/evsel_config.h [new file with mode: 0644]
tools/perf/util/parse-events.c

index 2e4de211d8813a58a3a5c2e7e639c1469f9b1375..ede040cf82ad8dfc9bfbfa98e485e74fceefb1cd 100644 (file)
@@ -23,6 +23,7 @@
 #include "../../util/event.h"
 #include "../../util/evlist.h"
 #include "../../util/evsel.h"
+#include "../../util/evsel_config.h"
 #include "../../util/pmu.h"
 #include "../../util/cs-etm.h"
 #include <internal/lib.h> // page_size
index 30d8eb614377dee456236b6d7d49e964ce1f34fc..1f60124eb19bb4e722f22323bcb46d0c27491800 100644 (file)
@@ -27,6 +27,7 @@
 #include "util/dso.h"
 #include "util/evlist.h"
 #include "util/evsel.h"
+#include "util/evsel_config.h"
 #include "util/event.h"
 #include "util/machine.h"
 #include "util/map.h"
index 6323b0c60f6cb8bf1ae3e4e57451d065ad11c247..5591af81a070653f27ba6b23d8687128155c1396 100644 (file)
@@ -30,6 +30,7 @@
 #include "counts.h"
 #include "event.h"
 #include "evsel.h"
+#include "util/evsel_config.h"
 #include "util/evsel_fprintf.h"
 #include "evlist.h"
 #include <perf/cpumap.h>
index 48183b5f5f83c112c1cc1a2bb2a8d0e2da49f898..ddc5ee6f6592bed23532aff20f75c7a76db53361 100644 (file)
 #include "symbol_conf.h"
 #include <internal/cpumap.h>
 
-/*
- * The 'struct perf_evsel_config_term' is used to pass event
- * specific configuration data to perf_evsel__config routine.
- * It is allocated within event parsing and attached to
- * perf_evsel::config_terms list head.
-*/
-enum term_type {
-       PERF_EVSEL__CONFIG_TERM_PERIOD,
-       PERF_EVSEL__CONFIG_TERM_FREQ,
-       PERF_EVSEL__CONFIG_TERM_TIME,
-       PERF_EVSEL__CONFIG_TERM_CALLGRAPH,
-       PERF_EVSEL__CONFIG_TERM_STACK_USER,
-       PERF_EVSEL__CONFIG_TERM_INHERIT,
-       PERF_EVSEL__CONFIG_TERM_MAX_STACK,
-       PERF_EVSEL__CONFIG_TERM_MAX_EVENTS,
-       PERF_EVSEL__CONFIG_TERM_OVERWRITE,
-       PERF_EVSEL__CONFIG_TERM_DRV_CFG,
-       PERF_EVSEL__CONFIG_TERM_BRANCH,
-       PERF_EVSEL__CONFIG_TERM_PERCORE,
-       PERF_EVSEL__CONFIG_TERM_AUX_OUTPUT,
-};
-
-struct perf_evsel_config_term {
-       struct list_head        list;
-       enum term_type  type;
-       union {
-               u64     period;
-               u64     freq;
-               bool    time;
-               char    *callgraph;
-               char    *drv_cfg;
-               u64     stack_user;
-               int     max_stack;
-               bool    inherit;
-               bool    overwrite;
-               char    *branch;
-               unsigned long max_events;
-               bool    percore;
-               bool    aux_output;
-       } val;
-       bool weak;
-};
-
 struct bpf_object;
 struct cgroup;
 struct perf_counts;
diff --git a/tools/perf/util/evsel_config.h b/tools/perf/util/evsel_config.h
new file mode 100644 (file)
index 0000000..8a76480
--- /dev/null
@@ -0,0 +1,50 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef __PERF_EVSEL_CONFIG_H
+#define __PERF_EVSEL_CONFIG_H 1
+
+#include <linux/types.h>
+#include <stdbool.h>
+
+/*
+ * The 'struct perf_evsel_config_term' is used to pass event
+ * specific configuration data to perf_evsel__config routine.
+ * It is allocated within event parsing and attached to
+ * perf_evsel::config_terms list head.
+*/
+enum evsel_term_type {
+       PERF_EVSEL__CONFIG_TERM_PERIOD,
+       PERF_EVSEL__CONFIG_TERM_FREQ,
+       PERF_EVSEL__CONFIG_TERM_TIME,
+       PERF_EVSEL__CONFIG_TERM_CALLGRAPH,
+       PERF_EVSEL__CONFIG_TERM_STACK_USER,
+       PERF_EVSEL__CONFIG_TERM_INHERIT,
+       PERF_EVSEL__CONFIG_TERM_MAX_STACK,
+       PERF_EVSEL__CONFIG_TERM_MAX_EVENTS,
+       PERF_EVSEL__CONFIG_TERM_OVERWRITE,
+       PERF_EVSEL__CONFIG_TERM_DRV_CFG,
+       PERF_EVSEL__CONFIG_TERM_BRANCH,
+       PERF_EVSEL__CONFIG_TERM_PERCORE,
+       PERF_EVSEL__CONFIG_TERM_AUX_OUTPUT,
+};
+
+struct perf_evsel_config_term {
+       struct list_head      list;
+       enum evsel_term_type  type;
+       union {
+               u64           period;
+               u64           freq;
+               bool          time;
+               char          *callgraph;
+               char          *drv_cfg;
+               u64           stack_user;
+               int           max_stack;
+               bool          inherit;
+               bool          overwrite;
+               char          *branch;
+               unsigned long max_events;
+               bool          percore;
+               bool          aux_output;
+       } val;
+       bool weak;
+};
+#endif // __PERF_EVSEL_CONFIG_H
index d69ff746cda5e3c143bd1e73e90c2aebebd121ca..50737046fa63ff60c77dabe67b922cb1306902ef 100644 (file)
@@ -34,6 +34,7 @@
 #include "asm/bug.h"
 #include "util/parse-branch-options.h"
 #include "metricgroup.h"
+#include "util/evsel_config.h"
 #include "util/mmap.h"
 
 #define MAX_NAME_LEN 100