]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Drop perf-record-add-a-function-to-test-for-kernel-suppor.patch
authorSasha Levin <sashal@kernel.org>
Sun, 29 Dec 2019 13:51:20 +0000 (08:51 -0500)
committerSasha Levin <sashal@kernel.org>
Sun, 29 Dec 2019 14:04:51 +0000 (09:04 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.4/perf-record-add-a-function-to-test-for-kernel-suppor.patch [deleted file]
queue-5.4/series

diff --git a/queue-5.4/perf-record-add-a-function-to-test-for-kernel-suppor.patch b/queue-5.4/perf-record-add-a-function-to-test-for-kernel-suppor.patch
deleted file mode 100644 (file)
index 169f1e5..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-From a7b6666fa92b16665b467558ed81142524ac3d30 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 15 Nov 2019 14:42:13 +0200
-Subject: perf record: Add a function to test for kernel support for AUX area
- sampling
-
-From: Adrian Hunter <adrian.hunter@intel.com>
-
-[ Upstream commit 9bca1a4ef5034f0a82861ac0375eb0272c5ce04e ]
-
-Architectures are expected to know if AUX area sampling is supported by
-the hardware. Add a function perf_can_aux_sample() which will determine
-whether the kernel supports it.
-
-Committer notes:
-
-I reported that this message was taking place on a kernel without the
-required bits:
-
-  # perf record --aux-sample -e '{intel_pt//u,branch-misses:u}'
-  Error:
-  The sys_perf_event_open() syscall returned with 7 (Argument list too long) for event (branch-misses:u).
-  /bin/dmesg | grep -i perf may provide additional information.
-
-Adrian sent a patch addressing it, with this explanation:
-
- ----
-  perf_can_aux_sample_size() always returned true because it did not pass
-  the attribute size to sys_perf_event_open, nor correctly check the
-  return value and errno.
- ----
-
-After applying it I get, later in the series, when --aux-sample is
-added:
-
-  # perf record --aux-sample -e '{intel_pt//u,branch-misses:u}'
-  AUX area sampling is not supported by kernel
-
-Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
-Cc: Jiri Olsa <jolsa@redhat.com>
-Link: http://lore.kernel.org/lkml/20191115124225.5247-4-adrian.hunter@intel.com
-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/perf/util/evlist.h |  1 +
- tools/perf/util/record.c | 31 +++++++++++++++++++++++++++++++
- 2 files changed, 32 insertions(+)
-
-diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
-index 7cfe75522ba5..d89e72bd1c81 100644
---- a/tools/perf/util/evlist.h
-+++ b/tools/perf/util/evlist.h
-@@ -164,6 +164,7 @@ void perf_evlist__set_id_pos(struct evlist *evlist);
- bool perf_can_sample_identifier(void);
- bool perf_can_record_switch_events(void);
- bool perf_can_record_cpu_wide(void);
-+bool perf_can_aux_sample(void);
- void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
-                        struct callchain_param *callchain);
- int record_opts__config(struct record_opts *opts);
-diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c
-index 8579505c29a4..7def66168503 100644
---- a/tools/perf/util/record.c
-+++ b/tools/perf/util/record.c
-@@ -136,6 +136,37 @@ bool perf_can_record_cpu_wide(void)
-       return true;
- }
-+/*
-+ * Architectures are expected to know if AUX area sampling is supported by the
-+ * hardware. Here we check for kernel support.
-+ */
-+bool perf_can_aux_sample(void)
-+{
-+      struct perf_event_attr attr = {
-+              .size = sizeof(struct perf_event_attr),
-+              .exclude_kernel = 1,
-+              /*
-+               * Non-zero value causes the kernel to calculate the effective
-+               * attribute size up to that byte.
-+               */
-+              .aux_sample_size = 1,
-+      };
-+      int fd;
-+
-+      fd = sys_perf_event_open(&attr, -1, 0, -1, 0);
-+      /*
-+       * If the kernel attribute is big enough to contain aux_sample_size
-+       * then we assume that it is supported. We are relying on the kernel to
-+       * validate the attribute size before anything else that could be wrong.
-+       */
-+      if (fd < 0 && errno == E2BIG)
-+              return false;
-+      if (fd >= 0)
-+              close(fd);
-+
-+      return true;
-+}
-+
- void perf_evlist__config(struct evlist *evlist, struct record_opts *opts,
-                        struct callchain_param *callchain)
- {
--- 
-2.20.1
-
index aaf2f601eff0d97224e66bc8545fa23881d488d9..e22c4a4294972e1c814cadb71724bc25d7d5feee 100644 (file)
@@ -350,7 +350,6 @@ mips-fix-build-when-48-bits-virtual-memory-is-enable.patch
 drm-amdgpu-fix-bad-dma-from-interrupt_cntl2.patch
 ice-only-disable-vf-state-when-freeing-each-vf-resou.patch
 ice-fix-setting-coalesce-to-handle-dcb-configuration.patch
-perf-record-add-a-function-to-test-for-kernel-suppor.patch
 net-phy-initialise-phydev-speed-and-duplex-sanely.patch
 tools-bpf-fix-build-for-make-s-tools-bpf-o-dir.patch
 rdma-bnxt_re-fix-missing-le16_to_cpu.patch