From patchwork Mon Jul 31 07:30:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 12849 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1865239vqg; Mon, 31 Jul 2023 01:09:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlGo8g+eUc+sVKiHcIGPKusYaFGBXdOd1bcYEiIBYWl7NWXTA0iieWEIT1V7XfRjX/Obzvya X-Received: by 2002:a05:6512:3d8a:b0:4f7:69b9:fa07 with SMTP id k10-20020a0565123d8a00b004f769b9fa07mr6584256lfv.45.1690790955046; Mon, 31 Jul 2023 01:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690790955; cv=none; d=google.com; s=arc-20160816; b=QvL7niOv3Yz5Bv9rAyIZVbceVM4a235NCmAYSvjWBZy1oyH0puu8ebGMi6qjeoQBcN yB8LOFvKisddaSyWRLRIZDneCSLbZS96dFdK8i5eCRii7D/Rwh07u8TybeAjKLC7AXnd v24sfkdyQCrCVXioOLj318I7ZgFTdKvpPFW7SPylOuJ6eUczGZudl7ymUNcvmXgmiW27 KOnsH3kgp6CgjjxDN0SmpRSPGjBgVhqEiRrK0dc1cwcbcBfL7KD8xVx83D0LH9ZDl07Q MGCliKLSleIbAxXacHZavwhBFntg3UPTW6pELBHgbefpDqMRtLmsNlHg+0AZJwOV3HuM rozA== 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 :user-agent:message-id:date:subject:cc:to:from:dkim-signature; bh=//8lEDXZ+I558pbs+59Eqz9BnaGunJBChPEdKKx2Gik=; fh=raxTTJvC+dSJYbgfX5JG5gvrVjxTZXczN0HF8iDayLY=; b=j61Krm3P+9nIX7PJhv8/HLVmS6YgSnpluGG43LUtb6fHByXJszyRImwwvzVLfLoXaK pSiIVdcGBH8ArxA2tuW5Ak3aiG1y85prtEnWKCk2o6iHou7sJAnBIqBjzwfRI51oZSea qSsREZmpcZXcUTMOENkSTiZmzpg1zQaqkoPOTojKCdbI9nC99w4/C3TSXFYBQSU+YQas 0V2DpGSc+V+wdGhzmjxaHkv/yITJHRafXPjUjv0Fi+375gnaT3wLAx8Yt90q9M2ZhtTi vPhAIr039KL7eqLKPeXDdMVUn3C1cmzWChVlx4TrsTaWyC1YGeqgj+oAmwxSHr3LDFzB 7rcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aZZURDXI; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v26-20020aa7d9da000000b0051de49abbd2si6389677eds.483.2023.07.31.01.08.42; Mon, 31 Jul 2023 01:09:15 -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=aZZURDXI; 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 S231628AbjGaHbl (ORCPT + 99 others); Mon, 31 Jul 2023 03:31:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231637AbjGaHb0 (ORCPT ); Mon, 31 Jul 2023 03:31:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96F4F1A2; Mon, 31 Jul 2023 00:30:09 -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 22DF860F0B; Mon, 31 Jul 2023 07:30:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4D2CC433C8; Mon, 31 Jul 2023 07:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690788608; bh=aViYjhHwbZtY5aBTs3TkoJnQJ5YBfz5b0B+HKWNFQow=; h=From:To:Cc:Subject:Date:From; b=aZZURDXIAq2KKy3/Ab7ggwg2OuV/OXMnT0oo+ypOk0G8Kprom/dhLJWcSYlr1tqxb kN60zV6Or2TSkn4FUB+yG6vwlWtczVMBRaVpwId8WAPvPGvQJJeS1qU3RLWWltF673 oHLYNwvq9002UcQHluTL/6ds5aNym5BIIEjLvuCu+NeBJx2xEg+FXFRq8a8esg4S7G 3jey/KaNE+1RKuLMQWbQTbHpXlunHGI4aksBtYhibG7a+9Y3xbFHcnhJgRisBFMTJS dwFtW0U+UooPBQqqbVu06cTB258/IyPSL6D1BohWYbty6SIPT9vACfKrzR0evAf75n ocV5Uju9H8BEw== From: "Masami Hiramatsu (Google)" To: linux-trace-kernel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Steven Rostedt , mhiramat@kernel.org, Martin KaFai Lau , bpf@vger.kernel.org, Sven Schnelle , Alexei Starovoitov Subject: [PATCH v4 0/9] tracing: Improbe BTF support on probe events Date: Mon, 31 Jul 2023 16:30:04 +0900 Message-Id: <169078860386.173706.3091034523220945605.stgit@devnote2> X-Mailer: git-send-email 2.34.1 User-Agent: StGit/0.19 MIME-Version: 1.0 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,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772922816937573368 X-GMAIL-MSGID: 1772922816937573368 Hi, Here is the 4th version of series to improve the BTF support on probe events. The previous series is here: https://lore.kernel.org/all/169037639315.607919.2613476171148037242.stgit@devnote2/ This version updates the btf_find_struct_member() to use a simple stack to walk through the anonymous unions/structures instead of recursive call. Also, returning int error code from query_btf_context() if !CONFIG_PROBE_EVENTS_BTF_ARGS. This series enables {f,k}probe events to access the members of data structures using BTF from arguments and return value. This also adds some new APIs to BTF so that other users can use BTF to find function prototypes and the members of data structures. This series can be applied on top of "probes/core" branch of https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git/ You can also get this series from: git://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git topic/fprobe-event-ext Thank you, --- Masami Hiramatsu (Google) (9): tracing/probes: Support BTF argument on module functions bpf/btf: tracing: Move finding func-proto API and getting func-param API to BTF bpf/btf: Add a function to search a member of a struct/union tracing/probes: Support BTF based data structure field access tracing/probes: Support BTF field access from $retval tracing/probes: Add string type check with BTF tracing/fprobe-event: Assume fprobe is a return event by $retval selftests/ftrace: Add BTF fields access testcases Documentation: tracing: Update fprobe event example with BTF field Documentation/trace/fprobetrace.rst | 64 ++- include/linux/btf.h | 8 kernel/bpf/btf.c | 89 ++++ kernel/trace/trace_eprobe.c | 4 kernel/trace/trace_fprobe.c | 59 ++ kernel/trace/trace_kprobe.c | 1 kernel/trace/trace_probe.c | 494 +++++++++++++++----- kernel/trace/trace_probe.h | 27 + kernel/trace/trace_uprobe.c | 1 .../ftrace/test.d/dynevent/add_remove_btfarg.tc | 14 + .../ftrace/test.d/dynevent/fprobe_syntax_errors.tc | 6 11 files changed, 593 insertions(+), 174 deletions(-) -- Masami Hiramatsu (Google)