Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp664789pxb; Fri, 16 Apr 2021 15:14:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwecg6TdmIrKupE+cfjLX/49QPNmLk1krUFx2rdXAJmHmMXhjEBXISnVVir1UnfI6SLeBwj X-Received: by 2002:a05:6402:8:: with SMTP id d8mr12292687edu.368.1618611296668; Fri, 16 Apr 2021 15:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618611296; cv=none; d=google.com; s=arc-20160816; b=TnixZ4cC1uZU7MrlqsVR1oBcNwFnB8b2G3HnggX+x8kjBdP8cJF30U+SkvNcSK4zdf 3+zLBzdbYvtB4pBD2EMvghrWajP9Q4ALRjjwLTIFP5Jxn5uHKgvwxNVx+KDLf9Q10bnq LKqvhKwPtO1nH6p7z/ZbCidFhzxTP7xpQ1CtS/dju4Au+aanTcKhOMIzx+dU1u0+rqnx 9ET4VLU/yY26Cp7wGm2P4SkQtMyY7E24vyLUQXHPeaZhanvJ4/W9kugvcsYQ/K3H4+sn 3ZUrSN+QhLQoe8VRYpucRk6MdkXoAhl28/m2SrHDjRBh03rjcWpPFQAa2ssMP/7QWilB cE3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=wbVr5w+m0wq6wpemlJXA8QMy3cFXwkSRniVfCR6eDCM=; b=X6iJ1/BWXg6IAfKZEEOsNp2smPpe+yHM4frRyzQKGmQJ5qKT0D7SPNzNjSEoAgokg/ 3zqe83ZkGIfLZD6jEq7jzdcloRDRo3qswmIL+GPEWbTmTkosXIOsnctgCCep9G1Mnbch YCkvT1DnUYbEQVOSrK58czUcnF8F064caUp0oHTPJK4gNbNt0lF5mvF/grEgIbTGxBB7 uVa65PXnOnQxKI/byBuDcTKtC9Eg/0maw+LDFicWqxTJnMiNzjoGN7LN34WAPI4qFGqF ZxKKwj/Gu5tqMOxRTxSoEUP3cZS5AUr72PXd9t9JZm/DAWEGLvCzWIlfkwwQbd5ozKWP Z4sQ== ARC-Authentication-Results: i=1; mx.google.com; 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 t5si6068198edd.272.2021.04.16.15.14.33; Fri, 16 Apr 2021 15:14:56 -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; 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 S235416AbhDPWOG convert rfc822-to-8bit (ORCPT + 99 others); Fri, 16 Apr 2021 18:14:06 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:20736 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbhDPWOF (ORCPT ); Fri, 16 Apr 2021 18:14:05 -0400 Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13GM5JIS016105 for ; Fri, 16 Apr 2021 15:13:39 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 37yb5e2wh5-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 16 Apr 2021 15:13:39 -0700 Received: from intmgw001.38.frc1.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 16 Apr 2021 15:13:38 -0700 Received: by devbig006.ftw2.facebook.com (Postfix, from userid 4523) id DC50362E1FDE; Fri, 16 Apr 2021 15:13:33 -0700 (PDT) From: Song Liu To: CC: , , , , , , Song Liu Subject: [PATCH v3 0/4] perf util: bpf perf improvements Date: Fri, 16 Apr 2021 15:13:21 -0700 Message-ID: <20210416221325.2373497-1-song@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-GUID: MFo66io4cSKzW3GvFkLcLXRkj9hJqmHj X-Proofpoint-ORIG-GUID: MFo66io4cSKzW3GvFkLcLXRkj9hJqmHj X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-04-16_09:2021-04-16,2021-04-16 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 bulkscore=0 adultscore=0 mlxlogscore=989 spamscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 phishscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104160154 X-FB-Internal: deliver Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patches set improves bpf_perf (perf-stat --bpf-counter) by 1) exposing key definitions to a libperf header; 2) adding compatibility check for perf_attr_map; 3) introducing config stat.bpf-counter-events. 4) introducing 'b' modify to event parser. Changes v2 => v3: 1. Add 'b' modifier. (Jiri) 2. Allow configuring stat.bpf-counter-events with any event name (instead of limiting to hardware events). (Jiri) Changes v1 => v2: 1. Separte 2/3 from 1/3. (Jiri) 2. Rename bperf.h to bpf_perf.h. (Jiri) 3. Other small fixes/optimizations. (Jiri) Song Liu (4): perf util: move bpf_perf definitions to a libperf header perf bpf: check perf_attr_map is compatible with the perf binary perf-stat: introduce config stat.bpf-counter-events perf-stat: introduce ':b' modifier tools/lib/perf/include/perf/bpf_perf.h | 31 ++++++++++++++++ tools/perf/Documentation/perf-stat.txt | 2 ++ tools/perf/builtin-stat.c | 43 ++++++++++++++-------- tools/perf/util/bpf_counter.c | 50 +++++++++++++------------- tools/perf/util/config.c | 4 +++ tools/perf/util/evsel.c | 22 ++++++++++++ tools/perf/util/evsel.h | 9 +++++ tools/perf/util/parse-events.c | 8 ++++- tools/perf/util/parse-events.l | 2 +- tools/perf/util/target.h | 5 --- 10 files changed, 129 insertions(+), 47 deletions(-) create mode 100644 tools/lib/perf/include/perf/bpf_perf.h -- 2.30.2