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=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 27E45C433DF for ; Mon, 27 Jul 2020 20:36:12 +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 DBC302070B for ; Mon, 27 Jul 2020 20:36:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HsB4X8JZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="V1tC07P0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBC302070B 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=DwUhjRpowRd6OB1mxuXzF+kcxrIJa3yMWRD+eOGoryA=; b=HsB4X8JZuvveTHx28zzz/l+mI 9RgCz6KWPh21NwGsMQodGStLgPhc0eLTTzVV0GkirClz+p61M8eF/7h24VL1OsvD41gSyQAwo/bqn x70cxSR64EPFatLIUh5BzMSncUhDpi+4zHMRFhf52GsinvHauHABkyLMHV7ppJzGc7yHgLusXVPeX dsQEmEr4dN1Y4uXn5fL9QmPzeTfu8vBJVWR5aLfGkSNE4g1Q5K98tFcNNTD+YC71a0z6REps4c/Kl 9L0Kddivu4O/3clNpT2YFJi8SJIyUF0v1ZS9G8un4/D68xVV44uqoRLyMBKnId9e9vgN04Br0vyDJ 65rrLbc7A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k09pc-0003g2-J6; Mon, 27 Jul 2020 20:34:44 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k09pZ-0003f9-Pl for linux-arm-kernel@lists.infradead.org; Mon, 27 Jul 2020 20:34:43 +0000 Received: by mail-pl1-x644.google.com with SMTP id l6so8765275plt.7 for ; Mon, 27 Jul 2020 13:34:41 -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=WP0fLNy8D403ScB05mOHvlfIuI3Tu9/pHzHxCWbIkXw=; b=V1tC07P0C1HuxAi2wM10iFmcSTSGt/L09OuGoLRIA+huxAJ9JDkQx46T24Kiil1Ax9 ljXCLhT5b3mRb79bGD5X+jBT1yaP6I68UFGizDP39qT9H3jukxUJGycy0GGEFQXofdpB VNYb7sLf6NsspCGNAr+qsl1L84hfDyttllEeEOTufecX7TnOrNJhjLxQEaexkgngOhsy G7M34PMqr83wMpore2LkQSoRqKpxBlys/MG/S6UWytgdsS4xiVpxgfnTfTL/3aayVBUk wi1pQb0/kef9Abs94i1a3DSTdga7caEIMxkqY8JKCY+iu8REwl1y+QzVQ67iCuDAnfd/ bm/A== 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=WP0fLNy8D403ScB05mOHvlfIuI3Tu9/pHzHxCWbIkXw=; b=qA6o98rVesCPNaiaL3unrXM1cxSf9c1DGHeKVBOH3d9Gb3JYLhXO0fCoFCgac7FzQk sElfimCXepRA1WOMariAD+H02A4bnSl34NnJYQtwJv7tOn8DSGi1gwW57HlmcRoWphgt bJpTBTgGcq6k3X9PUeF1sEhc06ZgwLRhIHNGP/uOcKDS98shaM1uRBi5eW/i34yW7d2P V2Wu8YB64Fo0n+EZJTZAB3dbWxuqg9IAAlxJ7uerW8uBfTAQtmuZsHlOEuiJsy2vYNHJ /Vh3m8ELtmIR1LkVwUy7qQFCzGdRQEs7FiTnT2dUtwG5Tm+zP/6X3E39MgdUtqdXiJ1l b8NA== X-Gm-Message-State: AOAM531TM5IB7B2hrR/bUiuriPUbTATK3MnYWsLhckkbp+K0zgAwtRxW y5Y5IE5emABEZijpLMZfsRUbOA== X-Google-Smtp-Source: ABdhPJyF7g2Ad/CT2Y8o0gkeq9t2s5jq5sTKFwMKXA2IC7jBq7CmWYJ0t0OAvdUGzK0Mp0fsg2NehQ== X-Received: by 2002:a17:90b:247:: with SMTP id fz7mr942456pjb.17.1595882079803; Mon, 27 Jul 2020 13:34:39 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id b21sm16520817pfb.45.2020.07.27.13.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 13:34:39 -0700 (PDT) Date: Mon, 27 Jul 2020 14:34:36 -0600 From: Mathieu Poirier To: Wei Li Subject: Re: [PATCH v2 2/2] perf tools: ARM SPE code cleanup Message-ID: <20200727203436.GC2381376@xps15> References: <20200724071111.35593-1-liwei391@huawei.com> <20200724071111.35593-3-liwei391@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200724071111.35593-3-liwei391@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200727_163442_555584_9B389B14 X-CRM114-Status: GOOD ( 25.16 ) 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: Mark Rutland , Kim Phillips , Suzuki K Poulose , Alexander Shishkin , guohanjun@huawei.com, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , leo.yan@linaro.org, Namhyung Kim , Jiri Olsa , linux-arm-kernel@lists.infradead.org, Mike Leach 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 Fri, Jul 24, 2020 at 03:11:11PM +0800, Wei Li wrote: > - Firstly, the function auxtrace_record__init() will be invoked only > once, the variable "arm_spe_pmus" will not be used afterwards, thus > we don't need to check "arm_spe_pmus" is NULL or not; > - Another reason is, even though SPE is micro-architecture dependent, > but so far it only supports "statistical-profiling-extension-v1" and > we have no chance to use multiple SPE's PMU events in Perf command. I find the above changelog somewhat out of touch with the patch itself. The only thing that is happening here is the removal of a useless check and a fix for a memory leak. Once again whether Arnaldo wants to make the changes by hand or not you may have to resubmit. Reviewed-by: Mathieu Poirier > > So remove the useless check code to make it clear. > > Signed-off-by: Wei Li > --- > tools/perf/arch/arm/util/auxtrace.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c > index 28a5d0c18b1d..b187bddbd01a 100644 > --- a/tools/perf/arch/arm/util/auxtrace.c > +++ b/tools/perf/arch/arm/util/auxtrace.c > @@ -57,17 +57,15 @@ struct auxtrace_record > struct evsel *evsel; > bool found_etm = false; > struct perf_pmu *found_spe = NULL; > - static struct perf_pmu **arm_spe_pmus = NULL; > - static int nr_spes = 0; > + struct perf_pmu **arm_spe_pmus = NULL; > + int nr_spes = 0; > int i = 0; > > if (!evlist) > return NULL; > > cs_etm_pmu = perf_pmu__find(CORESIGHT_ETM_PMU_NAME); > - > - if (!arm_spe_pmus) > - arm_spe_pmus = find_all_arm_spe_pmus(&nr_spes, err); > + arm_spe_pmus = find_all_arm_spe_pmus(&nr_spes, err); > > evlist__for_each_entry(evlist, evsel) { > if (cs_etm_pmu && > @@ -84,6 +82,7 @@ struct auxtrace_record > } > } > } > + free(arm_spe_pmus); > > if (found_etm && found_spe) { > pr_err("Concurrent ARM Coresight ETM and SPE operation not currently supported\n"); > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel