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=-15.2 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 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 F3AB8C07E95 for ; Mon, 19 Jul 2021 19:40:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A194C6113B for ; Mon, 19 Jul 2021 19:40:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A194C6113B 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=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=vcoD/YyN5w21f4LaLNk3dirY83g7fgKgsmyOo80oq1w=; b=b2WhP/9LG2eLxZ TfrtH0C8M/IYZe1Zxuf67Q9GWoLZU5G9lrFlgdF7E9V6jcNOZ3/HMP1ZL6zPtBYrZ9+sdcuzBorFZ 1zBVa1mkHFp0cUQt+iBsxzeEi1Gk4uCP0YF88h7pZWovQ9pXoYXsfq9k4Bp5/j/lxOiSONsmhyyrF fn7XgkAnzlP4Vhd00LhpUxZiYlviDe8ShHndKAjDnXMRiSATWBoAu8dSyEUaFsV7KMi1RVcmpQJ9k btoREpH3CD0GI2ftF9cKKF939lez9HWFflU9UL/DVZERzYajf04p5PhklIBAeQ6rdMITJbf3lqv+n em5o28gkuf+KTSQXjFQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5Z5W-00B7nu-C6; Mon, 19 Jul 2021 19:38:02 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5Z5Q-00B7mO-MG for linux-arm-kernel@lists.infradead.org; Mon, 19 Jul 2021 19:37:58 +0000 Received: by mail-pl1-x62c.google.com with SMTP id x16so10150176plg.3 for ; Mon, 19 Jul 2021 12:37:56 -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=aJC6T1mr3FGK6VqXqqxg5TyKpiauehuu55lXlzMhFnA=; b=NNKlQu8JwjSEDoWa8NuqtgLa1KcftHc9HZPFjLFddHljAkmyao2v2BRSn7PUg2holy t6upJGhs7E8TUCsiwXfdEreLoml1zao10eTQ7lG7n383nurGN3bzlcwbmLdT5aEEBv6Z sCVn1EMKL9zEuESFYr7pF0kfijHTOmJHiqoFebNF30aLpa2iwFnDpVlEhQkCK5g1xm/T 52TBbbxMdE7l/JUelVkS8I7a6uEF5dviruC9JjioqtOqjP05GEE08URhkXL4naCWNmMU pWy/WE/hiZ0YzoU3qs2lwLfB8WLFqHum1bwwGBYNaONDsTXqpXKCJij2wqKXfl7Iyebe wPdQ== 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=aJC6T1mr3FGK6VqXqqxg5TyKpiauehuu55lXlzMhFnA=; b=eAGmdQWRLnf0gYWCsHqy7VY6qqUoDHP/OD7Ew8VwL7pPnxbsslOaQppIIhUfqgE4KP YYIZ5qPIm4a4pjyL3vC8gr7E7L0jWDOqq5OOUla2lh1FRyjoyaSlicu/iBGEm6E7BYq0 S/H/nW2gm/4cjd3JN8dK3ecRc7o5dTwvz+eTpTPPyzeIbhGUQq/V3M36TjmsjA4Q4W6Z L8FV/bFJrkg1srM+G7A3q9MGXoFZBpB+bdy3yq8fhcWlWDz3kSByPikxtemX6EQ5ay8d mBZ9tXdd5x3TQBEd8F8YgO/HurMM+ekrW3SlTZfksYQZT4w/HWze2P10YGbsxz7K9EIS dg5w== X-Gm-Message-State: AOAM530yRPbqdBi/dPKz3Utk4MBRCQpS9xKm6o5Gge8aziso74ji50VZ 1XgsHOHwd9bGCK+ntv/fuTsW5j76CVoHkA== X-Google-Smtp-Source: ABdhPJx98p4kOlM/+xDrMCKSzmp8+10vnluYvU1C2qB2NSKZiPEOl5tpq7ByXoK7PtZyk/1K9Y0U2w== X-Received: by 2002:a17:902:b210:b029:11a:bf7b:1a83 with SMTP id t16-20020a170902b210b029011abf7b1a83mr20462143plr.84.1626723475799; Mon, 19 Jul 2021 12:37:55 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id g17sm7810842pgi.70.2021.07.19.12.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 12:37:55 -0700 (PDT) Date: Mon, 19 Jul 2021 13:37:52 -0600 From: Mathieu Poirier To: James Clark Cc: acme@kernel.org, coresight@lists.linaro.org, leo.yan@linaro.org, al.grant@arm.com, branislav.rankov@arm.com, suzuki.poulose@arm.com, anshuman.khandual@arm.com, Mike Leach , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] perf cs-etm: Refactor initialisation of kernel start address Message-ID: <20210719193752.GB2255168@p14s> References: <20210713154008.29656-1-james.clark@arm.com> <20210713154008.29656-2-james.clark@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210713154008.29656-2-james.clark@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210719_123756_826854_7BCFE2DB X-CRM114-Status: GOOD ( 27.75 ) 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, Jul 13, 2021 at 04:40:03PM +0100, James Clark wrote: > The kernel start address is already cached in the machine struct once it > is initialised, so storing it in the cs_etm struct is unnecessary. > > It also depends on kernel maps being available to be initialised. > Therefore cs_etm__setup_queues() isn't an appropriate place to call it > because it could be called before processing starts. It would be better > to initialise it at the point when it is needed, then we can be sure > that all the necessary maps are available. Also by calling > machine__kernel_start() multiple times it can be initialised at some > point, even if it failed to initialise previously due to missing maps. > > In a later commit cs_etm__setup_queues() will be moved which is the > motivation for this change. > > Signed-off-by: James Clark Reviewed-by: Mathieu Poirier > --- > tools/perf/util/cs-etm.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c > index bc1f64873c8f..4c69ef391f60 100644 > --- a/tools/perf/util/cs-etm.c > +++ b/tools/perf/util/cs-etm.c > @@ -62,7 +62,6 @@ struct cs_etm_auxtrace { > u64 instructions_sample_period; > u64 instructions_id; > u64 **metadata; > - u64 kernel_start; > unsigned int pmu_type; > }; > > @@ -691,7 +690,7 @@ static u8 cs_etm__cpu_mode(struct cs_etm_queue *etmq, u64 address) > > machine = etmq->etm->machine; > > - if (address >= etmq->etm->kernel_start) { > + if (address >= machine__kernel_start(machine)) { > if (machine__is_host(machine)) > return PERF_RECORD_MISC_KERNEL; > else > @@ -901,9 +900,6 @@ static int cs_etm__setup_queues(struct cs_etm_auxtrace *etm) > unsigned int i; > int ret; > > - if (!etm->kernel_start) > - etm->kernel_start = machine__kernel_start(etm->machine); > - > for (i = 0; i < etm->queues.nr_queues; i++) { > ret = cs_etm__setup_queue(etm, &etm->queues.queue_array[i], i); > if (ret) > -- > 2.28.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel