Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp350236pxb; Wed, 20 Jan 2021 08:27:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJycuSroSgLsdYZR/9eYPzzd7HXTUQ1g4gBG+4rf8/boqdVCBw6EzMlVXcwaKq6pC11wZGa8 X-Received: by 2002:a50:9310:: with SMTP id m16mr8066313eda.94.1611160021352; Wed, 20 Jan 2021 08:27:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611160021; cv=none; d=google.com; s=arc-20160816; b=aDcO3FkxO6+EYtA8lZbMC5xQhhEJdC2fbFcp59DHoOY7YCDPZ+WIBhNT1gJ5WhhMaV HGOIvhK97HU8y8Q63Snw/c4n3IFS1nz87qZEiOqM6pEokC70vSxnKYCzaKoytM76Efb1 4bhErH5cGLvJ7sXb43eUZ9c6P8L6e1xf2ibbR6FJwkscGTrjZxpbwgUelTZ7NNbydsjW bNvYOpo16iX137wjvT6NGwKV8XS/EKr914HTdkRIWMFlxgtV4UUV73w0Xo65/jGsGHEV 6ZQ1xqTpDV7Ty/pBfKnmhI/mSgOB4bsh3J5p1skB+WG/SFuzhcl+4P5xJAqysIXNtLpp iAcg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=KGptf3rVpkhJOFDxd3ZkHxQo41Toatr0G8cf2ab2/Ko=; b=p1G/MC/ptBsnTjUVbNozwaiCyEwlylpb3Den1WVc0TlGCLJ97fl2rYtNXhjxTGzSAm TfstacMieYaSQ93j/AWj79TezkTUcFfyxMckx5bYawONhJ86Vr6aDGRw44kO9cza+eb/ 1DUhRaO8hSmpN/TKqcF+bPDy1tdK0jo1VfQOKj9Ws2y3flBP/7vmYpv3lY/Xkkq9mX99 LjTX67S6TWJXT/whSECRHHWmTlTpKgCZXvC77KiDd7URAxJwZkz2qoYDhF0yhV6csEvs c65XSCczuiXayP42cl90oLpe39ipDFFSQuAZdXdzhrvqKn96hj/bP4+dN21o5+nQHbxb PmWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si1154830edr.34.2021.01.20.08.26.37; Wed, 20 Jan 2021 08:27:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404015AbhATQWp (ORCPT + 99 others); Wed, 20 Jan 2021 11:22:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:43746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403837AbhATQUs (ORCPT ); Wed, 20 Jan 2021 11:20:48 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9AECB233CE; Wed, 20 Jan 2021 16:20:06 +0000 (UTC) Date: Wed, 20 Jan 2021 11:20:04 -0500 From: Steven Rostedt To: Jianlin Lv Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, Masami Hiramatsu Subject: Re: [PATCH v2] tracing: precise log info for kretprobe addr err Message-ID: <20210120112004.4b9ff1df@gandalf.local.home> In-Reply-To: <20210120155644.64721-1-Jianlin.Lv@arm.com> References: <20210120155644.64721-1-Jianlin.Lv@arm.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org You forgot to include Masami on Cc again. Masami maintains kprobes. Please include him on any updates, as he needs to review them, and give his acknowledgment before acceptance. I need to update MAINTAINERS files to include trace_kprobe under KPROBES. And I also don't see any UPROBES section there. That needs to be done as well. On Wed, 20 Jan 2021 23:56:44 +0800 Jianlin Lv wrote: > When trying to create kretprobe with the wrong function symbol in tracefs; > The error is triggered in the register_trace_kprobe() and recorded as > FAIL_REG_PROBE issue, > > Example: > $ cd /sys/kernel/debug/tracing > $ echo 'r:myprobe ERROR_SYMBOL_XXX ret=%x0' >> kprobe_events > bash: echo: write error: Invalid argument > $ cat error_log > [142797.347877] trace_kprobe: error: Failed to register probe event > Command: r:myprobe ERROR_SYMBOL_XXX ret=%x0 > ^ > > This error can be detected in the parameter parsing stage, the effect of > applying this patch is as follows: > > $ echo 'r:myprobe ERROR_SYMBOL_XXX ret=%x0' >> kprobe_events > bash: echo: write error: Invalid argument > $ cat error_log > [415.89]trace_kprobe: error: Retprobe address must be an function entry > Command: r:myprobe ERROR_SYMBOL_XXX ret=%x0 > ^ > > Signed-off-by: Jianlin Lv > > v2:add !strchr(symbol, ':') to check really bad symbol or not. Also, the "changes since" section should be below the "---" so that they don't get pulled into the commit. Thanks! -- Steve > --- > kernel/trace/trace_kprobe.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c > index e6fba1798771..bce63d5ecaec 100644 > --- a/kernel/trace/trace_kprobe.c > +++ b/kernel/trace/trace_kprobe.c > @@ -830,7 +830,7 @@ static int trace_kprobe_create(int argc, const char *argv[]) > flags |= TPARG_FL_RETURN; > if (kprobe_on_func_entry(NULL, symbol, offset)) > flags |= TPARG_FL_FENTRY; > - if (offset && is_return && !(flags & TPARG_FL_FENTRY)) { > + if (!strchr(symbol, ':') && is_return && !(flags & TPARG_FL_FENTRY)) { > trace_probe_log_err(0, BAD_RETPROBE); > goto parse_error; > }