Skip to contentSkip to conversation

perf record: Move record_opts and other record decls out of perf.h

tip: perf/core tip-bot2 for Arnaldo Carvalho de Melo 1 participant 1 message Aug 27, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

tip-bot2 for Arnaldo Carvalho de Melo

author merge bot Applied
#1 lore raw

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     aeb00b1aeab6dadd72c24f93bea51a46e109c2ba
Gitweb:        https://git.kernel.org/tip/aeb00b1aeab6dadd72c24f93bea51a46e109c2ba
Author:        Arnaldo Carvalho de Melo <[email protected]>
AuthorDate:    Thu, 22 Aug 2019 15:40:29 -03:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Mon, 26 Aug 2019 11:58:22 -03:00

perf record: Move record_opts and other record decls out of perf.h

And into a separate util/record.h, to better isolate things and make sure that those who use record_opts and the other moved declarations are explicitly including the necessary header.

---
 tools/perf/arch/arm/util/cs-etm.c            |  2 +-
 tools/perf/arch/arm64/util/arm-spe.c         |  1 +-
 tools/perf/arch/s390/util/auxtrace.c         |  1 +-
 tools/perf/arch/x86/tests/perf-time-to-tsc.c |  2 +-
 tools/perf/arch/x86/util/intel-bts.c         |  1 +-
 tools/perf/arch/x86/util/intel-pt.c          |  3 +-
 tools/perf/builtin-record.c                  |  4 +-
 tools/perf/builtin-script.c                  |  2 +-
 tools/perf/builtin-stat.c                    |  2 +-
 tools/perf/builtin-trace.c                   |  1 +-
 tools/perf/perf.h                            | 62 +----------------
 tools/perf/tests/backward-ring-buffer.c      |  2 +-
 tools/perf/tests/bpf.c                       |  1 +-
 tools/perf/tests/code-reading.c              |  1 +-
 tools/perf/tests/keep-tracking.c             |  1 +-
 tools/perf/tests/openat-syscall-tp-fields.c  |  3 +-
 tools/perf/tests/perf-record.c               |  2 +-
 tools/perf/tests/switch-tracking.c           |  1 +-
 tools/perf/tests/task-exit.c                 |  1 +-
 tools/perf/util/auxtrace.c                   |  2 +-
 tools/perf/util/bpf-event.c                  |  1 +-
 tools/perf/util/evsel.c                      |  1 +-
 tools/perf/util/kvm-stat.h                   |  2 +-
 tools/perf/util/machine.c                    |  1 +-
 tools/perf/util/machine.h                    |  1 +-
 tools/perf/util/record.c                     |  1 +-
 tools/perf/util/record.h                     | 74 +++++++++++++++++++-
 tools/perf/util/stat.c                       |  1 +-
 tools/perf/util/stat.h                       |  2 +-
 tools/perf/util/top.h                        |  1 +-
 30 files changed, 107 insertions(+), 73 deletions(-)
 create mode 100644 tools/perf/util/record.h
tools/perf/arch/arm/util/cs-etm.c +1 -1
index c73da32..a185dab 100644
@@ -15,7 +15,7 @@
 #include <linux/zalloc.h>
 
 #include "cs-etm.h"
-#include "../../perf.h"
+#include "../../util/record.h"
 #include "../../util/auxtrace.h"
 #include "../../util/cpumap.h"
 #include "../../util/evlist.h"
tools/perf/arch/arm64/util/arm-spe.c +1 -0
index 00915b8..cdd5c0c 100644
@@ -19,6 +19,7 @@
 #include "../../util/pmu.h"
 #include "../../util/debug.h"
 #include "../../util/auxtrace.h"
+#include "../../util/record.h"
 #include "../../util/arm-spe.h"
 
 #define KiB(x) ((x) * 1024)
tools/perf/arch/s390/util/auxtrace.c +1 -0
index cab46f5..f32d7a7 100644
@@ -8,6 +8,7 @@
 #include "../../util/evlist.h"
 #include "../../util/auxtrace.h"
 #include "../../util/evsel.h"
+#include "../../util/record.h"
 
 #define PERF_EVENT_CPUM_SF		0xB0000 /* Event: Basic-sampling */
 #define PERF_EVENT_CPUM_SF_DIAG		0xBD000 /* Event: Combined-sampling */
tools/perf/arch/x86/tests/perf-time-to-tsc.c +2 -0
index 582182d..0277610 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <errno.h>
 #include <inttypes.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <linux/types.h>
@@ -13,6 +14,7 @@
 #include "evsel.h"
 #include "thread_map.h"
 #include "cpumap.h"
+#include "record.h"
 #include "tsc.h"
 #include "tests/tests.h"
 
tools/perf/arch/x86/util/intel-bts.c +1 -0
index 2d5d8a1..1f2cf61 100644
@@ -17,6 +17,7 @@
 #include "../../util/session.h"
 #include "../../util/pmu.h"
 #include "../../util/debug.h"
+#include "../../util/record.h"
 #include "../../util/tsc.h"
 #include "../../util/auxtrace.h"
 #include "../../util/intel-bts.h"
tools/perf/arch/x86/util/intel-pt.c +2 -1
index c72a77a..44cfe72 100644
@@ -13,7 +13,6 @@
 #include <linux/zalloc.h>
 #include <cpuid.h>
 
-#include "../../perf.h"
 #include "../../util/session.h"
 #include "../../util/event.h"
 #include "../../util/evlist.h"
@@ -24,6 +23,8 @@
 #include "../../util/pmu.h"
 #include "../../util/debug.h"
 #include "../../util/auxtrace.h"
+#include "../../util/record.h"
+#include "../../util/target.h"
 #include "../../util/tsc.h"
 #include "../../util/intel-pt.h"
 
tools/perf/builtin-record.c +2 -2
index f71631f..359bb8f 100644
@@ -8,8 +8,6 @@
  */
 #include "builtin.h"
 
-#include "perf.h"
-
 #include "util/build-id.h"
 #include <subcmd/parse-options.h>
 #include "util/parse-events.h"
@@ -22,9 +20,11 @@
 #include "util/evlist.h"
 #include "util/evsel.h"
 #include "util/debug.h"
+#include "util/target.h"
 #include "util/session.h"
 #include "util/tool.h"
 #include "util/symbol.h"
+#include "util/record.h"
 #include "util/cpumap.h"
 #include "util/thread_map.h"
 #include "util/data.h"
tools/perf/builtin-script.c +1 -1
index 9b93dde..ee05621 100644
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "builtin.h"
 
-#include "perf.h"
 #include "util/cache.h"
 #include "util/counts.h"
 #include "util/debug.h"
@@ -51,6 +50,7 @@
 #include <unistd.h>
 #include <subcmd/pager.h>
 #include <perf/evlist.h>
+#include "util/record.h"
 
 #include <linux/ctype.h>
 
tools/perf/builtin-stat.c +1 -1
index 8a4f1a7..6ab13f4 100644
@@ -40,7 +40,6 @@
  *   Jaswinder Singh Rajput <[email protected]>
  */
 
-#include "perf.h"
 #include "builtin.h"
 #include "util/cgroup.h"
 #include <subcmd/parse-options.h>
@@ -62,6 +61,7 @@
 #include "util/tool.h"
 #include "util/string2.h"
 #include "util/metricgroup.h"
+#include "util/target.h"
 #include "util/top.h"
 #include "asm/bug.h"
 
tools/perf/builtin-trace.c +1 -0
index de12625..8ea62fd 100644
@@ -14,6 +14,7 @@
  * http://lwn.net/Articles/415728/ ("Announcing a new utility: 'trace'")
  */
 
+#include "util/record.h"
 #include <traceevent/event-parse.h>
 #include <api/fs/tracing_path.h>
 #include <bpf/bpf.h>
tools/perf/perf.h +0 -62

73 lines not on this page · raw message

tools/perf/tests/backward-ring-buffer.c +1 -1
index 9bdf661..b6f27ef 100644
@@ -4,9 +4,9 @@
  * beginning
  */
 
-#include <perf.h>
 #include <evlist.h>
 #include <sys/prctl.h>
+#include "record.h"
 #include "tests.h"
 #include "debug.h"
 #include <errno.h>
tools/perf/tests/bpf.c +1 -0
index e16f927..9864296 100644
@@ -5,6 +5,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <util/record.h>
 #include <util/util.h>
 #include <util/bpf-loader.h>
 #include <util/evlist.h>
tools/perf/tests/code-reading.c +1 -0
index e45df07..fe671b8 100644
@@ -20,6 +20,7 @@
 #include "map.h"
 #include "symbol.h"
 #include "event.h"
+#include "record.h"
 #include "thread.h"
 
 #include "tests.h"
tools/perf/tests/keep-tracking.c +1 -0
index 0ce5ce3..2af6faf 100644
@@ -8,6 +8,7 @@
 #include "parse-events.h"
 #include "evlist.h"
 #include "evsel.h"
+#include "record.h"
 #include "thread_map.h"
 #include "cpumap.h"
 #include "tests.h"
tools/perf/tests/openat-syscall-tp-fields.c +2 -1
index 9c06130..6249210 100644
@@ -1,12 +1,13 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <stdbool.h>
 #include <linux/err.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include "perf.h"
 #include "evlist.h"
 #include "evsel.h"
 #include "thread_map.h"
+#include "record.h"
 #include "tests.h"
 #include "debug.h"
 #include <errno.h>
tools/perf/tests/perf-record.c +1 -1
index 67b388e..3a205f6 100644
@@ -7,8 +7,8 @@
 #include <sched.h>
 #include "evlist.h"
 #include "evsel.h"
-#include "perf.h"
 #include "debug.h"
+#include "record.h"
 #include "tests.h"
 
 static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t *maskp)
tools/perf/tests/switch-tracking.c +1 -0
index e3cee69..b63f027 100644
@@ -13,6 +13,7 @@
 #include "evsel.h"
 #include "thread_map.h"
 #include "cpumap.h"
+#include "record.h"
 #include "tests.h"
 
 static int spin_sleep(void)
tools/perf/tests/task-exit.c +1 -0
index 4ca38fd..d79a22e 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "evlist.h"
 #include "evsel.h"
+#include "target.h"
 #include "thread_map.h"
 #include "cpumap.h"
 #include "tests.h"
tools/perf/util/auxtrace.c +1 -1
index 094e6ce..12e9b7a 100644
@@ -26,7 +26,6 @@
 #include <linux/list.h>
 #include <linux/zalloc.h>
 
-#include "../perf.h"
 #include "evlist.h"
 #include "dso.h"
 #include "map.h"
@@ -41,6 +40,7 @@
 #include <linux/hash.h>
 
 #include "event.h"
+#include "record.h"
 #include "session.h"
 #include "debug.h"
 #include <subcmd/parse-options.h>
tools/perf/util/bpf-event.c +1 -0
index 5a5dcc6..5c634bc 100644
@@ -14,6 +14,7 @@
 #include "session.h"
 #include "map.h"
 #include "evlist.h"
+#include "record.h"
 
 #define ptr_to_u64(ptr)    ((__u64)(unsigned long)(ptr))
 
tools/perf/util/evsel.c +1 -0
index e983e72..9fadd58 100644
@@ -34,6 +34,7 @@
 #include "thread_map.h"
 #include "target.h"
 #include "perf_regs.h"
+#include "record.h"
 #include "debug.h"
 #include "trace-event.h"
 #include "stat.h"
tools/perf/util/kvm-stat.h +1 -1
index a09c495..4691363 100644
@@ -2,9 +2,9 @@
 #ifndef __PERF_KVM_STAT_H
 #define __PERF_KVM_STAT_H
 
-#include "../perf.h"
 #include "tool.h"
 #include "stat.h"
+#include "record.h"
 
 struct evsel;
 struct evlist;
tools/perf/util/machine.c +1 -0
index 5734460..f7c1a7e 100644
@@ -13,6 +13,7 @@
 #include "symbol.h"
 #include "sort.h"
 #include "strlist.h"
+#include "target.h"
 #include "thread.h"
 #include "vdso.h"
 #include <stdbool.h>
tools/perf/util/machine.h +1 -0
index 8b9d715..7d69119 100644
@@ -14,6 +14,7 @@ struct branch_stack;
 struct evsel;
 struct perf_sample;
 struct symbol;
+struct target;
 struct thread;
 union perf_event;
 
tools/perf/util/record.c +1 -0
index 51bbd07..574507d 100644
@@ -9,6 +9,7 @@
 #include <perf/cpumap.h>
 #include "util.h"
 #include "cloexec.h"
+#include "record.h"
 
 typedef void (*setup_probe_fn_t)(struct evsel *evsel);
 
tools/perf/util/record.h new file +74 -0

74 lines not on this page · raw message

tools/perf/util/stat.c +1 -0
index 0cbfd1e..f985336 100644
@@ -4,6 +4,7 @@
 #include <math.h>
 #include "counts.h"
 #include "stat.h"
+#include "target.h"
 #include "evlist.h"
 #include "evsel.h"
 #include "thread_map.h"
tools/perf/util/stat.h +2 -0
index 9e425ec..14fe3e5 100644
@@ -198,6 +198,8 @@ int perf_stat_process_counter(struct perf_stat_config *config,
 struct perf_tool;
 union perf_event;
 struct perf_session;
+struct target;
+
 int perf_event__process_stat_event(struct perf_session *session,
 				   union perf_event *event);
 
tools/perf/util/top.h +1 -0
index dc4bb6e..7367433 100644
@@ -5,6 +5,7 @@
 #include "tool.h"
 #include "evswitch.h"
 #include "annotate.h"
+#include "record.h"
 #include <linux/types.h>
 #include <stddef.h>
 #include <stdbool.h>