All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf cs-etm: Remove duplicate and incorrect aux size checks
@ 2021-12-08 11:54 ` James Clark
  0 siblings, 0 replies; 16+ messages in thread
From: James Clark @ 2021-12-08 11:54 UTC (permalink / raw)
  To: mathieu.poirier, coresight
  Cc: suzuki.poulose, James Clark, Mike Leach, Leo Yan, John Garry,
	Will Deacon, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-arm-kernel, linux-perf-users, linux-kernel

There are two checks, one is for size when running without admin, but
this one is covered by the driver and reported on in more detail here
(builtin-record.c):

  pr_err("Permission error mapping pages.\n"
         "Consider increasing "
         "/proc/sys/kernel/perf_event_mlock_kb,\n"
         "or try again with a smaller value of -m/--mmap_pages.\n"
         "(current value: %u,%u)\n",

This had the effect of artificially limiting the aux buffer size to a
value smaller than what was allowed because perf_event_mlock_kb wasn't
taken into account.

The second is to check for a power of two, but this is covered here
(evlist.c):

  pr_info("rounding mmap pages size to %s (%lu pages)\n",
          buf, pages);

Signed-off-by: James Clark <james.clark@arm.com>
---
 tools/perf/arch/arm/util/cs-etm.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index 293a23bf8be3..8a3d54a86c9c 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -407,25 +407,6 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
 
 	}
 
-	/* Validate auxtrace_mmap_pages provided by user */
-	if (opts->auxtrace_mmap_pages) {
-		unsigned int max_page = (KiB(128) / page_size);
-		size_t sz = opts->auxtrace_mmap_pages * (size_t)page_size;
-
-		if (!privileged &&
-		    opts->auxtrace_mmap_pages > max_page) {
-			opts->auxtrace_mmap_pages = max_page;
-			pr_err("auxtrace too big, truncating to %d\n",
-			       max_page);
-		}
-
-		if (!is_power_of_2(sz)) {
-			pr_err("Invalid mmap size for %s: must be a power of 2\n",
-			       CORESIGHT_ETM_PMU_NAME);
-			return -EINVAL;
-		}
-	}
-
 	if (opts->auxtrace_snapshot_mode)
 		pr_debug2("%s snapshot size: %zu\n", CORESIGHT_ETM_PMU_NAME,
 			  opts->auxtrace_snapshot_size);
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-12-10 19:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-08 11:54 [PATCH] perf cs-etm: Remove duplicate and incorrect aux size checks James Clark
2021-12-08 11:54 ` James Clark
2021-12-08 13:17 ` Leo Yan
2021-12-08 13:17   ` Leo Yan
2021-12-08 14:08   ` James Clark
2021-12-08 14:08     ` James Clark
2021-12-09 13:44     ` Leo Yan
2021-12-09 13:44       ` Leo Yan
2021-12-09 14:16       ` James Clark
2021-12-09 14:16         ` James Clark
2021-12-10 16:54         ` Mathieu Poirier
2021-12-10 16:54           ` Mathieu Poirier
2021-12-10 17:55           ` Arnaldo Carvalho de Melo
2021-12-10 17:55             ` Arnaldo Carvalho de Melo
2021-12-10 19:03         ` Arnaldo Carvalho de Melo
2021-12-10 19:03           ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.