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 42D4AC6FD1F for ; Tue, 14 Mar 2023 17:57:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230344AbjCNR54 convert rfc822-to-8bit (ORCPT ); Tue, 14 Mar 2023 13:57:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjCNR5x (ORCPT ); Tue, 14 Mar 2023 13:57:53 -0400 Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 854DB76B4; Tue, 14 Mar 2023 10:57:52 -0700 (PDT) Received: by mail-il1-f173.google.com with SMTP id j6so4590604ilr.7; Tue, 14 Mar 2023 10:57:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678816671; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PpqmR5FGblTUCTS1MnsgIvKqvurAy+dKc3s6nFwCqg0=; b=WuLBA1CrNcteftdXP4OzRssv0UCpwk6bPrQ0I4Lruo+oesHlAcW+EDk4sD/Wy2ey11 1rzJ+aAofPFyvAEUfBXjr8ndpktA/v+vk0d4wLbvgm2gyfo6MssCtxxTMpLYAafz7zli WmJJ54gbJ7JudXr2sH1YLQ1ksEGftDojl2ufB8UUED8vYZLH2QaBY3I4hG76svlpDX70 xgwlSnFxcKLCbgSovXEVao7fBkuwsqY1fAHaVU7gjasENnWGx9a3DC7MfQhWAMSDCEFe /oJ3SX+FF1k2mjSqes6+cvQcVI8Ku7JLhddRMPFK0d0QGLD3RZRbOhAp5eujNDUBmPko qhSQ== X-Gm-Message-State: AO0yUKWuydVyykx40VaMdsBVMe4BK3pOIC3rn4XJPtjyNynWq1Ccl34O hGWwqU/nTELMR4OaN4kvPsY046xURfxZP2nkFs+owLcv X-Google-Smtp-Source: AK7set+oWO7uxZNcxezoNglqkni5RC4P6boAGCI7NJtJfa15OOr/snj7IE8Sbl7MntPQWtOb8fjXbrvF+Xay+KFz390= X-Received: by 2002:a92:d346:0:b0:313:fad9:a014 with SMTP id a6-20020a92d346000000b00313fad9a014mr1969666ilh.5.1678816671660; Tue, 14 Mar 2023 10:57:51 -0700 (PDT) MIME-Version: 1.0 References: <20230307233309.3546160-1-namhyung@kernel.org> <9b2a3f48-44bc-3719-9ba1-b60f9382a5ba@amd.com> In-Reply-To: <9b2a3f48-44bc-3719-9ba1-b60f9382a5ba@amd.com> From: Namhyung Kim Date: Tue, 14 Mar 2023 10:57:40 -0700 Message-ID: Subject: Re: [RFC/PATCHSET 0/9] perf record: Implement BPF sample filter (v4) To: Ravi Bangoria Cc: Arnaldo Carvalho de Melo , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, Mar 14, 2023 at 8:27 AM Ravi Bangoria wrote: > > On 14-Mar-23 5:09 PM, Arnaldo Carvalho de Melo wrote: > > 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? > > I'm fine with both :) Unless there's an objection, I'd prefer you take the v4. I'll send a documentation update later. Thanks, Namhyung