From patchwork Mon Jul 22 10:11:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13738642 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4951DC3DA5D for ; Mon, 22 Jul 2024 10:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ob3o88R/yxUBwonSp9vzDZCeFMZAfTzy7u2JCgClFSk=; b=B0V90eExFXdjPmmC5u0j3VnsJt Z0894MwTG1tFYPHkM4KVSMP2VzGD/nImS2i+HBg+WMRBFedPfrZiloqxb4bllhTHCV+/ocYlAEcVT g1h0NnThfy5lBc9E5W5ziT4uD+jkCroMPltYup4/pzaUZbBJYb+b7cgo7GjovBpEP3hZbhpvNtqdm BCICqZplUBFcJimI0JmyyBqY30PIQrWuL+Q6FL7idEaqVqlEpUNIq5EipTVhm2YElMSWoeboYrVrB 53TzwJ7AFtncO5HOMzVOlL1ju66pM6zPq3jP+N5OcPtQd5qmccybBqsCV0pYPXreuTLBDFOt/oDAF KEYj8UvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVq6I-00000009DmE-3hLK; Mon, 22 Jul 2024 10:17:02 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVq2l-00000009CRe-3Ozj for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2024 10:13:25 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4266ed6c691so27083225e9.3 for ; Mon, 22 Jul 2024 03:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721643202; x=1722248002; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ob3o88R/yxUBwonSp9vzDZCeFMZAfTzy7u2JCgClFSk=; b=WVA+OgfGypaQEkbOiUXh1NnqqGW4qp6+pJZEu2kqaL4P41ZPTPGrsVQ+8aLhxsILWa TqqfkPCNgij8RzwyOojj04qurLvSncej6wChgnTUayobwQ0Peo/IzsBMgyMJnK6P5/Ja AtDCuglwGVMY6liHGQ2HTsLmIEyVFgABUZJKMnSfvDBdvJkT9XYD0EgHtQPmRTvWUmnP pgH3wPzypmd6Bbwy9fsyOotZ4jJptAz4KZ4/Y7Z4B26Ffd4JdOwUHegxJvhLWLRW3vI8 t/IJj+XrXghpofyyxsaUnjoy8QrNWDL/cLl+zHKb078Lu7/3WlmPw6Frj54g5i1gDaDb zD4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721643202; x=1722248002; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ob3o88R/yxUBwonSp9vzDZCeFMZAfTzy7u2JCgClFSk=; b=JHv7v1mVyl8cDGzggVL6sc3L1NEGR8oQjDePa6g3xMfygVjotD3ZeAB7tA3g48vSNm 2OHei7EKVM4/5H5Dlr+7wqeV7dXJkVW6T/SCeEOjvFVygU69X6h+SMCcyhAkapgetXyA c83MWOGiNfBdZqtp+TrKlg8NffoQXbYKOxVKAtMD/FDcuyg7wP1RqJNmV2WO37BcVZkE cNrURz0IhJ5KoQeal27XnUVdWLdLWDo9Nxxh2mEHsT1ZZUfRG1Fru4hagWio2UgA5eod uaJ0MLYy68/HZCsGc/s0UEKAA3qt87I+MzLrUSy1r2XDfyjel41a9b6rSLWkoNoZBEJ6 i/GQ== X-Forwarded-Encrypted: i=1; AJvYcCX3yRWxPrSZKluCv1jlQ1Toe8ntPcqixPoW1xsD4A/UYH7ZwaU+EuOL/D7KDW9m+o4YqYiRUYoz+n2kFxzF+MkvBwVJL7Lm6VFMcOwvpjAHMt6ZoGw= X-Gm-Message-State: AOJu0Yx4/Ph/+AXME1BUSZNfUkj04PSNdvEn3wy8dyLcUVepZ22blnoa O+Qw/OjbLj2MuF+Uhd2KqnWA3Fx7YL3GZ/7KAjxHITaml7Kr3euWiNfzJNe0MF4= X-Google-Smtp-Source: AGHT+IFnRlQjxIzplZP9hmspE1klaaY7FAnTuoO73aRSdCaRY/lNjrX74jyuwVgqrmifZPXhzx+e5A== X-Received: by 2002:a05:600c:4f4e:b0:427:b995:5bd0 with SMTP id 5b1f17b1804b1-427daa61cbfmr47929775e9.23.1721643202485; Mon, 22 Jul 2024 03:13:22 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427d2a8e436sm147993865e9.33.2024.07.22.03.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 03:13:22 -0700 (PDT) From: James Clark To: coresight@lists.linaro.org, suzuki.poulose@arm.com, gankulkarni@os.amperecomputing.com, mike.leach@linaro.org, leo.yan@linux.dev, anshuman.khandual@arm.com Cc: James Clark , Leo Yan , James Clark , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Jiri Olsa , Ian Rogers , Adrian Hunter , "Liang, Kan" , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-perf-users@vger.kernel.org Subject: [PATCH v6 11/17] coresight: Move struct coresight_trace_id_map to common header Date: Mon, 22 Jul 2024 11:11:53 +0100 Message-Id: <20240722101202.26915-12-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240722101202.26915-1-james.clark@linaro.org> References: <20240722101202.26915-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240722_031323_859453_0D84A0BD X-CRM114-Status: GOOD ( 20.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: James Clark 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 Reviewed-by: Mike Leach Signed-off-by: James Clark Tested-by: Leo Yan Tested-by: Ganapatrao Kulkarni Signed-off-by: James Clark --- .../hwtracing/coresight/coresight-trace-id.c | 1 + .../hwtracing/coresight/coresight-trace-id.h | 19 ------------------- include/linux/coresight.h | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-trace-id.c b/drivers/hwtracing/coresight/coresight-trace-id.c index af5b4ef59cea..19005b5b4dc4 100644 --- a/drivers/hwtracing/coresight/coresight-trace-id.c +++ b/drivers/hwtracing/coresight/coresight-trace-id.c @@ -3,6 +3,7 @@ * Copyright (c) 2022, Linaro Limited, All rights reserved. * Author: Mike Leach */ +#include #include #include #include diff --git a/drivers/hwtracing/coresight/coresight-trace-id.h b/drivers/hwtracing/coresight/coresight-trace-id.h index 3797777d367e..49438a96fcc6 100644 --- a/drivers/hwtracing/coresight/coresight-trace-id.h +++ b/drivers/hwtracing/coresight/coresight-trace-id.h @@ -32,10 +32,6 @@ #include #include - -/* 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 @@ -46,21 +42,6 @@ #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 */ /** diff --git a/include/linux/coresight.h b/include/linux/coresight.h index f09ace92176e..c16c61a8411d 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -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.