]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
coresight: Move struct coresight_trace_id_map to common header
authorJames Clark <james.clark@arm.com>
Mon, 22 Jul 2024 10:11:53 +0000 (11:11 +0100)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 20 Aug 2024 14:02:37 +0000 (15:02 +0100)
The trace ID maps will need to be created and stored by the core and
Perf code so move the definition up to the common header.

Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: James Clark <james.clark@arm.com>
Tested-by: Leo Yan <leo.yan@arm.com>
Tested-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
Signed-off-by: James Clark <james.clark@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20240722101202.26915-12-james.clark@linaro.org
drivers/hwtracing/coresight/coresight-trace-id.c
drivers/hwtracing/coresight/coresight-trace-id.h
include/linux/coresight.h

index af5b4ef59ceab83a1a3e18239f370307e53660e3..19005b5b4dc41e4479ec487155c8b0d34386f17f 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright (c) 2022, Linaro Limited, All rights reserved.
  * Author: Mike Leach <mike.leach@linaro.org>
  */
+#include <linux/coresight.h>
 #include <linux/coresight-pmu.h>
 #include <linux/cpumask.h>
 #include <linux/kernel.h>
index 3797777d367e6fb9ad18a43b9ce07d411fb115ee..49438a96fcc6eb562c5c2471f47220cfd25cb9e8 100644 (file)
 #include <linux/bitops.h>
 #include <linux/types.h>
 
-
-/* architecturally we have 128 IDs some of which are reserved */
-#define CORESIGHT_TRACE_IDS_MAX 128
-
 /* ID 0 is reserved */
 #define CORESIGHT_TRACE_ID_RES_0 0
 
 #define IS_VALID_CS_TRACE_ID(id)       \
        ((id > CORESIGHT_TRACE_ID_RES_0) && (id < CORESIGHT_TRACE_ID_RES_TOP))
 
-/**
- * Trace ID map.
- *
- * @used_ids:  Bitmap to register available (bit = 0) and in use (bit = 1) IDs.
- *             Initialised so that the reserved IDs are permanently marked as
- *             in use.
- * @pend_rel_ids: CPU IDs that have been released by the trace source but not
- *               yet marked as available, to allow re-allocation to the same
- *               CPU during a perf session.
- */
-struct coresight_trace_id_map {
-       DECLARE_BITMAP(used_ids, CORESIGHT_TRACE_IDS_MAX);
-       DECLARE_BITMAP(pend_rel_ids, CORESIGHT_TRACE_IDS_MAX);
-};
-
 /* Allocate and release IDs for a single default trace ID map */
 
 /**
index f09ace92176e2324916db01f0ab4d9e64495aefc..c16c61a8411dd9c419e1e03557848d5ebaf76b81 100644 (file)
@@ -218,6 +218,24 @@ struct coresight_sysfs_link {
        const char *target_name;
 };
 
+/* architecturally we have 128 IDs some of which are reserved */
+#define CORESIGHT_TRACE_IDS_MAX 128
+
+/**
+ * Trace ID map.
+ *
+ * @used_ids:  Bitmap to register available (bit = 0) and in use (bit = 1) IDs.
+ *             Initialised so that the reserved IDs are permanently marked as
+ *             in use.
+ * @pend_rel_ids: CPU IDs that have been released by the trace source but not
+ *               yet marked as available, to allow re-allocation to the same
+ *               CPU during a perf session.
+ */
+struct coresight_trace_id_map {
+       DECLARE_BITMAP(used_ids, CORESIGHT_TRACE_IDS_MAX);
+       DECLARE_BITMAP(pend_rel_ids, CORESIGHT_TRACE_IDS_MAX);
+};
+
 /**
  * struct coresight_device - representation of a device as used by the framework
  * @pdata:     Platform data with device connections associated to this device.