From patchwork Mon Dec 5 08:29:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Chen X-Patchwork-Id: 2594 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2130491wrr; Mon, 5 Dec 2022 00:33:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf7WO2GDA0kV8nBc1S3KsfEr4asGMRQzJ7SPqRN/H2EJd0QueaJFo40iTFy26uvTxU2c1aFH X-Received: by 2002:a17:902:7689:b0:189:b6cf:850d with SMTP id m9-20020a170902768900b00189b6cf850dmr17079757pll.30.1670229204985; Mon, 05 Dec 2022 00:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670229204; cv=none; d=google.com; s=arc-20160816; b=VMyHuZm49KpY7M1mTmwx6PhHDEMV0VpfZuc1FZSJHdcmK5FEBZwTYGZzqXMakMDeu1 vd3pUb+4RZ4knbVS6Wl2BHaTlILP1g6sTxalpCTqqAFyrnCUHJYm5VR4u+AoPqHq2f+y 9JxKQTDTcZY6F66ZoAled6OUkROEsHJ330ZyhaRQE67QZ3xH4yT8dmOiWa0xrh0/NgNk zJ5mQEjulf8JejoGj6hk1S3GzNcJjcVWfM9iHO0MXQtFy6gR29nqbf66CwCOq6H9Nhal cu58Hz9iUAk6aVsghz18AhkKhs046mEuK8ijpp3pUiduZU41RrF8D+NXixj8zk8s6ZX7 Z6eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:sender :hmm_source_type:hmm_attache_num:hmm_source_ip; bh=xh1pz0HXQcq1KVkBqxZ+7G6vXUM4ND0dEVv7oZQANxA=; b=Xg5Ti1Jyf/IqkqBDpOKpsCcdQBhwWo/ibDrVHbPDntTwT5UCEitNJXVTheD1F65iXQ yZmlZQUQEpWNeopmnnTzCmZlDK2ZRvEJ8IJR11mn1Ybk7eS9xuV6KjYCUzo1U+spWBgM UThy5xPpyUIy/FiFx5GtratvARj4SYFC7WK7ZyLrfaXsjj/eWHhnV7sJf4O81pCyMA9e +0i110KETzG6YOuMODhPg46iO2sJ8jeNV3o4T95udTNQPbmYz6NyNQdsE5wUFsWG5eux AQjTzs/y3x4DvjHlPhzrhzSUKkhcPjwpasRV2f+psefacWEgpV5gzR1e1nG1KZMfySiw H3LQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a170902704800b001868a4db3d1si12594132plt.48.2022.12.05.00.33.12; Mon, 05 Dec 2022 00:33:24 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232021AbiLEIWx (ORCPT + 99 others); Mon, 5 Dec 2022 03:22:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231453AbiLEIWv (ORCPT ); Mon, 5 Dec 2022 03:22:51 -0500 Received: from 189.cn (ptr.189.cn [183.61.185.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 69EB86147; Mon, 5 Dec 2022 00:22:45 -0800 (PST) HMM_SOURCE_IP: 10.64.8.43:44912.801624490 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-123.150.8.42 (unknown [10.64.8.43]) by 189.cn (HERMES) with SMTP id DC2B71002CF; Mon, 5 Dec 2022 16:22:43 +0800 (CST) Received: from ([123.150.8.42]) by gateway-153622-dep-6cffbd87dd-f7vjc with ESMTP id 9e96ef7c3352454ab22033a3810357f5 for rostedt@goodmis.org; Mon, 05 Dec 2022 16:22:43 CST X-Transaction-ID: 9e96ef7c3352454ab22033a3810357f5 X-Real-From: chensong_2000@189.cn X-Receive-IP: 123.150.8.42 X-MEDUSA-Status: 0 Sender: chensong_2000@189.cn From: Song Chen To: rostedt@goodmis.org, mhiramat@kernel.org, arnd@arndb.de Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Song Chen Subject: [PATCH v3 0/4] reorganize trace_peobe_tmpl.h Date: Mon, 5 Dec 2022 16:29:32 +0800 Message-Id: <1670228972-3934-1-git-send-email-chensong_2000@189.cn> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS autolearn=no 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751362258402199130?= X-GMAIL-MSGID: =?utf-8?q?1751362258402199130?= Hi, In the first patchset, my intension was to remove trace_probe_tmpl.h, just keep a unified process_fetch_insn and process_fetch_insn_bottom in trace_probe.c for all *probes. is_uprobe was the most important move to approach. If it was not accepted, the whole patchset couldn't stand. Then I change my goal to at least no warnings or errors when impelenting a new feature based on trace probe if it includes trace_probe_tmpl.h by provideing default behaviors. What's more, it also removes redundant code in kprobe and eprobe. --- v2: 1, mark nokprobe_inline for get_event_field 2, remove warnings reported from kernel test robot 3, fix errors reported from kernel test robot Song Chen (4): kernel/trace: Introduce trace_probe_print_args and use it in *probes kernel/trace: Provide default impelentations defined in trace_probe_tmpl.h include/asm-generic/io.h: remove performing pointer arithmetic on a null pointer kernel/trace: remove calling regs_* when compiling HEXAGON include/asm-generic/io.h | 45 ++++++--- kernel/trace/trace_eprobe.c | 146 +-------------------------- kernel/trace/trace_events_synth.c | 7 +- kernel/trace/trace_kprobe.c | 106 +------------------- kernel/trace/trace_probe.c | 27 +++++ kernel/trace/trace_probe.h | 2 + kernel/trace/trace_probe_kernel.h | 158 ++++++++++++++++++++++++++++-- kernel/trace/trace_probe_tmpl.h | 28 ------ kernel/trace/trace_uprobe.c | 2 +- 9 files changed, 222 insertions(+), 299 deletions(-)