Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2932652pxy; Mon, 3 May 2021 11:10:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRcUTBGduCCnchwsBgywXK1s84BtGp5zMdaYiPCyNJfVZev0RZo/tSJSSUI3IfRihPNOq+ X-Received: by 2002:a17:90b:1e10:: with SMTP id pg16mr31825352pjb.30.1620065417789; Mon, 03 May 2021 11:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065417; cv=none; d=google.com; s=arc-20160816; b=D/6rwtFXWfOkbrG632i1uAkhKKavCc8W0Wp/hSoD+4QBfr8bRJoj2jM6zGKbxSsQmF kkXMrlhSSKiEzjLXOtCom2iyUt0Fq1vbMZWoJYXKnmw6r2EoyBOAsF4kj+uJS1iR5UHn TigEJ5Cf9E/Pd0KbSN5lHXmZoGi4dMd6xA+dS+YWnB3Lq0WoC1j0IsGp/zQa1k4Sl9Sg DUaOa2/x4HNeo208ZRoaPm+fhaYjLnrwJHEJooSz65zw8Q3/xAtsV519KeMRHKKjhOQW mctLFbJbg+hFdIeDQ9ZXRe+4Tqmg7pvGN119UHwbAjwKWfVJO4QMEh8XWsq+DUr1P2Bt mnxg== 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=8ODAUTBGY/bFaoZoYF6KAspC6x8l7tnJX0RcvFpBQWU=; b=houkTbiK+/wLg0lXIgD3Sexx+K3IWW5QhZNSHI9z6tcKJryxW0PZunpViQZiSgTqim /PakGf+Bb0aWAL6ssWWy/7Q0ZOUvmYKBgnNJtHGbEOvh66NkIn7i8GPZzg5HuHJBBCt+ cu7CWZcSKk8nfzlDPvv+c49ZIdq/Fv2GxA7TyEuRodbZ6WvYUn4tEyq34w233UHzuyI4 CG/tnNzIUF4fAz6YewZn2JJOnexX/8YswLLC69z6zC53P3yUByFfZNSBjGJOTvDAODJU /eDUN8iL0g31rojvRz8GLOFGmsPQv+CS04Gs/MZscILNEAC0T607ALgX9FlAFTiqsyUM sIFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hmxTuwy6; 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 i21si394381pgl.235.2021.05.03.11.10.04; Mon, 03 May 2021 11:10:17 -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=hmxTuwy6; 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 S230375AbhECP0U (ORCPT + 99 others); Mon, 3 May 2021 11:26:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:42456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbhECP0U (ORCPT ); Mon, 3 May 2021 11:26:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D879F61208; Mon, 3 May 2021 15:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620055526; bh=zCIrm6nO8yuNNKJziohZPZ1FG7y97trbGgxfNMA/Txs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hmxTuwy6R9cYo2uCdEDi/sAuQ3YPToNzWZyvWKTTqC37G39+FN4+Aw2RZgF4MhPCB lVp+xi6gqHO5zKrWpPLGLDuBctjakJLkfe4Fi8hwSsLrk3q8wjfqtE2N8yixwjn/S0 t8PY4uZZ7Dgng5OQKRVjSZCNhFDILSWJsOmIXwS2LaY1j7WvC6/ThfD8uqr6DV+PJt okKD5ZbwZfOq5DynjlhrWIos8aAuqTSiZWkytS/O1g1HCbszv9Fir5guRDksTU/0Uh hNaC3rNqEAAueSe1H2zwFE7tg57zjeBy0eDuLBA52t38pNEKgdjMbaU2leudtYUHG0 fZgMFmXEC/1Og== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id D8DFF41084; Mon, 3 May 2021 12:25:22 -0300 (-03) Date: Mon, 3 May 2021 12:25:22 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Song Liu , Song Liu , "linux-kernel@vger.kernel.org" , Kernel Team , "acme@redhat.com" , "namhyung@kernel.org" , "jolsa@kernel.org" Subject: Re: [PATCH v5 5/5] perf-stat: introduce bpf_counter_ops->disable() Message-ID: References: <20210425214333.1090950-1-song@kernel.org> <20210425214333.1090950-6-song@kernel.org> <5257A59A-CC47-4CA7-9C15-CD6E20DC4BD0@fb.com> <7DBDECAE-D100-44C0-B5D3-DE48631430B5@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, May 03, 2021 at 04:09:45PM +0200, Jiri Olsa escreveu: > On Thu, Apr 29, 2021 at 10:40:01PM +0000, Song Liu wrote: > > SNIP > > > >>>>> #include "../perf.h" > > >>>>> @@ -421,6 +422,9 @@ static void __evlist__disable(struct evlist *evlist, char *evsel_name) > > >>>>> if (affinity__setup(&affinity) < 0) > > >>>>> return; > > >>>>> + evlist__for_each_entry(evlist, pos) > > >>>>> + bpf_counter__disable(pos); > > >>>> I was wondering why you don't check evsel__is_bpf like > > >>>> for the enable case.. and realized that we don't skip > > >>>> bpf evsels in __evlist__enable and __evlist__disable > > >>>> like we do in read_affinity_counters > > >>>> so I guess there's extra affinity setup and bunch of > > >>>> wrong ioctls being called? > > >>> We actually didn't do wrong ioctls because the following check: > > >>> if (... || !pos->core.fd) > > >>> continue; > > >>> in __evlist__enable and __evlist__disable. That we don't allocate > > >>> core.fd for is_bpf events. > > >>> It is probably good to be more safe with an extra check of > > >>> evsel__is_bpf(). But it is not required with current code. > > >> hum, but it will do all the affinity setup no? for no reason, > > >> if there's no non-bpb event > > > Yes, it will do the affinity setup. Let me see how to get something > > > like all_counters_use_bpf here (or within builtin-stat.c). > > Would something like the following work? It is not clean (skipping some > > useful logic in __evlist__[enable|disable]). But it seems to work in the > > tests. > sorry for late reply, but I can't no longer apply this: > patching file tools/perf/builtin-stat.c > Hunk #1 FAILED at 572. > Hunk #2 FAILED at 581. > 2 out of 2 hunks FAILED -- saving rejects to file tools/perf/builtin-stat.c.rej > patching file tools/perf/util/evlist.c > Hunk #1 FAILED at 425. > 1 out of 1 hunk FAILED -- saving rejects to file tools/perf/util/evlist.c.rej > ah, I see the patchset got already merged.. not sure why I'm doing review then ;-) Hey, sometimes this can happen, sorry. Song, please submit on top of what is upstream. - Arnaldo