Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp412880lqp; Tue, 11 Jun 2024 08:05:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBEZPFBmcWeddGLErn76X/oBA/auROqmJqwKYPfCsk0cGxcEBOOrEFpWPRVb93hUphSGucTGKa+KS4waVUQEQ47FvS1P4emBhF3qNfNg== X-Google-Smtp-Source: AGHT+IEFKCLXMRnq/0/eLucuzUPoJ0qRuYllWB3SYGVIOSQaJLqBeovtNPY/SDsbEcEbE6j+Bjut X-Received: by 2002:a05:6402:3196:b0:57c:6b49:aef with SMTP id 4fb4d7f45d1cf-57c90d16fd9mr1767276a12.11.1718118325554; Tue, 11 Jun 2024 08:05:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718118325; cv=pass; d=google.com; s=arc-20160816; b=Yhd55IfqeAP8+MkA+iIJRXj1MMMMhF9mqU/kQFkUdsRYgYZTomBVNScdF8rmk5RuyL 8QDlRrWHO07D8C0xPpBGBHL2CWOXhvRZOe2+65IpORTIrYmRxk4JlsWyfw2v+2jHPNrk cvWSowrt7FneczZ8AUzY7vf1RArhzx2Cdem3PKrdXXLQIsm3sqEeVXADtBHuWBytSyxU KxPmBHWRbXUJhzn1lrfFS0vSwSjG7WBT28SRuuSRMjeLM7JtKKQ3ENfYkQQL5g6T1fp9 G87URH6xW3FH+mGWCKdVbDvMtUZOMGbj+Z1j69ctZO1vul0GOcIsBt0IeNTr8my21luP ehZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=A4uNHw4IdNH7fEJoQz/HvgEwiOBjKF4oOnqTDtpQz9s=; fh=2s+eIsKHHam+jMV7/s2ffLwy54AhQ8M2v8jHKEN3Fe4=; b=xujnPqGdEOga0RvjHX2mNxIJtb7g/OmROSySVPmBrvOcOY4Ull/uoBtRXYxH1PuZxn GHLgT131bpJRfncnbFMQof16mEqOzBLgTipS7Jd+GDE/z1l1N702LQ/K5HHKA3GITmq2 7RbVZiFT1DGBTyRog9S056XHkl0PqFBB66yngsUqT0Qf852eLISagRwBkR8vGtj4q7tn LJGZ/2pReb46XhMf/PBWl1ZaMgwMX7FtrPA60qaB/QrB339gPFZTJX8Keh3fRU3wo89f LKI013owDCaxASDZK1oZ+N1k4ken/VaJekymGU3oWv0PZgG4DHI9QyCN930I7IytGcbA AJwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-210121-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210121-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c80d11576si2401917a12.536.2024.06.11.08.05.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 08:05:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210121-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-210121-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210121-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 44F101F233B2 for ; Tue, 11 Jun 2024 15:05:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4E9B381D4; Tue, 11 Jun 2024 15:03:42 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4E7D42058; Tue, 11 Jun 2024 15:03:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718118222; cv=none; b=HlRgetKsPScyG7BeMdvTodk9yHHgcoQ+hPaJkMRnSmTq9CUtAJMu3nGMX/USKhf7wanLCTC8EKeAFZdPl/PGSF5gPDhqcmSuEBgQlXGelQQFNO1KKcwYv02ES70dCdGIGgZR9uZkbDLbLjsHIpCZ1bvXP8+vtwNQogryYt+clZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718118222; c=relaxed/simple; bh=dURqEr78iL4SJ+PjS1h9hXb4BsJXz45pIuev3F2tKPI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fHCwYAWS+pFlE3tyBlM2hlU/vgYmG9rO4/2GmNIVbCriV1XnavSEol1wQVLHgKiIGJmf4MX0HMAKeebDh03RRAGxbrhIzRqu1WL4dEObnEK7rGAQkZI4cOqMDlimoNz8N1uZxGI7Tg3v00EYPl5Ytr+VQxb2/7JUNStPX/Vya4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E614F1595; Tue, 11 Jun 2024 08:04:04 -0700 (PDT) Received: from e127643.arm.com (unknown [10.57.41.181]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 78BD03F64C; Tue, 11 Jun 2024 08:03:36 -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 , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Jiri Olsa , Ian Rogers , Adrian Hunter , "Liang, Kan" , John Garry , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-perf-users@vger.kernel.org Subject: [PATCH v3 08/14] coresight: Move struct coresight_trace_id_map to common header Date: Tue, 11 Jun 2024 16:02:19 +0100 Message-Id: <20240611150228.1802828-9-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611150228.1802828-1-james.clark@arm.com> References: <20240611150228.1802828-1-james.clark@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- .../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. -- 2.34.1