From patchwork Wed Nov 24 20:00:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 12693578 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 DA0C9C433F5 for ; Wed, 24 Nov 2021 20:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=g7f8uyG7MQxx7/36IXspEYVt/0CDBMIcQsFrUwaQMwU=; b=iV/NImtwlyGPpL swq+9fRed5uXJ0uICYG4ZPvY/Qw95GtCT+hJKRAE68LuLSenQbrsbWf2OcOvvTI/z3VOCftwA6IY7 IuuMWc74VZ1UP8xQkscbFQ8dWA7+GZifTgtYRRJ3oYZ4hg6OwpDfxiERUvNU7xJmAYTM1eQ/wRKWd hctuO860o66m0Gjnz2pIw37dZDKWBi1oM4QY0qBNnYPqmfXiS8jDtrAYzhGV/JjVVyjK0qv5K/YVI a5+AqXVSmFkbpHqkp8OGpFH74XikngYF04u5/pUbQYoLCF59s8FZrqOrg4Evd14Z7QUEnmI2k/r6g 2zNKfanLesjzD2n9ZuKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpyRo-005jU3-8w; Wed, 24 Nov 2021 20:00:52 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpyRi-005jQy-HM for linux-arm-kernel@lists.infradead.org; Wed, 24 Nov 2021 20:00:48 +0000 Received: by mail-wr1-x431.google.com with SMTP id u1so6350654wru.13 for ; Wed, 24 Nov 2021 12:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=AxMd9KivfmWB7u4ScAvWba7V9XkDr05zLmxD219XeeE=; b=gP6EvpG7ye/VlCDEQi/5egk6/zOdwjsl0LMcEgB9i8m9rEnqb04JBcJgK9emPRn1ke gv5lxKOKXpmFlHot43/iK3ihsgjH2jPzBgWOu7vsUR8M01ifpG/BvFeXSCGXG1lv4ISq hKPer8YynUdCFUoWqyXBMy7q2BYMX1DmowScRp4L9Dj7m3UV3QfDfd6VaauAq/ITLrfh KC3Z/vxT9uUi/eCr/WVP+lAEOgIxnY3/TkB78vX6IkrbFjGeoOhdH4n1i9XLfdpR/bOI yZp5fDIEy4B88wfORakST7SVEmDnZjRTq25bIzjx2EaS81AQbR5vTisJruLPyX/VyYDw PuWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AxMd9KivfmWB7u4ScAvWba7V9XkDr05zLmxD219XeeE=; b=T1Kzo6h0TTjHWC8NFj4mVXpp/ChVKOt9YXjcBEKGBFhmLPvDxGOqWFfHBeNfONir9i gFW0cLgDuuaY+vbTfvKva0V0KFpXX5AtswMxn95y4KXw8lTztSwX49iU4f0gzKcLwqWv HxtF6EkaoLP4U9G/6boRJ8aqUgFSjFheI8PC1memMpOV1yFG7oEX5pqS/y4giguXtBZd Z0XuIlOXdUOTT92933MWAopepgXL+p33fzrrVnUdOyTjvTyf7YXgz2TOjpmZinNJyQ4Q nykUNq5DEVqupKppybakwDk05zCJZd0AAZJ1Dn3OpORu5DZbxpG9iSX9wVuQUIyMYwuT Y8dQ== X-Gm-Message-State: AOAM5334M1tQFL69SCBn9cMapndSRt+ooDt2gQiP5eZ2D58hRaogLvlI tus84R8a0VboHeuWTcYBSttyCy+XqZAyMw== X-Google-Smtp-Source: ABdhPJzKfNLW34rCvpBNuieNlakiyFb4I1V9BF+3f2obeXSyZ6xRz8P+ViJ/PqqKIVR0vNJjBUrUEw== X-Received: by 2002:adf:cf05:: with SMTP id o5mr23313065wrj.325.1637784044537; Wed, 24 Nov 2021 12:00:44 -0800 (PST) Received: from linaro.org ([2a00:23c5:6809:2201:dd2e:a6e1:6adf:269c]) by smtp.gmail.com with ESMTPSA id c1sm729582wrt.14.2021.11.24.12.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 12:00:44 -0800 (PST) From: Mike Leach To: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Cc: mathieu.poirier@linaro.org, suzuki.poulose@arm.com, leo.yan@linaro.org, Mike Leach Subject: [PATCH v3 0/6] coresight: syscfg: dynamic load Date: Wed, 24 Nov 2021 20:00:32 +0000 Message-Id: <20211124200038.28662-1-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211124_120046_630164_A0905AF8 X-CRM114-Status: GOOD ( 14.47 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 1) API updated to allow dynamic load and unload of configurations and features. Dependency management between loaded sets is added. 2) New configuration and feature sets can be added using a loadable module. An example in /samples/coresight is provided to demonstrate this. 3) configfs can be used to activate a configuration which will then be used when controlling tracing using sysfs. Applies and tested on coresight/next - which is 5.16-rc1 Changes since v2: (requested by Mathieu) a) Split first patch into two patches to introduce the concept of owner, then use it to implement dynamic load / unload. b) Renamed configfs configuration attributes used to enable and set preset on configurations when using CoreSight with sysfs c) Updated docs to reflect use of enable and preset attributes for sysfs CoreSight control. Changes since v1: a) Original set split to divide related changes into smaller sets. Removed RFC flag. b) Revised config activation for sysfs to simplify common function. (patch 4). c) Minor changes requested by Mathieu added. Mike Leach (6): coresight: configuration: Update API to introduce load owner concept coresight: configuration: Update API to permit dynamic load/unload coresight: syscfg: Update load API for config loadable modules coresight: syscfg: Example CoreSight configuration loadable module coresight: configfs: Allow configfs to activate configuration Documentation: coresight: Update coresight configuration docs .../trace/coresight/coresight-config.rst | 62 +++- MAINTAINERS | 1 + .../coresight/coresight-cfg-preload.c | 9 +- .../hwtracing/coresight/coresight-config.h | 9 +- .../coresight/coresight-etm4x-core.c | 11 +- .../coresight/coresight-syscfg-configfs.c | 87 +++++ .../coresight/coresight-syscfg-configfs.h | 4 + .../hwtracing/coresight/coresight-syscfg.c | 315 ++++++++++++++++-- .../hwtracing/coresight/coresight-syscfg.h | 39 ++- samples/Kconfig | 9 + samples/Makefile | 1 + samples/coresight/Makefile | 4 + samples/coresight/coresight-cfg-sample.c | 73 ++++ 13 files changed, 586 insertions(+), 38 deletions(-) create mode 100644 samples/coresight/Makefile create mode 100644 samples/coresight/coresight-cfg-sample.c