Received: by 2002:a05:7412:1492:b0:e2:908c:2ebd with SMTP id s18csp750453rdh; Wed, 23 Aug 2023 13:55:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpCV7gm2bj29FFeJOAOOyzIvL7A1v7H9UD+kWYJKunvpgqrQRFSyS61bOnzF1r2O9r8nb7 X-Received: by 2002:a5d:678d:0:b0:315:a17d:dbc6 with SMTP id v13-20020a5d678d000000b00315a17ddbc6mr11047036wru.14.1692824102919; Wed, 23 Aug 2023 13:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692824102; cv=none; d=google.com; s=arc-20160816; b=hUIHiR1ZMSxGrUnxNbjlcJdSgX7S5LKNrCWxmKcUrxFzp6Q0C+tBkG0iOwtsVKgZrH ANjCxrtsNtFdu33V9i49bV7WwBxkMiXP/ukorlDtPl+nLsGzlEF+uJ9hivCG7NxTSQrN eLqOKXE6+S7sgO3cGXmJqguW5RTSLijkDzmnJrINKyp4PHLnRyDyy1oeewbJtUNmo199 BLVYP1YP99AWL0wZgph7ouvx8LzvhK4aJvFy7y6Aro9ixvnpxZsF4eiVv34597iq4PsD o5iyZb48sEXoiRy/zXkXwDeyRAvypV7nex107xraD8l7awJCkke70dF4fZg9uyJOsP22 Yd5g== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lt70ooSYAub/5m3xlTPQfUsgxUBU3dOPg9vNxBtg3qw=; fh=b4qfHFR2EvxwG6zy1OBRVFsoxO1jd3xKTlzplUU0k4g=; b=V8avQje2tSJUg8lO6ZrwdAOPwiTbCPNPEc5k+jY9/+1oCHZlA+T0I36mbYpOD2UA7C IzKixA2gXPsVsn6rrY83Xn6DHszcCBv6ZrviERlqyC6IBtowl9100YRIDwtXQCLgfN7V /ebhaE+VDzbDMeO1MtuQzSsnQYQcEG9nweWJDftgb2BCXf5QtOsR1UcIeB36B1OFaJXt z98c25nGDvZ6/O3aOk2GLhSGFmIeJ7SYVxHDHB2rHyQDQvB/WbKEJHNVUYUbqzOmOIGD N+J39ohtpUjVIlaqovVNqx5Nr1+bxWwjJQvEOyWMnDNQ75f7plXs9d0MINqIgubm2fXV JB4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FFiQ3GR2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m10-20020aa7d34a000000b0052548800d54si9144250edr.265.2023.08.23.13.54.36; Wed, 23 Aug 2023 13:55:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FFiQ3GR2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234396AbjHWLf4 (ORCPT + 99 others); Wed, 23 Aug 2023 07:35:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231717AbjHWLfz (ORCPT ); Wed, 23 Aug 2023 07:35:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C239710FE; Wed, 23 Aug 2023 04:35:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 846F36604B; Wed, 23 Aug 2023 11:34:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BA5CC433C7; Wed, 23 Aug 2023 11:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692790486; bh=X+mD8swD/B1r/WRr0uFCG3p2J8HJeLmr49XtjHrY3rg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FFiQ3GR2WJwIDQIqUsxJjDMCH2ORBgAT83hGsRoK5oPSChQPW4l3qR1YRM57zy4Op yOEftZUgZsehgNUDUAYyh2WHGGUeIV7g8/9iuLQeSecG+YxnpDLvl/euLaf+SfeoSZ XshcwZurmE9w6FKZbKQ83Ye3j2d5Jl8y+huK6lFwEhd7wmU6wObKp+r2xbjUuQmLDF iFI+4WjWaTHI2miFjqnzKBughovclp7caSW2TjoQ8pM7aYEzu2ltABCv8SSHsfWRrr PNkMUw2SmCnTTpSlUtkCz6vbPp4ypLGH03btzxdTVLp9XAsUhR2mEEYzYrD0W9iy+0 743CN/c2mv4sw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 09DBD40722; Wed, 23 Aug 2023 08:34:44 -0300 (-03) Date: Wed, 23 Aug 2023 08:34:43 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Jiri Olsa , Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Athira Rajeev Subject: Re: [PATCH 2/2] perf test: Add perf record sample filtering test Message-ID: References: <20230811025822.3859771-1-namhyung@kernel.org> <20230811025822.3859771-2-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Aug 22, 2023 at 05:50:26PM -0700, Namhyung Kim escreveu: > Hi Arnaldo, > > On Tue, Aug 15, 2023 at 10:42 AM Arnaldo Carvalho de Melo > wrote: > > > > Em Tue, Aug 15, 2023 at 02:30:18PM -0300, Arnaldo Carvalho de Melo escreveu: > > > Em Thu, Aug 10, 2023 at 07:58:22PM -0700, Namhyung Kim escreveu: > > > > $ sudo ./perf test 'sample filter' -v > > > > 94: perf record sample filtering (by BPF) tests : > > > > --- start --- > > > > test child forked, pid 3817527 > > > > Checking BPF-filter privilege > > > > Basic bpf-filter test > > > > Basic bpf-filter test [Success] > > > > Failing bpf-filter test > > > > Error: task-clock event does not have PERF_SAMPLE_CPU > > > > Failing bpf-filter test [Success] > > > > Group bpf-filter test > > > > Error: task-clock event does not have PERF_SAMPLE_CPU > > > > Error: task-clock event does not have PERF_SAMPLE_CODE_PAGE_SIZE > > > > Group bpf-filter test [Success] > > > > test child finished with 0 > > > > ---- end ---- > > > > perf record sample filtering (by BPF) tests: Ok > > > > > > [root@five ~]# perf test -v "by BPF" > > > 91: perf record sample filtering (by BPF) tests : > > > --- start --- > > > test child forked, pid 64165 > > > Checking BPF-filter privilege > > > Basic bpf-filter test > > > ffffffff97f4f688 > > > ffffffff97f73859 > > > ffffffff97412ce6 > > > ffffffff976da215 > > > ffffffff973a92bf > > > ffffffff97376ad7 > > > ffffffff97f73859 > > > > ffffffff971fdca5 > > > ffffffff9737dbc4 > > > ffffffff971b4e04 > > > Basic bpf-filter test [Failed invalid output] > > > test child finished with -1 > > > ---- end ---- > > > perf record sample filtering (by BPF) tests: FAILED! > > > [root@five ~]# > > > > > > [root@five ~]# uname -a > > > Linux five 6.2.15-100.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 16:51:53 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux > > > [root@five ~]# > > > > Above was on a AMD Ryzen 5950X, the following was on a lenovo t480s, > > Intel notebook: > > Thanks for the test. I think it's a matter of the kernel version > rather than the CPU vendor. 6.1 or before will fail the check > in the beginning but 6.2 kernel lacks a feature to set sample > flags for some fields and silently accept all samples. IIRC it's > added in v6.3. > > Probably I need to add a version check in the error path. Yeah, we need to do a wider testing of all things enabled BUILD_BPF_SKEL=1, in more kernels, architectures, distributions. Thanks for the feedback, - Arnaldo > Thanks, > Namhyung > > > > > [root@quaco ~]# uname -a > > Linux quaco 6.4.7-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 27 20:01:18 UTC 2023 x86_64 GNU/Linux > > [root@quaco ~]# perf test "filter" > > 30: Filter hist entries : Ok > > 36: Filter fds with revents mask in a fdarray : Ok > > 67: dlfilter C API : Ok > > 91: perf record sample filtering (by BPF) tests : Ok > > [root@quaco ~]# perf test -v "by BPF" > > 91: perf record sample filtering (by BPF) tests : > > --- start --- > > test child forked, pid 273609 > > Checking BPF-filter privilege > > Basic bpf-filter test > > Basic bpf-filter test [Success] > > Failing bpf-filter test > > Error: task-clock event does not have PERF_SAMPLE_CPU > > Failing bpf-filter test [Success] > > Group bpf-filter test > > Error: task-clock event does not have PERF_SAMPLE_CPU > > Error: task-clock event does not have PERF_SAMPLE_CODE_PAGE_SIZE > > Group bpf-filter test [Success] > > test child finished with 0 > > ---- end ---- > > perf record sample filtering (by BPF) tests: Ok > > [root@quaco ~]# -- - Arnaldo