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 181FAC433EF for ; Mon, 29 Nov 2021 16:45: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ava7oVDSY4Ati7Z8ziPAcU9Chc2WRdg78/FQ1vLZz7Q=; b=JNGBIPaX7Ut6fv aM8ye6LQl/OHkkj+DKG3iR2cti1VFO6yGXbqZdGE5kR7uxAgSwj1UYjucti85gce68XEGeSgn6yM1 d1p6llCO29zY1BtOeGC3eos770XrGjbuMUwihUXEPAoc8c4OfMH7GcePMUgbDWcBHNPOLZLEBiIAs mmZeR2YHq2kq5Gp3aTVfEYWV2PqQXEuLIWcuQJs7kpjGKHijmmQ0SCFU/o1blR5FrL4F8wC9gjGHQ yQlxVbcPki+zsMntyzzdZCJtJLJrYBcbHGxeZt65ThYdhYWmxO9r8pWMNdSCe20TUfibrRdxUoDME ZvaGeGfRyscHVQfaQStw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrjlM-001Sic-5Y; Mon, 29 Nov 2021 16:44:20 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrjlH-001Si8-SU for linux-arm-kernel@lists.infradead.org; Mon, 29 Nov 2021 16:44:17 +0000 Received: by mail-ed1-x52a.google.com with SMTP id y13so74480433edd.13 for ; Mon, 29 Nov 2021 08:44:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D4Bi5aEB8ctdXPgBhexYuiViUeEMIf42LrpKj6osbS4=; b=JERbkZBFxUmglIUdn9g6S2FwgHG/XhTndJOaKZET5P0/Kv+gDQrnqXXhIooePiIfIy WhV7odUkeLshNEKD9rbTQN6mShYBCzEFy/3oJmiKY9y793MF7iK1CvqSb1A1socEbQhe LLHtlkRmAJvTWcQYs+k99SXmK3L+8KArdgmYWX2OMa/+A7Y4UCV1Wu2GDItxWcAitqpN w28hKgj98PHp6gAgEl3EmVR46YxCYnBQVFfgdQPHpHaDtlvqP8WrYIxkPrwzFYclI+xd /S7A1m9z/fWS+yTjoTVJbFXHYMXG+x0TSuYtSBJvjxd/8c77vztTzjBVfJKURqiqCXNo WL0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D4Bi5aEB8ctdXPgBhexYuiViUeEMIf42LrpKj6osbS4=; b=4Vbdpm0lR2pQGqtpRbAlLLPBJfOEr7m+JcFHUCyiQkI2P5pYZKI6RB9WchPRETvCjd Caj+ejE1nMOlHh61upQLv4KgEKsaSJ9iMHbVYgArMOfbozkeIBwkkAr+n4F9qpvTRAJu Q/sgdAetm36Wi/rnr9Q9+KAKm+0/PbuHHl/SUE8tBs1ZahFz2wBIDLajGsRS5b38KQw3 eiLEFXCX1W+CAe9BzbCUxENjf4k74mIZv493oKZfsphoUIDTWMZ6JM1M9V9VHIrUW7// 9bpUwmfoC3YCAzmDdR0jN2mHPTwsraH2mtEm0QqDQpMFdJ0A8JVB5HjuGH8EsKFtaW72 0HtA== X-Gm-Message-State: AOAM530dgFerZhp3xew7VKZ5622E8cAUcKZ5Lsua21ZMNPoyEJU+GMI9 j1gMed22kPqaE9jbjFtQFhJVXxZHmJfh+XLJZYBDQQ== X-Google-Smtp-Source: ABdhPJx6Ge5mGq2nBGsG/AIlY2sLGo5T+UKfpwNBRflW5gkEvAKuBzjuVl6roR+le5GFXDkB1tES9VwBwtbQyIPayyk= X-Received: by 2002:a50:e0c3:: with SMTP id j3mr76674170edl.97.1638204253225; Mon, 29 Nov 2021 08:44:13 -0800 (PST) MIME-Version: 1.0 References: <20211124200038.28662-1-mike.leach@linaro.org> <20211124200038.28662-5-mike.leach@linaro.org> <20211126182333.GA167936@p14s> In-Reply-To: From: Mathieu Poirier Date: Mon, 29 Nov 2021 09:44:01 -0700 Message-ID: Subject: Re: [PATCH v3 4/6] coresight: syscfg: Example CoreSight configuration loadable module To: Mike Leach Cc: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, Suzuki.Poulose@arm.com, leo.yan@linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211129_084416_016186_4B500D3B X-CRM114-Status: GOOD ( 44.68 ) 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 Mon, 29 Nov 2021 at 05:24, Mike Leach wrote: > > Hi Mathieu, > > On Fri, 26 Nov 2021 at 18:23, Mathieu Poirier > wrote: > > > > 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? > > > > The first Complex config set had the same warning for the built in > autofdo config - which went upstream without issue. > The code is safe - the strings are only ever read, the array is not > altered - so perhaps that is why it was permitted - or maybe it was > missed. > > > Do you want me to make the modification? > > > > When I first so the issue in the original patch series - I made the > suggested change and this had ripple effects of compile time warnings > - throwing away const. > If this is then corrected - the dynamic creation of configuration > descriptors from configfs input files (in the follow up patch set) > throws up errors > The only way round this I could see would be to have two versions of > the configuration descriptor - one that could be statically const > assigned in the code, and one that could be dynamically build from > file information. > > Overall I am not convinced that there is a good fix for this > checkpatch warning - and am not convinced that it is valid for this > usecase. ... and I am definitely not convinced it is worth spending the time to fix this. I have applied this patchset. Thanks, Mathieu > > Regards > > Mike > > -- > Mike Leach > Principal Engineer, ARM Ltd. > Manchester Design Centre. UK _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel