From patchwork Fri Jul 12 10:20:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13731588 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 1FB6CC2BD09 for ; Fri, 12 Jul 2024 10:25:55 +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=exGpI/q1ubHfcT+dWNjwEciQxWd5C9veIqWOilMjY6Y=; b=UYQ7gM5cpaosghlj8JomXH4HLo 0GZW3Jlp15LcrZ/5lEy8pAszsQ6eJ4JLIPOXHSASLL2Dh7oWw9yGJdU64+AMg83nEaPZdRIyoTzG1 8VmKY5IJ2ZmRn2TQKQvfcyKdKPx0daWAGnuqkE5JAJrP/4WodxaMVUDSwQST5Ren+W6V0RzAHR+d+ JLJ+JLh+n9ZmpXVN2ZZn+bIu6llZDC7hvUMwhG1JB+Pf39eR9kDF4dLvHHgO80mWD7kxMmjAl66g9 nrFNutowTTAA9Ai+tABkZMANkdKVdHxBuhpNYLNA45u250hYIbi6jnwMJQHE9L8ZPG7VPWzuUsKGH Tb+2ozsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSDTC-0000000HIYb-46Vu; Fri, 12 Jul 2024 10:25:42 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSDQb-0000000HHJT-1RGK for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 10:23:03 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-427a0efdb9bso2318915e9.0 for ; Fri, 12 Jul 2024 03:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720779779; x=1721384579; 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=exGpI/q1ubHfcT+dWNjwEciQxWd5C9veIqWOilMjY6Y=; b=MYbvtrsHOCtJc0u883ZT3if1aNmbk2rrUpqLrSMLzlsHWpeSiJ9DocBzHAGbSMz40/ VpWXcu7fJ+v7zI2wmdokgrJC3COfDYve3Li0JBCWQtJIygUvI18qJ7lZecZvNNf5uX0Y 73OvRqCggyARrbmWRM3LgkVL+TvaOlAGPRLJNKuRgquvmcoSXKXnUnqynP8TTiFMHFDe BQUQtei4HRxs0Tsws3o8ppa37sECw2kNF64KzlwCqAxygH9stczpUMWL8G9NwD1zIL7v FNUPuX3SQq1c2xTquzCgIP8SGfWvbLPfRx15ExEIfFnz4piQTUgdmuJNAtTQQtpdFKPQ MIow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720779779; x=1721384579; 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=exGpI/q1ubHfcT+dWNjwEciQxWd5C9veIqWOilMjY6Y=; b=mCfjNjpls7NYzMeFFjXYYU0HXduXft/9dlXmRA0vkyaBRoaIXBsePYv0hkKEW+dazX UpG+82Nk1git7/jM3Eo4r/MFBp8lyhuCbmU+NAUCcT5t3EDEM7wsQtpUoBAdNyvKdxOc wUWyrpbeAQNMItUVWdUmVKBfUcchhVQhaUcsrhn5CpiQ/1xZsqeTgVnAwPLAtZAhkhJo cdsa8qgSVaEDLyxxNuuqRZmQ3nppg7/uZ8R9X6LUsL8qRuRkjXusA9u1AgpQoiMZ/Cdc PbJBepFIW13pF7WhUGH+S0QGoFn+aYMHa6dhu8bVzJAnESpZd5BBqyqUo8teqPPSc2A7 dgGQ== X-Forwarded-Encrypted: i=1; AJvYcCXoGY4CX8K/aznDNbc31UEiH1XXIJAo04AFRAY0l2OTv36LghxSD4BAKP0qVfut2zZzqSlLTsgPTj9pQl8R477lzi7hvDKq6cpNfV8RmCGOGK8tvSI= X-Gm-Message-State: AOJu0Yx2YXeh4fJDhsyU13fnNi9HWxjBIsDG+itnldShLCiKDFf5jszA GY7Ux57MNqpG6/IJU8y/wTset/HtrjF3DkbegHiUjEm9s5Sl3/N7/UFzv1AbKVA= X-Google-Smtp-Source: AGHT+IGgUYd4gRyLTEW8Swsk7DoK36qF/yql0OQUFfYb+pVDpipH090ZkEOjNQT+aIPUK7J5yQHwzw== X-Received: by 2002:a05:600c:30d3:b0:426:66fe:8051 with SMTP id 5b1f17b1804b1-426707e677dmr81812355e9.24.1720779779542; Fri, 12 Jul 2024 03:22:59 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367cde89164sm9911058f8f.63.2024.07.12.03.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 03:22:59 -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 , 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 v5 11/17] coresight: Move struct coresight_trace_id_map to common header Date: Fri, 12 Jul 2024 11:20:20 +0100 Message-Id: <20240712102029.3697965-12-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240712102029.3697965-1-james.clark@linaro.org> References: <20240712102029.3697965-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-20240712_032301_490789_27945332 X-CRM114-Status: GOOD ( 20.12 ) 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 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.