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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A04C7C8300C for ; Thu, 26 Nov 2020 18:55:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F03B2223F for ; Thu, 26 Nov 2020 18:55:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="g3/BgX25"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QIaD++NM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F03B2223F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=SeaeCAuLmsk0+hr7/eSpjXJYD7rXjcmpQvflEEnSWVg=; b=g3/BgX25RSYkslJwkRGPu5c+Z D1QwYWBXAFWwSQvi+UJu9C3doW6YSSEzu4lB/9M6MJAjWcqL0l3uqs26WXcvvXBo5G8oMcS6T0J/3 2jeBibyWDjsl1oRVXWi5fZKrIM/5fWdYp8Hj/sU51H44RJeCIA1kx+w3w4y+F8lUgjhPIiDB50Jci rAhfFpfPa3nCmcrfxcGnT3ZzgsqvWJh6rytJZpDxvl1z3NZfblA6PxP4+IC0fKlnTJFAV30piqJP9 I0k/kiN6jjPi40xZda9zlhqqygNE1hz/H1Y30hapiaDwLYWUoqBIe9Hsa2RKWVktn6Co0HEO/oAzS p2/UnNn5A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiMOh-0008MN-41; Thu, 26 Nov 2020 18:53:39 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiMNY-0007jf-8I for linux-arm-kernel@lists.infradead.org; Thu, 26 Nov 2020 18:52:30 +0000 Received: by mail-pf1-x444.google.com with SMTP id b10so960366pfo.4 for ; Thu, 26 Nov 2020 10:52:27 -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=H4MSUvn5tN36fT8E0Hyc2MU5JpBU1E1icM0wVLaEObU=; b=QIaD++NMeRRGHkN8LJSLaCJn2JP4TAe16Z0LgIqlHmUlIr9Lahd3a/Yjxn3G5dU6BK V4LAOx02fWhL+G6ejSUpMA7MlS+OX4I+RqkqUUNOZ1sprc7hkF2dgcC6n9rsqOAnXwRg +lI/hvCwe4nCiIJUd+S2VSpX9OX9+em74VpvB7qzBpbyKJwiBijSF+RI7N1vPnt7CjVU HbbwjuQwwnzf4ViyvX/SUSHWJs3CFXHtjqVaQTD2xizGMQloBWFyLxToIAaExu1aAORV UFf1SWqwzyttX8FVuZDjFmIK8Fb6+1dB+U7El/aJigG5zNyQTBa1H9MR8QLzUbyQrptf WRcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=H4MSUvn5tN36fT8E0Hyc2MU5JpBU1E1icM0wVLaEObU=; b=DrpLUEzxCyRbSrCIC9+AylhyJSM0bsROV7dLiitYSEgbH/r7QAqQEOXqfYH8bBWdGp Vt/zucVkDXrpina3OPKp44XJcUnbRrvg1OB0hg5iUmZ0lP1zq9nht0i/si8pojJKpm/S 9ihIL7XiZzeHPa0wi+m8GsVoWm7HmZQ4ZIlt9OgIW2hyWQ1BA22wYDpIelHs2VY4HCNc 3OoVgUiHhLoDXB8NXIECbbxYIJo1dmye+1udV9DCua4Pn7gdZmRaf3mwzU7fzYpJgl5T cEr55e1tpoq1JodyXfu7KwlmFh7YWYVYkingWl73W06GGBqoWHxbDdEaQ3S7W3rDu4Os JY4g== X-Gm-Message-State: AOAM5331k9pDnBHY9gvTMMLOklWZoLqq8TSy0VpsMO4GDJyl4EEJW66X yinYL6lMxnf4SqHKYD6c9cqdcw== X-Google-Smtp-Source: ABdhPJzKuphWWLQ03gl3721iyEa/d6TLfQyVTq6lXqHxFa1ehgD/OfLp63bLqtru27YcQhJfuD5Ujg== X-Received: by 2002:a63:d50a:: with SMTP id c10mr3583856pgg.217.1606416745449; Thu, 26 Nov 2020 10:52:25 -0800 (PST) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id h1sm7092429pjz.22.2020.11.26.10.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 10:52:24 -0800 (PST) Date: Thu, 26 Nov 2020 11:52:23 -0700 From: Mathieu Poirier To: Mike Leach Subject: Re: [RFC PATCH v3 0/9] CoreSight complex config support; ETM strobing Message-ID: <20201126185223.GE757228@xps15> References: <20201030175655.30126-1-mike.leach@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201030175655.30126-1-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201126_135228_730553_F757648C X-CRM114-Status: GOOD ( 33.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yabinc@google.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com 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 Hi Mike, On Fri, Oct 30, 2020 at 05:56:46PM +0000, Mike Leach wrote: > This patchset introduces initial concepts in CoreSight complex system > configuration support. > > Configurations consist of 2 elements:- > 1) Features - programming combinations for devices, applied to a class of > device on the system (all ETMv4), or individual devices. > 2) Configurations - a set of programmed features used when the named > configuration is selected. > > Features and configurations are declared as a data table, a set of register, > resource and parameter requirements. Features and configurations are loaded > into the system by the virtual cs_syscfg device. This then matches features > to any registered devices and loads the feature into them. > > Individual device classes that support feature and configuration register > with cs_syscfg. > > Once loaded a configuration can be enabled for a specific trace run. > Configurations are registered with the perf cs_etm event as entries in > cs_etm/cs_config. These can be selected on the perf command line as follows:- > > perf record -e cs_etm// ... > > This patch set has one pre-loaded configuration and feature. > A named "strobing" feature is provided for ETMv4. > A named "autofdo" configuration is provided. This configuration enables > strobing on any ETM in used. > > Thus the command: > perf record -e cs_etm/autofdo/ ... > > will trace the supplied application while enabling the "autofdo" configuation > on each ETM as it is enabled by perf. This in turn will enable strobing for > the ETM - with default parameters. Parameters can be adjusted using configfs. > > The sink used in the trace run will be automatically selected. > > A configuation can supply up to 15 of preset parameter values, which will > subsitute in parameter values for any feature used in the configuration. > > Selection of preset values as follows > perf record -e cs_etm/autofdo,preset=1/ ... > > (valid presets 1-N, where N is the number supplied in the configuration, not > exceeding 15. preset=0 is the same as not selecting a preset.) > > Applies to coresight/next (5.10-rc1 base) I am done reviewing this third revision. I commented on a fair amount of things but that isn't unusual with this much code, especially when it is new code that doesn't have a precedent. As I stated before I think the general architecture of the feature is sound. The concepts of XYZ_desc and XYZ_csdev have now sunk in and I quite like it. It will be really good when the naming convention is straighten out. I spent a long time thinking about creating configuration and features on the fly from configfs. It is definitely not something that needs to be part of this set, nor have to be implemented any time soon, but is this something that is on your radar? Lastly the "RFC" should be dropped for the fourth iteration, we are way passed that point now. Thanks, Mathieu > > Changes since v2: > 1) Added documentation file. > 2) Altered cs_syscfg driver to no longer be coresight_device based, and moved > to its own custom bus to remove it from the main coresight bus. (Mathieu) > 3) Added configfs support to inspect and control loaded configurations and > features. Allows listing of preset values (Yabin Cui) > 4) Dropped sysfs support for adjusting feature parameters on the per device basis, > in favour of a single point adjustment in configfs that is pushed to all device > instances. > 5) Altered how the config and preset command line options are handled in perf and > the drivers. (Mathieu and Suzuki). > 6) Fixes for various issues and technical points (Mathieu, Yabin) > > Changes since v1: > 1) Moved preloaded configurations and features out of individual drivers. > 2) Added cs_syscfg driver to manage configurations and features. Individual > drivers register with cs_syscfg indicating support for config, and provide > matching information that the system uses to load features into the drivers. > This allows individual drivers to be updated on an as needed basis - and > removes the need to consider devices that cannot benefit from configuration - > static replicators, funnels, tpiu. > 3) Added perf selection of configuarations. > 4) Rebased onto the coresight module loading set. > > > To follow in future revisions / sets:- > a) load of additional config and features by loadable module. > b) load of additional config and features by configfs > c) enhanced resource management for ETMv4 and checking features have sufficient > resources to be enabled. > d) ECT and CTI support for configuration and features. > > Mike Leach (9): > coresight: syscfg: Initial coresight system configuration > coresight: syscfg: Add registration and feature loading for cs devices > coresight: config: Add configuration and feature generic functions > coresight: etm-perf: update to handle configuration selection > coresight: etm4x: Add complex configuration handlers to etmv4 > coresight: config: Add preloaded configurations > coresight: syscfg: Add initial configfs support. > coresight: syscfg: Allow update of feature params from configfs > coresight: docs: Add documentation for CoreSight config. > > .../trace/coresight/coresight-config.rst | 230 ++++++ > Documentation/trace/coresight/coresight.rst | 16 + > drivers/hwtracing/coresight/Makefile | 6 +- > .../coresight/coresight-cfg-preload.c | 160 +++++ > .../hwtracing/coresight/coresight-config.c | 392 +++++++++++ > .../hwtracing/coresight/coresight-config.h | 311 +++++++++ > drivers/hwtracing/coresight/coresight-core.c | 18 +- > .../hwtracing/coresight/coresight-etm-perf.c | 166 ++++- > .../hwtracing/coresight/coresight-etm-perf.h | 10 +- > .../hwtracing/coresight/coresight-etm4x-cfg.c | 181 +++++ > .../hwtracing/coresight/coresight-etm4x-cfg.h | 29 + > .../coresight/coresight-etm4x-core.c | 36 +- > .../coresight/coresight-etm4x-sysfs.c | 3 + > .../coresight/coresight-syscfg-configfs.c | 421 +++++++++++ > .../coresight/coresight-syscfg-configfs.h | 47 ++ > .../hwtracing/coresight/coresight-syscfg.c | 656 ++++++++++++++++++ > .../hwtracing/coresight/coresight-syscfg.h | 83 +++ > include/linux/coresight.h | 7 + > 18 files changed, 2743 insertions(+), 29 deletions(-) > create mode 100644 Documentation/trace/coresight/coresight-config.rst > create mode 100644 drivers/hwtracing/coresight/coresight-cfg-preload.c > create mode 100644 drivers/hwtracing/coresight/coresight-config.c > create mode 100644 drivers/hwtracing/coresight/coresight-config.h > create mode 100644 drivers/hwtracing/coresight/coresight-etm4x-cfg.c > create mode 100644 drivers/hwtracing/coresight/coresight-etm4x-cfg.h > create mode 100644 drivers/hwtracing/coresight/coresight-syscfg-configfs.c > create mode 100644 drivers/hwtracing/coresight/coresight-syscfg-configfs.h > create mode 100644 drivers/hwtracing/coresight/coresight-syscfg.c > create mode 100644 drivers/hwtracing/coresight/coresight-syscfg.h > > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel