From patchwork Tue Jul 11 14:15:20 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: 11874 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp517361vqm; Tue, 11 Jul 2023 07:22:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlE3uZCghpEm1pt0u+bEkjrY3o4juXA34tZZDuihg0MsF5Ms3qAJGaSoBYBDtWD6y0jRNI2v X-Received: by 2002:a17:906:7a52:b0:993:d700:8a46 with SMTP id i18-20020a1709067a5200b00993d7008a46mr13480787ejo.16.1689085355172; Tue, 11 Jul 2023 07:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689085355; cv=none; d=google.com; s=arc-20160816; b=e6qtlC3jzQ1hx3211ry3FkNhphP+mHnCcTKwhSUNwzMQDuzZrM3yznnXr+2lX4I2tq Z4munPz2M/aM3WNWa9/rV+D9pE3NWFXEiQo/lYTGtkp2NkSTwk/pfbKEbSGdTD9Y5Yd8 myD4hLDah1njqtl0uVvLlQ+Sjtp8HKN8qC8uqJIIFePQydQKIc1iaf31bk/9gW5JjGo8 4QQEhoIpRBQB9ISPq4K0Plkfs7QS/5C2RaOE4mZhdjhXU9M33/29PUuozpiJdVAp0I+1 3ymNqXS45JuFyZeLTq5sbHnq8m8REn+29gGDZWBGh4WYiFUlZnwvBwvY/9r4S9YyUusn PFNA== 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=/hjbVjqvjdjDXy5dywbHBoNEw1VNN7A9tqM+z6vXM8k=; fh=hf24JvveL55vCfzfv0agRHDWsuhzZqIeZ7dfs5kcUjQ=; b=p3rjE8SBtvw5PPGjoFM/XU6Gtx3WEr8d84o/PasIXAJMREqKTPFiww4BBzRK5iM1LR 3YrDUujJ3TQYoCB1lMlF9x2GxpyPHd9jyVzT5XA6n1254PM5n1JL2Rw6hveRdIDOURSN uicG4Nn1JEHTPmWnLyFic4u3zpfXvE/YWMV27DzgRy8DF1L4HguLUUwNuIf1HD/Hf/Eo 8b4PmPYed0+JCJfw5rInoEu7H/1YBsgASaf2f1uUYjbENphuSodCfZcn27ZUo80FtM4A H/JRRRswBczJn6FqihVfPMidaV5fcCD8vB2DiJbcNTJ9P0uCa5GlWB4gLXJ7rXGnnU9+ tx/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PRU6dnef; 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 jz21-20020a170906bb1500b00991cbb3d4a6si2318398ejb.115.2023.07.11.07.22.11; Tue, 11 Jul 2023 07:22:35 -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=PRU6dnef; 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 S233493AbjGKOPg (ORCPT + 99 others); Tue, 11 Jul 2023 10:15:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233426AbjGKOPZ (ORCPT ); Tue, 11 Jul 2023 10:15:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4D4310CA; Tue, 11 Jul 2023 07:15:24 -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 6F01F6150D; Tue, 11 Jul 2023 14:15:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 752B0C433C7; Tue, 11 Jul 2023 14:15:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689084923; bh=cIy8UJKyW+i91CeK7GRZIRW1tqMWTPGd4NNt66u0izE=; h=From:To:Cc:Subject:Date:From; b=PRU6dnefVzucgY6XQifRJ7SLzKvi3Q8XmlkpW322Oye94VY48ZWlKHCIJ2E8Cn6+d vjJfX+8qrgmjgIJQ/V7KobLLToQcrWyyDKizHv3Im2pC8YhcOxOL1nNfwFhB29Nxu+ SoQDul37BxGxIRfp19IC8+ySNUEf5qML4tHd5k6yib8baAxiHalgZAup+1nzyyPCZb oP8fqo4UgjmK/i9uVORMRtt0qCYPpXrsPLZJscwwiUd9SeyY5Vu3YAeWp5LWqX6Vym K+pso9n92AAuxQvAFWoLDuyZtkzBzEw5lAyRhkkXMpH1HW196HbA8snBYW/+3G6F8G /GQEQyKerLIDw== From: "Masami Hiramatsu (Google)" To: Steven Rostedt Cc: Dan Carpenter , linux-trace-kernel@vger.kernel.org, LKML , Masami Hiramatsu Subject: [PATCH v5 0/5] tracing/probes: Fix bugs in process_fetch_insn Date: Tue, 11 Jul 2023 23:15:20 +0900 Message-Id: <168908491977.123124.16583481716284477889.stgit@devnote2> X-Mailer: git-send-email 2.25.1 User-Agent: StGit/0.19 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: 1771134365438261659 X-GMAIL-MSGID: 1771134365438261659 Hi, Here are the 5th version of fix bugs in process_fetch_insn_*(). The previous version is here; https://lore.kernel.org/all/168904147563.2908673.18054267804278861545.stgit@mhiramat.roam.corp.google.com/ In this version I added a bugfix to update dynamic data counter only if the fetcharg uses it [3/5] and update [5/5] to move out the arg->dynamic check out from unlikely() macro and use likely() macro correctly for non-error case. Thank you, --- Masami Hiramatsu (Google) (5): tracing/probes: Fix to avoid double count of the string length on the array tracing/probes: Fix not to count error code to total length tracing/probes: Fix to update dynamic data counter if fetcharg uses it Revert "tracing: Add "(fault)" name injection to kernel probes" tracing/probes: Fix to record 0-length data_loc in fetch_store_string*() if fails kernel/trace/trace.h | 2 ++ kernel/trace/trace_probe.c | 2 +- kernel/trace/trace_probe_kernel.h | 30 ++++++++---------------------- kernel/trace/trace_probe_tmpl.h | 10 +++++----- kernel/trace/trace_uprobe.c | 3 ++- 5 files changed, 18 insertions(+), 29 deletions(-) -- Masami Hiramatsu (Google)