Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4791924pxy; Tue, 27 Apr 2021 12:44:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNEO+DxEc83gxl1CSY5ohr87pThUMIVh/yr7QKIKyR1iwTS7y9esGV2+cnCaw8IqkFTdfc X-Received: by 2002:a05:6402:b88:: with SMTP id cf8mr6437739edb.227.1619552676861; Tue, 27 Apr 2021 12:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619552676; cv=none; d=google.com; s=arc-20160816; b=0Nu+tum4yvR4gk1aqlJE6LX8aHtce940YInLmFioDeXCXQo7bNTGvCUVCIjmzCO+bS BhigxQxmLa/lHpQbFkNc+W9VpMtS+hjfjrHfARx5eWwryEUbgeOQIVR39JXp20hP1oCu uLunlRHgj1eI9I17OlAvTeCED7pZiyEWAVcVgelCiTC8q4Nb+AYDRb5ENhIVvQnewjcH DnkeytU6iITtSiigdY5SKwcPF5hYDpX64UfLJ2IHT3HKwCTDVojtRA6dNmjwSXzR10Nl iHvAip3RCWuDuOYV4OB9WMPOkHu7hyOlRistemxv05/PCE0UzCh9jlKXPAG+fL0EDUh4 S7bg== 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=DIOcEPVX+xHVKsoMgWImq2LQgG1AxCdg1BaWhVBVpIc=; b=jlmwtSea8NS1iQLQMH+xSzNZ1bjElru8leRCq3mDi/XTXbrTFCbGoyRViJh0pnJVV7 LjnA1rIF8MyicdMmqPi2pWgMh/ebRsyWuMGlqH2Oc8vEWeJIHFEphTLeJVULh7DviB+x 5gUMjuOVbFA8OJwls4spOMdO9ylQJCZCcagXoA9si3GCFrGxphWcyCFomBMoHfwyy8SZ 4Uxv//695w3QUlvKMrz16O4h2pLKdar+/3DcKnpM2JofdKGzpYrSDwEMmho4Tem4hDyb N50TdnW1jSxR+icfo/NhPfNoiXTFFHGtrIO7N5NitFzF/Y3C9+ADGqHvtP20VPg2TM+D hO5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="HOlKP1/f"; 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 k18si693799ejv.186.2021.04.27.12.44.12; Tue, 27 Apr 2021 12:44:36 -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="HOlKP1/f"; 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 S238880AbhD0Tmt (ORCPT + 99 others); Tue, 27 Apr 2021 15:42:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:47876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235719AbhD0Tmt (ORCPT ); Tue, 27 Apr 2021 15:42:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 85941611F2; Tue, 27 Apr 2021 19:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619552525; bh=lop0ny1ajUsRVY08u+taCG1Hkvn9+OimS8y9THlwrlw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HOlKP1/f2YSCrPu4FeQGh3oaaDGBLP8fZlwy1V1NuHb7vzhQZl2jlUmKzU4BaPOHb rrJ5i72oGP0TVPBr/OHm6acKeFGpku24YNxRR1xONDgVPX2YgVq+gzwbRnxpMSXbha NXFqdsbvkoKosBMfvDANMrHTD0beVDAQQerzWjLGP5SxeN2dSZqACxcIFRMdE4buzm 39+JQGJT4B/mG5R+LcPoTVfgpZ8kL7TEBiUEDHrXMI39MK6xYXwqHQlfMvgco1T/sG 4AYGnc2EeSoPtJdPy/EFArmsYkAXOKZQY2x8BBSpmijCM49wQFhqYeMAc76S5eXBaX /ivy1IjULO2hw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 61EED40647; Tue, 27 Apr 2021 16:42:02 -0300 (-03) Date: Tue, 27 Apr 2021 16:42:02 -0300 From: Arnaldo Carvalho de Melo To: Song Liu Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, 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: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Apr 27, 2021 at 04:27:22PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Sun, Apr 25, 2021 at 02:43:33PM -0700, Song Liu escreveu: > > Introduce bpf_counter_ops->disable(), which is used stop counting the > > event. > > [acme@five perf]$ perf test -v python > Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc > 19: 'import perf' in python : > --- start --- > test child forked, pid 1497924 > python usage test: "echo "import sys ; sys.path.append('/tmp/build/perf/python'); import perf" | '/usr/bin/python3' " > Traceback (most recent call last): > File "", line 1, in > ImportError: /tmp/build/perf/python/perf.cpython-39-x86_64-linux-gnu.so: undefined symbol: bpf_counter__disable > test child finished with -1 > ---- end ---- > 'import perf' in python: FAILED! > [acme@five perf]$ > > I'll fix this up in my local tree, if you need to respin, please pick > patches from tmp.perf/core, will refresh it later today. Added this: diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 278abecb5bdfc0d2..27940edb161c2d8c 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -100,6 +100,11 @@ int bpf_counter__install_pe(struct evsel *evsel __maybe_unused, int cpu __maybe_ return 0; } +int bpf_counter__disable(struct evsel *evsel __maybe_unused) +{ + return 0; +} + /* * Support debug printing even though util/debug.c is not linked. That means * implementing 'verbose' and 'eprintf'.