Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp47985pxb; Tue, 31 Aug 2021 14:50:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoYAU4ch7ZwnTpYf/yCyRCBkW0SzNFySgvGE3xFp8x4W2pPXdY9wLi7I4Kg2yqJFR71Z8M X-Received: by 2002:a17:906:8481:: with SMTP id m1mr33592752ejx.459.1630446614646; Tue, 31 Aug 2021 14:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630446614; cv=none; d=google.com; s=arc-20160816; b=GKZi4rKn08hy8kUIJB+K4FOftM2IGdUsycJ5RYntJi0Yfo+AtAj40dlC+ZCTnrhDR5 OMe8wlt3sKnciJI3B2jeB8MQHU+ufSO50L8mHfC53ceBK1OI4CXGCE7G0shoavTiB4QR kGv1dcSpxufY3TQBwRaEAFO1nOOlw0Fy8otEXQFOIw3ZlhrXElmzL2WV2m18Svb42Qj+ LzSF/+Pl7STDcZ9tY7R7CcnSDKL6Qo9KyYrM2Z5x0uC0P06+pBGMaIl6W+exBLPmN9XB 0wdYoIYNl253D660cNGw2Hj19iO3zf8e/F8/MA/aGqQzrb++KGQTEon74WQJH31aqpr5 RDUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=io+U8qlsh8keoHcOuRKmkyPnbCwx2G1S/d8cwuLUSng=; b=IyO2tbLsl2P54hzA5ElZtHemySbTyX9CnKaZX0k1oqxLBEm493acuv2+3bDEUSbpcB s0rQrzTMFiQh2uTf5Wymdr+N5Aa8FW4j62Qd3BO0VpXDKyqhNvr8AhwG8U0oCKujKekA akexHbhIbHJ0TAyZnMy71tCdZrwg3sqehH4ZQQ39zvFoFF3/tnUpzPYFreuq8iUVGNyV bu3N50v2s9wCslI8PiEXsRDCDB3CVMxEjlkZUY995JdMcoMzW6OO4aKV5EDNVHxzw4Jh nphV0rQOHPMf4R/9j5jwfNVUFcuUZxOt66UUCVbbXmlDngPFBOI2vofZ2V2XM424c9RE Mztw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XViDsM1W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si25981646edj.204.2021.08.31.14.49.46; Tue, 31 Aug 2021 14:50:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XViDsM1W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232016AbhHaTvX (ORCPT + 99 others); Tue, 31 Aug 2021 15:51:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:57746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbhHaTvV (ORCPT ); Tue, 31 Aug 2021 15:51:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7075160FE6; Tue, 31 Aug 2021 19:50:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630439425; bh=ekHRx31xM7F0lGz1VDIoOTtbt1ej1vJeqD8rSC0v11U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XViDsM1Wyg0Ma+Qekrqx4vg4No3lgCD3GyUoAgVAeQy+FFTRUZVYnwrkfw63ua8nc apcjV4sJDHSWGkFhCfukmsjyLJwN5eOBMzrhHnkusyMKF9SDL332oTUk8qhtmE6Gii VRXx9TyipzApKPODqD+ir57qsMO4XEE7B12VI3wxSItc1tlsVhkxyeJf+Zz77e2DIx tu7ILb+mjvv3I/Roynx4Dg7ytD7HhZAkM1AJeZuW7yzdS9UcLR3SSBmiFQvID+1ynt YChg98MAiRff6OQv/+JfzIqmvAZXlKOAUZk6lXVb9zwfbjYDMYaXQ8liKStBdLv3ZV N7EWauc3U0G7g== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 2D9754007E; Tue, 31 Aug 2021 16:50:22 -0300 (-03) Date: Tue, 31 Aug 2021 16:50:22 -0300 From: Arnaldo Carvalho de Melo To: Riccardo Mancini , Song Liu Cc: Ian Rogers , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [RFC PATCH v1 23/37] perf evsel: move bpf_counter__install_pe to success path in evsel__open_cpu Message-ID: References: <64f8a1b0a838a6e6049cd43c1beafd432999ae57.1629490974.git.rickyman7@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <64f8a1b0a838a6e6049cd43c1beafd432999ae57.1629490974.git.rickyman7@gmail.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sat, Aug 21, 2021 at 11:19:29AM +0200, Riccardo Mancini escreveu: > I don't see why bpf_counter__install_pe should get called even if fd=-1, > so I'm moving it to the success path. > > This will be useful in following patches to separate the actual open and > the related operations from the fallback mechanisms. Looks sane, applied. Next time please use git blame to find the author and add him to the CC list, like I just did, so that the mistery can be unveiled or a duh! uttered :-) - Arnaldo > Signed-off-by: Riccardo Mancini > --- > tools/perf/util/evsel.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c > index d2b0391569286080..3e556afed8dd396c 100644 > --- a/tools/perf/util/evsel.c > +++ b/tools/perf/util/evsel.c > @@ -2009,8 +2009,6 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, > > FD(evsel, cpu, thread) = fd; > > - bpf_counter__install_pe(evsel, cpu, fd); > - > if (fd < 0) { > err = -errno; > > @@ -2019,6 +2017,8 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, > goto try_fallback; > } > > + bpf_counter__install_pe(evsel, cpu, fd); > + > if (unlikely(test_attr__enabled)) { > test_attr__open(&evsel->core.attr, pid, cpus->map[cpu], > fd, group_fd, evsel->open_flags); > -- > 2.31.1 -- - Arnaldo