Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp906714rdb; Tue, 15 Aug 2023 16:17:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsXoqY/pey7PzUoN0wWOU1CY88/84DD3fOJvf6mIh/hAyH8fq/ZXYMkdwT1rqPDgvDrMzf X-Received: by 2002:a17:907:78cf:b0:993:f497:adbe with SMTP id kv15-20020a17090778cf00b00993f497adbemr100255ejc.19.1692141431139; Tue, 15 Aug 2023 16:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692141431; cv=none; d=google.com; s=arc-20160816; b=PatD7vJU+934zzKhc2yt1p+186ACuu4JrmEzNaLfLvwcodKqmwZC3IVfHau/HK/AVi Ov9iw1/SVgmr7tBLBS5FZYt7cN1NYK+SdA2IBWY7hOMEkoE/bPceyfrjEzPinF9xMZ9g bGmTm+bBblZuehTEG6ee/jJxHnHWItS0OXw0O/N8L8IMEV/3sK9AcEyD5aH9aTpb5SG+ bE8ksetln3tlv+I5s+kcRerIwaS/YYWBKOgzW9R4R/oC91cSEWNRkS786XfpJ3IGH0y9 CBWtQAklMCNV7WZjonBdauUi5eDfKq64yFIeaV/3n8H3xQ+xKzAyzJFG6lr8uiiWmrOu EG9Q== 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=Zywr62fm6XEZ7lYpY7I642N8k1Ho3BXLYpMzXUAyy0o=; fh=X5jvpDftsT1X5vto2so6k9wdRniLwg/j84Z6GkqMZWs=; b=HAKkM40VuQyf2uK3sgmqeERaUpVKmzqxsFEvkJz1lH682xtN7M2bkCHimtnrj6uRn1 yzdn1EqffoVumiBvogLn8RT3jJTbFYZtH6f2efCjq0nhmeGPRYcK0b6u87MU+ga2QvWI fQwSwcvBEoobhFP4h5kNRx8KfsOx1NX/9FN+T311iG3syFvXxwcYvjMy7dwEij+8kIeX tyzfS3kBSpNqV1pd1rA2vuFRKj7db5kkYa5JJzVPPdO1FXsjAPXD+3Feb2ktmj0cKZpZ uRRw2rO7ll7xzJ5jdze7FMfGNbpe4Oz52VIrFfP+qe3wj2hEjpbscoGg60TEwjSWUEZ4 3N4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jyvy+H7s; 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 ju4-20020a17090798a400b00992b8854f48si10052256ejc.556.2023.08.15.16.16.41; Tue, 15 Aug 2023 16:17:11 -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=Jyvy+H7s; 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 S237588AbjHOOZ5 (ORCPT + 99 others); Tue, 15 Aug 2023 10:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237595AbjHOOZb (ORCPT ); Tue, 15 Aug 2023 10:25:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 022EC173F; Tue, 15 Aug 2023 07:25:30 -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)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8A25B65095; Tue, 15 Aug 2023 14:25:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1D9FC433C8; Tue, 15 Aug 2023 14:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692109528; bh=coObV9y/RYS3AiSNn8u13h8zoAh7+fxjKoeBOZzSR9M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Jyvy+H7ssDO2P5B/nS4Sc2bspYwRxSNsTRDI+ZodIPUfCNJcmo/Of3p8kOorKTxUs eRM/jzo7f9zNOI0mgx36unEe+oIA3yaUSUd2qNpge/UbziBLmuYQLvNPosoOobv2dQ AfNuScxOGKv8xlTk6TTHR4JDnUsAF4iZuepIDxItyzW5618GCTPewpu9gaYo6a5o0U /SvSbs7MZ2AKaZpbogI+kljbfBzjoX6GnbFizCB3bckrMeX7welOSI6LW7wusVYFSh Db9JWBESivJmEWHewjC8O7qmsfcp0g2bctBSZnN4msw1MhaDr4mdRD8+4DWf9vHxUB jrU77Ync1/adg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id DACE6404DF; Tue, 15 Aug 2023 11:25:25 -0300 (-03) Date: Tue, 15 Aug 2023 11:25:25 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Nathan Chancellor , Nick Desaulniers , Tom Rix , Fangrui Song , Anshuman Khandual , Andi Kleen , Leo Yan , Madhavan Srinivasan , Carsten Haitzler , Ravi Bangoria , "Naveen N. Rao" , Athira Rajeev , Kan Liang , Yang Jihong , James Clark , Tiezhu Yang , Eduard Zingerman , Andrii Nakryiko , Yonghong Song , Rob Herring , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev, Wang Nan , Wang ShaoBo , YueHaibing , He Kuang , Brendan Gregg Subject: Re: [PATCH v1 2/4] perf trace: Migrate BPF augmentation to use a skeleton Message-ID: References: <20230810184853.2860737-1-irogers@google.com> <20230810184853.2860737-3-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230810184853.2860737-3-irogers@google.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Thu, Aug 10, 2023 at 11:48:51AM -0700, Ian Rogers escreveu: > Previously a BPF event of augmented_raw_syscalls.c could be used to > enable augmentation of syscalls by perf trace. As BPF events are no > longer supported, switch to using a BPF skeleton which when attached > explicitly opens the sysenter and sysexit tracepoints. > > The dump map is removed as debugging wasn't supported by the > augmentation and bpf_printk can be used when necessary. > > Remove tools/perf/examples/bpf/augmented_raw_syscalls.c so that the > rename/migration to a BPF skeleton captures that this was the source. > +#ifdef HAVE_BPF_SKEL > + trace.skel = augmented_raw_syscalls_bpf__open(); > + if (!trace.skel) { > + pr_debug("Failed to open augmented syscalls BPF skeleton"); > + } else { > + /* > + * Disable attaching the BPF programs except for sys_enter and > + * sys_exit that tail call into this as necessary. > + */ > + bpf_program__set_autoattach(trace.skel->progs.syscall_unaugmented, > + /*autoattach=*/false); > + bpf_program__set_autoattach(trace.skel->progs.sys_enter_connect, > + /*autoattach=*/false); > + bpf_program__set_autoattach(trace.skel->progs.sys_enter_sendto, > + /*autoattach=*/false); > + bpf_program__set_autoattach(trace.skel->progs.sys_enter_open, > + /*autoattach=*/false); > + bpf_program__set_autoattach(trace.skel->progs.sys_enter_openat, > + /*autoattach=*/false); > + bpf_program__set_autoattach(trace.skel->progs.sys_enter_rename, > + /*autoattach=*/false); > + bpf_program__set_autoattach(trace.skel->progs.sys_enter_renameat, > + /*autoattach=*/false); > + bpf_program__set_autoattach(trace.skel->progs.sys_enter_perf_event_open, > + /*autoattach=*/false); > + bpf_program__set_autoattach(trace.skel->progs.sys_enter_clock_nanosleep, > + /*autoattach=*/false); > + > + err = augmented_raw_syscalls_bpf__load(trace.skel); > So I converted the above to: struct bpf_program *prog; bpf_object__for_each_program(prog, trace.skel->obj) { if (prog != trace.skel->progs.sys_enter && prog != trace.skel->progs.sys_exit) bpf_program__set_autoattach(prog, /*autoattach=*/false); } So that we don't have to add new lines disabling attachment when adding support for other pointer receiving syscalls. - Arnaldo