Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50EB7C7618A for ; Tue, 14 Mar 2023 11:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229789AbjCNLji (ORCPT ); Tue, 14 Mar 2023 07:39:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231395AbjCNLjb (ORCPT ); Tue, 14 Mar 2023 07:39:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 758E781CEF; Tue, 14 Mar 2023 04:39:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2196EB818EC; Tue, 14 Mar 2023 11:39:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80644C433D2; Tue, 14 Mar 2023 11:39:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678793960; bh=luG+2uJ/rehWgapl11w1aqOj1LPV0nhCPrhmlVJlaqE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RXkhavefrxy8Kkr7ZC+k6gzAHH84WV/h2I+deeprYe0k16vqGvv5xft4yt7rNJJdl 0U9VbhTajNezp9sFOLexQKEMNHBNeCYysIfTMbnp8r88BIML6u+qtzieRi0nGielAo 2uPJzTAYkDKJ5CkEvSkfPJ1sstgzvX321RYmUInPRLuVd7cTsTFv+FVD/HMul8d1nw VcEn99+E/0RoS2NcFmwQZSQ7stFP8e24az9aTWJxzJF3rZfQJFGbSbCNuIKE92XqvO 0grc5gQss0yQGXLlWUE+vkJmGHQ730meiWW3ESX1Uz4wx9XWK3vMgmsL1iyx/nSEt+ RIjdrYaP8Lc9w== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id DAE774049F; Tue, 14 Mar 2023 08:39:17 -0300 (-03) Date: Tue, 14 Mar 2023 08:39:17 -0300 From: Arnaldo Carvalho de Melo To: Ravi Bangoria Cc: Namhyung Kim , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Ian Rogers , Adrian Hunter , Andi Kleen , Kan Liang , Song Liu , Stephane Eranian , Leo Yan , James Clark , Hao Luo , LKML , linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [RFC/PATCHSET 0/9] perf record: Implement BPF sample filter (v4) Message-ID: References: <20230307233309.3546160-1-namhyung@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 Fri, Mar 10, 2023 at 12:04:03PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Fri, Mar 10, 2023 at 03:28:03PM +0530, Ravi Bangoria escreveu: > > > It requires samples satisfy all the filter expressions otherwise it'd > > > drop the sample. IOW filter expressions are connected with logical AND > > > operations unless they used "||" explicitly. So if user has something > > > like 'A, B || C, D', then BOTH A and D should be true AND either B or C > > > also needs to be true. > > > > > > Essentially the BPF filter expression is: > > > > > > (("," | "||") )* > > > > > > The can be one of: > > > ip, id, tid, pid, cpu, time, addr, period, txn, weight, phys_addr, > > > code_pgsz, data_pgsz, weight1, weight2, weight3, ins_lat, retire_lat, > > > p_stage_cyc, mem_op, mem_lvl, mem_snoop, mem_remote, mem_lock, > > > mem_dtlb, mem_blk, mem_hops > > > > > > The can be one of: > > > ==, !=, >, >=, <, <=, & > > > > > > The can be one of: > > > (for any term) > > > na, load, store, pfetch, exec (for mem_op) > > > l1, l2, l3, l4, cxl, io, any_cache, lfb, ram, pmem (for mem_lvl) > > > na, none, hit, miss, hitm, fwd, peer (for mem_snoop) > > > remote (for mem_remote) > > > na, locked (for mem_locked) > > > na, l1_hit, l1_miss, l2_hit, l2_miss, any_hit, any_miss, walk, fault (for mem_dtlb) > > > na, by_data, by_addr (for mem_blk) > > > hops0, hops1, hops2, hops3 (for mem_hops) > > > > I think this and few examples should be added in perf-record man page. > > Agreed, and even mentioning cases where it overcome problems like the > filtering you mentioned for AMD systems. So, what do you think is best? Wait for v5 or apply v4 and then add documentation and other touches as followup patches? - Arnaldo