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 4D9A8C433FE for ; Wed, 6 Apr 2022 17:12:50 +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=LzMfPoL7BMMsu2aQ/hH0Pc18umqbf4/8pIF+plwBGzk=; b=L33d0NJGoqInHT Xv+dQte7paqStXS+KiF5XLe7hDNzx2+MFuwrfl245Cxw92ED/cTWekhWTIPqMPvksAC99nOta986G 009d71ZblxtCEtpRSNAzRuoplxhfIPLgf8fj7s8eWfBeQ5iThGnJAV2SfAFXG4vwhlQ7FAB4ZBks6 YQtyStoJPEQKPIKHzCKakcEnGr4ZqVljkVwD2gx6fnon0vX5nsyPkfSEm9CJKc1PHDg6RQj2V4Pz5 M2PEPmdlB/yx5yuRaIWDQdmEd2r+Arxwlz24XpDRJ4guiOyIeJKQjZmcfHrRVNqUmdZ6qHNF5dxh+ gEGHltN2ax6BSL89LpHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc9C3-007Ieq-6L; Wed, 06 Apr 2022 17:11:43 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc9By-007IdN-F6 for linux-arm-kernel@lists.infradead.org; Wed, 06 Apr 2022 17:11:39 +0000 Received: by mail-pg1-x530.google.com with SMTP id k14so2772528pga.0 for ; Wed, 06 Apr 2022 10:11:36 -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=XD5ItTlj29WOcCS4owus3qC0hML8VkaRp6mT60P4fAs=; b=kPmdnsx9LLguRvYL3Ro1Z3H/hbzqUOaaHSA6QYx4TnRIxubdNkfpl5NftPa6B3A32J 0mO2aM/7kIc7ajialM8F0oZMG/15whqn7iEi50wmKl74Rz00zFXIfOe0G6H6w7PuUxT1 ya1QYh2tvdEW3vXVvLy65KQgfaZwXcBOQXjWisRdiZox3pfzQ80wnCGPRPODglkZeAj+ /yegc92v07QiiihtAf04t1N+4o/gz2LOFVvZFKrnF3xashqkZofgO0c8cxzH8lb8BVIn Sd/MNUh2/sRTP7K5lhLD1LibPJJl898v3LOYFGmmvvq5DgiAkne83x5VDbZs+dESUcyp mIWA== 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=XD5ItTlj29WOcCS4owus3qC0hML8VkaRp6mT60P4fAs=; b=6+Dar2LXUHtq1M0I/F1njDmxIlZx97obwS87035qATK3+WFVTbR5K7Fdp4lydv4Vlw 00ROh8eii3Y4nECDXz2va7tvNGKIyPo6SKeCNlcViy9qD+CXEhC35ek0vXlCrxJ7ttMR hF+dIjeM/q5+8tIPMa9nkXhavMeGJY4tQUj04mZb7noDmCTvhBO6eKfk12SqZDYx37OZ C/t1NIbTbnY+T3L/UJF+66eK/g4m0hYbas7P7TdnQNfgqMWdD9RNQUgf/HnhpudqlDW+ W3RqurrMnD9Ha6/MzAi2gsBVdb3R92g3pL2SrF6tob81cCeMWPVNvfQpChGv9ycS84B9 jC/A== X-Gm-Message-State: AOAM532PQGBOM3M+0DRisEKqFzp/u/u2+Jt09IP5pCK1BESiTYWQ8VYK HnDodu7o5DOTo/C6f2hqqVkEeg== X-Google-Smtp-Source: ABdhPJwJhqMpUBciUS7gBInD6rkTovC4c40eFaC1Tma7/9HSbIMAi+pqB0ASIGQskCxTS3WkV0FEGw== X-Received: by 2002:a05:6a00:2304:b0:4fa:dff2:88f5 with SMTP id h4-20020a056a00230400b004fadff288f5mr9944212pfh.11.1649265095918; Wed, 06 Apr 2022 10:11:35 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id 83-20020a621556000000b004fe5d8c5cf3sm1868411pfv.156.2022.04.06.10.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 10:11:34 -0700 (PDT) Date: Wed, 6 Apr 2022 11:11:32 -0600 From: Mathieu Poirier To: Mike Leach Cc: suzuki.poulose@arm.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, linux-perf-users@vger.kernel.org, leo.yan@linaro.org Subject: Re: [PATCH 06/10] coresight: perf: traceid: Add perf notifiers for trace ID Message-ID: <20220406171132.GA16110@p14s> References: <20220308205000.27646-1-mike.leach@linaro.org> <20220308205000.27646-7-mike.leach@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220308205000.27646-7-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220406_101138_547373_981D26DC X-CRM114-Status: GOOD ( 24.25 ) 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 08, 2022 at 08:49:56PM +0000, Mike Leach wrote: > Adds in notifier calls to the trace ID allocator that perf > events are starting and stopping. > > This ensures that Trace IDs associated with CPUs remain the same > throughout the perf session, and are only release when all perf > sessions are complete. > > Signed-off-by: Mike Leach > --- > drivers/hwtracing/coresight/coresight-etm-perf.c | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c > index c039b6ae206f..008f9dac429d 100644 > --- a/drivers/hwtracing/coresight/coresight-etm-perf.c > +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c > @@ -22,6 +22,7 @@ > #include "coresight-etm-perf.h" > #include "coresight-priv.h" > #include "coresight-syscfg.h" > +#include "coresight-trace-id.h" > > static struct pmu etm_pmu; > static bool etm_perf_up; > @@ -223,11 +224,21 @@ static void free_event_data(struct work_struct *work) > struct list_head **ppath; > > ppath = etm_event_cpu_path_ptr(event_data, cpu); > - if (!(IS_ERR_OR_NULL(*ppath))) > + if (!(IS_ERR_OR_NULL(*ppath))) { > coresight_release_path(*ppath); > + /* > + * perf may have read a trace id for a cpu, but never actually > + * executed code on that cpu - which means the trace id would > + * not release on disable. Re-release here to be sure. > + */ > + coresight_trace_id_put_cpu_id(cpu, coresight_get_trace_id_map()); A CPU gets a traceID in event_etm_start() when the event is installed for running. Do you see a scenario where etm_free_aux() is called without previously calling event_etm_stop()? > + } > *ppath = NULL; > } > > + /* mark perf event as done for trace id allocator */ > + coresight_trace_id_perf_stop(); > + > free_percpu(event_data->path); > kfree(event_data); > } > @@ -314,6 +325,9 @@ static void *etm_setup_aux(struct perf_event *event, void **pages, > sink = user_sink = coresight_get_sink_by_id(id); > } > > + /* tell the trace ID allocator that a perf event is starting up */ > + coresight_trace_id_perf_start(); > + > /* check if user wants a coresight configuration selected */ > cfg_hash = (u32)((event->attr.config2 & GENMASK_ULL(63, 32)) >> 32); > if (cfg_hash) { > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel