From mboxrd@z Thu Jan 1 00:00:00 1970 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 6A02FC433FE for ; Fri, 26 Nov 2021 18:25:02 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Texom0Mmy1ChE3BZojDXAiRQnxK86L4eF1eqCwDv3Eo=; b=Pq+90Tp+KkdA0H Vh8H2J7pwQCcmklKIPvUNrlfXzuaFdst2iuYRmh+Lt9G8vg2YGeTkAb6gCe0TtvjqeRWLrMbzhI2h ouDOIOsDK8AiYz9LHbNMQxXuoYwlCoOGovQfevhVs2YyP7k4zDUJfq9VjY/YhwexeZhQIsBLagBwP w/Y0QiIGUju6dIqqhkmexztAF0r8f2qRkChASOCYEVGKZfDyyASuoLlVv7Hei7wY2LBepY1tzzLw/ m+HC68+AsiIeAZ22lpeMjKD0TPyDe/pHX1TzdKCgr2NADtRhLUAuMrxfFOu2JwcjhLK38rw/TTa5A AE0reI3BaFCdMgaxfP+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqfsu-00BULs-V6; Fri, 26 Nov 2021 18:23:45 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqfsq-00BUKL-E3 for linux-arm-kernel@lists.infradead.org; Fri, 26 Nov 2021 18:23:41 +0000 Received: by mail-pj1-x1031.google.com with SMTP id gb13-20020a17090b060d00b001a674e2c4a8so8559109pjb.4 for ; Fri, 26 Nov 2021 10:23:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Z3PPQmQu1Ujnl2q102jBj+x+RzgnBjIng1lMuDkteH8=; b=M/1obRy8wuchQzwynQvsGQ8luJ4RFJyD+3dox8lPFhxB9vpmYNkPH271h9mhtlt34U RP24EiN8Vqx+Ha3lK+SUb2XB+AJQ+bp8qxEGquBIvc9KIjYA741xBaZUMJwxEJryYqST zW084AklWCgwV6PbPscwOktce/dfrMzxTfTOCey/VlOLVm1MEhO72UBPo7yCY3x9J6xm u7Vak4RQzE2vuf7aiQJqoscLESCpr4rzGRVN81nQzbssYX5QhwYofTz25d3B26qYUdLR R7dZhMDj9zWygES/BOMHA+YUWweZsvcgD25BNs0WrtP9GGV6KPZjq+r8XtOI+MZ9/3kR ao6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Z3PPQmQu1Ujnl2q102jBj+x+RzgnBjIng1lMuDkteH8=; b=LiytNEGrayD9xb6rKpMTk7A2myQnPPPBJSCSthwsYSYLF28mPxNjKH1mgl4VdTes+T mMgrA4BUTfthSalvaIajM5BtZDW/AinLiKdeOHIF50vBDOwiyxyVBhM9ddSB6kPt2leL 4+YPYswKwL4RBRA39NUQ+WBrdR7axylz11Zya19k9WfyiDMBb0UVCUcY/7Alv+IZFW1Z CH/w+HmwuZPoUE1Un4TCm/SkPh94izHlSUPqd3QdRDv8seY/MuOpyrVhkxJHjgAZwFvL JWtvsLZJaMfAZ95AD/ps+eO5zqdVp3Wrdn+j2YVcgz2WrE2YzrCZhwvWSbhV34soVhQC aE/g== X-Gm-Message-State: AOAM530ImvFKgELkGspVWJaYOTvbIH8oigQsH4cqXfLmwbtxocf68VUM rfOOfOAV2w7xYqdhM+KQFdozKg== X-Google-Smtp-Source: ABdhPJyUkXAuqAQhcH09C8G+525zVK2tA0+fMv5Ns9dv8xLehxQXURqkS+LE74khhv3tmw1pOrMMKw== X-Received: by 2002:a17:90b:4a83:: with SMTP id lp3mr17806196pjb.34.1637951017624; Fri, 26 Nov 2021 10:23:37 -0800 (PST) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id f18sm7270263pfk.105.2021.11.26.10.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 10:23:35 -0800 (PST) Date: Fri, 26 Nov 2021 11:23:33 -0700 From: Mathieu Poirier To: Mike Leach Cc: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, suzuki.poulose@arm.com, leo.yan@linaro.org Subject: Re: [PATCH v3 4/6] coresight: syscfg: Example CoreSight configuration loadable module Message-ID: <20211126182333.GA167936@p14s> References: <20211124200038.28662-1-mike.leach@linaro.org> <20211124200038.28662-5-mike.leach@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211124200038.28662-5-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211126_102340_539253_0688C4FE X-CRM114-Status: GOOD ( 23.86 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Nov 24, 2021 at 08:00:36PM +0000, Mike Leach wrote: > An example of creating a loadable module to add CoreSight configurations > into a system. > > In the Kernel samples/coresight directory. > > Signed-off-by: Mike Leach > Reviewed-by: Mathieu Poirier > --- > MAINTAINERS | 1 + > samples/Kconfig | 9 +++ > samples/Makefile | 1 + > samples/coresight/Makefile | 4 ++ > samples/coresight/coresight-cfg-sample.c | 73 ++++++++++++++++++++++++ > 5 files changed, 88 insertions(+) > create mode 100644 samples/coresight/Makefile > create mode 100644 samples/coresight/coresight-cfg-sample.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index 7a2345ce8521..85242fdd3b8c 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1890,6 +1890,7 @@ F: Documentation/trace/coresight/* > F: drivers/hwtracing/coresight/* > F: include/dt-bindings/arm/coresight-cti-dt.h > F: include/linux/coresight* > +F: samples/coresight/* > F: tools/perf/arch/arm/util/auxtrace.c > F: tools/perf/arch/arm/util/cs-etm.c > F: tools/perf/arch/arm/util/cs-etm.h > diff --git a/samples/Kconfig b/samples/Kconfig > index bec3528aa2de..fe8b56d576ce 100644 > --- a/samples/Kconfig > +++ b/samples/Kconfig > @@ -232,6 +232,15 @@ config SAMPLE_WATCH_QUEUE > Build example userspace program to use the new mount_notify(), > sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function. > > +config SAMPLE_CORESIGHT_SYSCFG > + tristate "Build example loadable module for CoreSight config" > + depends on CORESIGHT && m > + help > + Build an example loadable module that adds new CoreSight features > + and configuration using the CoreSight system configuration API. > + This demonstrates how a user may create their own CoreSight > + configurations and easily load them into the system at runtime. > + > endif # SAMPLES > > config HAVE_SAMPLE_FTRACE_DIRECT > diff --git a/samples/Makefile b/samples/Makefile > index b7b98307c2b4..c148ada64beb 100644 > --- a/samples/Makefile > +++ b/samples/Makefile > @@ -32,3 +32,4 @@ obj-$(CONFIG_SAMPLE_INTEL_MEI) += mei/ > subdir-$(CONFIG_SAMPLE_WATCHDOG) += watchdog > subdir-$(CONFIG_SAMPLE_WATCH_QUEUE) += watch_queue > obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak/ > +obj-$(CONFIG_SAMPLE_CORESIGHT_SYSCFG) += coresight/ > diff --git a/samples/coresight/Makefile b/samples/coresight/Makefile > new file mode 100644 > index 000000000000..b3fce4af2347 > --- /dev/null > +++ b/samples/coresight/Makefile > @@ -0,0 +1,4 @@ > +# SPDX-License-Identifier: GPL-2.0-only > + > +obj-$(CONFIG_SAMPLE_CORESIGHT_SYSCFG) += coresight-cfg-sample.o > +ccflags-y += -I$(srctree)/drivers/hwtracing/coresight > diff --git a/samples/coresight/coresight-cfg-sample.c b/samples/coresight/coresight-cfg-sample.c > new file mode 100644 > index 000000000000..25485c80b5e3 > --- /dev/null > +++ b/samples/coresight/coresight-cfg-sample.c > @@ -0,0 +1,73 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright(C) 2020 Linaro Limited. All rights reserved. > + * Author: Mike Leach > + */ > + > +#include "coresight-config.h" > +#include "coresight-syscfg.h" > + > +/* create an alternate autofdo configuration */ > + > +/* we will provide 4 sets of preset parameter values */ > +#define AFDO2_NR_PRESETS 4 > +/* the total number of parameters in used features - strobing has 2 */ > +#define AFDO2_NR_PARAM_SUM 2 > + > +static const char *afdo2_ref_names[] = { > + "strobing", Checkpatch is complaining the above should be "static const char * const ..." I can't remember if we talked about this before - did we? Do you want me to make the modification? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel