Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3975210pxy; Mon, 26 Apr 2021 14:31:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhtiBIWi6PPaCyHd1qJ6Zv6oHLdtWqLSjvSXqzikJiIGjaGuk3aH4gHRxExPziOhNJzR+M X-Received: by 2002:a17:907:a057:: with SMTP id gz23mr7530529ejc.395.1619472675554; Mon, 26 Apr 2021 14:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619472675; cv=none; d=google.com; s=arc-20160816; b=RUA+0hpWvULidmmM0PtWDtIkp1Gdsw3fXOhxNX/YRt+5WB501OjMCY5M75Q6jRdVPy BDYEPngoGUSIxEg1855AzvoxcXI/aaYGNmELCDANVMyRDULyZNjzTv8cD5UAtOJTVmDi SVXpabK0CHADAskgcbHjMTvJZkf/jbA+TvJAjx7ssqCn/oYbopw0owyIsqdXMjScBoMv 7cqwnK2yXCTQ/TSF9eH1MSXxDjellp5nNHTUpGsiU1k32Gcl5UYuNd5hj0oibdVL8SNO Je7zSOZnYHkcRne1VoRxmI9WkS21cc5dCfQ0OdbZopfTc981MkEAXFu/4CkrPKlO5aG7 pMGw== 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=o3JpOlUQxKikE6j4QEgKul9bAOYHZGdHCW6yEmwN6gQ=; b=i7PetW5rQ9qTRYGl5Udd1liiayqxNomogvAJYCHDvlO3/47W0cPn7nDw+aSi2a1Xgb vBtvhe4ww8MP2zfOBr/xgyUVIJL1QrTCQuwpjm+GQZGNE+Kl8kEF99h7cCmgPbZKETXk T6ZeSG0v0xWsybX8pQRGoNHgmeTQvd9ffRDoJjHLDsP/hvTRIMw2GvFlvIvMZiHdTchT Xv/BcyFiW3PcW7NACz38kiIH6PGyeVULcvKY0GkJLNZ/k4R4Kgz2aWrpq2YeS/539kwV jr4XIKJKSyP4O5F6bkRK0c7Z5M3GkaB8M7KVezPmQnqqFwnX0UUNqtq458rG7ORl+/cN b0Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U+euS1wj; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si1887453eju.632.2021.04.26.14.30.51; Mon, 26 Apr 2021 14:31:15 -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=@redhat.com header.s=mimecast20190719 header.b=U+euS1wj; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234458AbhDZV2Y (ORCPT + 99 others); Mon, 26 Apr 2021 17:28:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60683 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234146AbhDZV2X (ORCPT ); Mon, 26 Apr 2021 17:28:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619472461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=o3JpOlUQxKikE6j4QEgKul9bAOYHZGdHCW6yEmwN6gQ=; b=U+euS1wjh3EGrhi514bTUC7ElRNFDwdjiv/LEh3EfmaIaNjcmtrCUk2mCNuqTxyQ15wH+B oxHeBIDvp8AAcUSQOuVJH2WlvxEYsF7TmMX1Zj2Zn8ID50DMWUIKIA+ZPHXtfscvNFfOHx rt+U4eVdJpJMfgUAoFDzLXVYxQ05yIc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-Kug2PHRzNzCy8RzPRlPTAA-1; Mon, 26 Apr 2021 17:27:38 -0400 X-MC-Unique: Kug2PHRzNzCy8RzPRlPTAA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A563D1922964; Mon, 26 Apr 2021 21:27:37 +0000 (UTC) Received: from krava (unknown [10.40.193.34]) by smtp.corp.redhat.com (Postfix) with SMTP id BFE2218A73; Mon, 26 Apr 2021 21:27:35 +0000 (UTC) Date: Mon, 26 Apr 2021 23:27:34 +0200 From: Jiri Olsa To: Song Liu Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, acme@kernel.org, acme@redhat.com, namhyung@kernel.org, jolsa@kernel.org, songliubraving@fb.com 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210425214333.1090950-6-song@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 25, 2021 at 02:43:33PM -0700, Song Liu wrote: SNIP > +static inline int bpf_counter__disable(struct evsel *evsel __maybe_unused) > +{ > + return 0; > +} > + > static inline int bpf_counter__read(struct evsel *evsel __maybe_unused) > { > return -EAGAIN; > diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c > index d29a8a118973c..e71041c890102 100644 > --- a/tools/perf/util/evlist.c > +++ b/tools/perf/util/evlist.c > @@ -17,6 +17,7 @@ > #include "evsel.h" > #include "debug.h" > #include "units.h" > +#include "bpf_counter.h" > #include // page_size > #include "affinity.h" > #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? jirka > + > /* Disable 'immediate' events last */ > for (imm = 0; imm <= 1; imm++) { > evlist__for_each_cpu(evlist, i, cpu) { > -- > 2.30.2 >