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=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 B6A33C433B4 for ; Thu, 1 Apr 2021 16:55:18 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 496116138F for ; Thu, 1 Apr 2021 16:55:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 496116138F 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=desiato.20200630; 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=LsJhP4zbaIwYoCXf9XzZUhF+ZuPcUcKG6bQYCJyUckU=; b=gU/HaR53QAYn6hgJhg1m0nqVH cmqqF/nKv7Kt3R8/AL4FJqKLRPCmGcOgHSlk7cEHeJsrUUMl64hndo07BIqBfefuoXQzBpqkfb/HF 0CAwlGXBpbrhPFbnPvwuxZbLTJwytQvLB38bJv/4j8veJC+6Ed8weo/6lari7vTQ9cXa/ezYeQnpK P54zLtT8oCNjYL3G+kKLcuneyaHggj3zHVqTBE9Y7ZXFaIo5Q23I6hvqgwHVei7/qHog2hkQmMIQu GRWL3Q51SNOt1ktN7Yyk2jj8gWyIBEC//2/iK2qQg4Ebgyqkq16zU7NlV5Z/OBkCXvfykIeDba3dd LDJMR6PBw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lS0a3-00APMM-OT; Thu, 01 Apr 2021 16:54:03 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lS0Zy-00APKg-CB for linux-arm-kernel@lists.infradead.org; Thu, 01 Apr 2021 16:54:00 +0000 Received: by mail-pj1-x102c.google.com with SMTP id a22-20020a17090aa516b02900c1215e9b33so3383599pjq.5 for ; Thu, 01 Apr 2021 09:53:57 -0700 (PDT) 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=opZpqvsKBsI6VYq138fXrWfaN6YGeUQyxcS+8w6v06c=; b=zyQRNsvsA9LyQidoA1ch2aMxTysyo4s72aUu6/nXPD6YOT0doXN4COWofYcRSdBXLK fxF7ePO8YBbA1bIPzpxIL0mmgajnn9eT1XlKIN97lsNhc3y0oYb2Lc7icx3Pf1aDnzr/ +sx6AW/ZGNo25YgzOQIuE2/r1Xa7zEAVi42VDyPxtHWv/I6nbOnZkFcsjCerQny1sT2m 0mqdRRXI9xNjCtMgAyv3B0b9OjMphUbiH66QnOihnMF49qQi7b+6pOyrz3GpriebnP6o BxZ22EI/QELKYnvdueqv8l3eg41xRX6W6NRgn3R7SNZLJEFcJ1sg2FO9uaocJwzuouqG n02Q== 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=opZpqvsKBsI6VYq138fXrWfaN6YGeUQyxcS+8w6v06c=; b=XNEdG5olmW2QtKh9H3eNYzjfGwbYoJxxO3Gvwal+DSHXjg8UWmZYao3QNEcHQBMW3Q 7TtBYLebU50reGQZO3myKdLBOelcxVYk7om/sDTuG7UAY492bsI+XOh5HNjj/6jFmL95 ZmvUJJK/YxQKnZLNp1qgbVDlZluuRpkMRUDgbEqEsgnuB8rcrMcWGXW/9Gnr5uEMHO91 WDL5E8qsSIFFs5jaE6NP96/u/cIIHBErgooR5lTzntJt36IAoaOfj5oNbBim+uv40hEK FmfI4etp3xN8L7Jwkob7/amdchNd/T5QGu1Kk+MHFn8eJHqY8G2zydkJxfxCdYBfYhXN bXFw== X-Gm-Message-State: AOAM533+jYUktjNjQt8cBKBgFIgm7g2pBZiaki/2Yld+y/62UZttclon tHan8fb3GJnR1K9re5IeKJXL8ACjChn/iw== X-Google-Smtp-Source: ABdhPJzebmFG08KQlbsAdWpiNfw7N9cydtdTFMIvPyPRVFw/mXPRQEzgELZQ7HN3vPDPmXw8q9kobQ== X-Received: by 2002:a17:902:7d95:b029:e7:3780:3c5f with SMTP id a21-20020a1709027d95b02900e737803c5fmr8793961plm.59.1617296036123; Thu, 01 Apr 2021 09:53:56 -0700 (PDT) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id j10sm5817403pjs.11.2021.04.01.09.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 09:53:55 -0700 (PDT) Date: Thu, 1 Apr 2021 10:53:53 -0600 From: Mathieu Poirier To: Mike Leach Cc: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, linux-doc@vger.kernel.org, suzuki.poulose@arm.com, yabinc@google.com, corbet@lwn.net, leo.yan@linaro.org, alexander.shishkin@linux.intel.com, tingwei@codeaurora.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 06/10] coresight: etm-perf: Update to activate selected configuration Message-ID: <20210401165353.GB145043@xps15> References: <20210316180400.7184-1-mike.leach@linaro.org> <20210316180400.7184-7-mike.leach@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210316180400.7184-7-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210401_175358_754861_8714C3FD X-CRM114-Status: GOOD ( 24.51 ) 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 Tue, Mar 16, 2021 at 06:03:56PM +0000, Mike Leach wrote: > Add calls to activate the selected configuration as perf starts > and stops the tracing session. > > Signed-off-by: Mike Leach > Reviewed-by: Suzuki K Poulose Reviewed-by: Mathieu Poirier > --- > drivers/hwtracing/coresight/coresight-etm-perf.c | 14 +++++++++++++- > drivers/hwtracing/coresight/coresight-etm-perf.h | 2 ++ > 2 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c > index 66bda452a2f4..9128f59864a8 100644 > --- a/drivers/hwtracing/coresight/coresight-etm-perf.c > +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c > @@ -196,6 +196,10 @@ static void free_event_data(struct work_struct *work) > /* Free the sink buffers, if there are any */ > free_sink_buffer(event_data); > > + /* clear any configuration we were using */ > + if (event_data->cfg_hash) > + cscfg_deactivate_config(event_data->cfg_hash); > + > for_each_cpu(cpu, mask) { > struct list_head **ppath; > > @@ -254,7 +258,7 @@ static void etm_free_aux(void *data) > static void *etm_setup_aux(struct perf_event *event, void **pages, > int nr_pages, bool overwrite) > { > - u32 id; > + u32 id, cfg_hash; > int cpu = event->cpu; > cpumask_t *mask; > struct coresight_device *sink = NULL; > @@ -271,6 +275,14 @@ static void *etm_setup_aux(struct perf_event *event, void **pages, > sink = coresight_get_sink_by_id(id); > } > > + /* check if user wants a coresight configuration selected */ > + cfg_hash = (u32)((event->attr.config2 & GENMASK_ULL(63, 32)) >> 32); > + if (cfg_hash) { > + if (cscfg_activate_config(cfg_hash)) > + goto err; > + event_data->cfg_hash = cfg_hash; > + } > + > mask = &event_data->mask; > > /* > diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.h b/drivers/hwtracing/coresight/coresight-etm-perf.h > index ba617fe2217e..468f7799ab4f 100644 > --- a/drivers/hwtracing/coresight/coresight-etm-perf.h > +++ b/drivers/hwtracing/coresight/coresight-etm-perf.h > @@ -49,12 +49,14 @@ struct etm_filters { > * @work: Handle to free allocated memory outside IRQ context. > * @mask: Hold the CPU(s) this event was set for. > * @snk_config: The sink configuration. > + * @cfg_hash: The hash id of any coresight config selected. > * @path: An array of path, each slot for one CPU. > */ > struct etm_event_data { > struct work_struct work; > cpumask_t mask; > void *snk_config; > + u32 cfg_hash; > struct list_head * __percpu *path; > }; > > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel