Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5175372pxj; Wed, 26 May 2021 04:48:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx49/b/DcEyeIbYnRYUxnStK2aAM4jnuxgEwBm4/Kh7XDls8tECj00B9l4Ja5szjgHhzrkr X-Received: by 2002:a6b:7901:: with SMTP id i1mr25392225iop.41.1622029708606; Wed, 26 May 2021 04:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622029708; cv=none; d=google.com; s=arc-20160816; b=0KwrlJj0LjOgjWQBJyBRachLqq9VaIFw3UlnbjugCDvZDJ8dO0Ucap4h/Nl3oCzLbp 9Az7nf/GCKES+835UdUF0NLrNqSNO7erUBl4bjyz5IX9MZm2Hb9AgWKWK2MoQlO8nHv2 CGQK6A3Ny69vKlDuu1oFvCAWHSyrz0VG2WLHAdxOi9wi6a7jQJ4fO5s0HfPvfhZROB/H vGLzyps+Od8bfwbS0Yhy/z9ZhL597r/5vxUeV1fMDfklH8FynQ62yGUBz8OfREuZ/8A4 So2soAuTUT0gyqWs/bkTqXboVPPjDaNVFv4GU7VgT8ko5bwptpjrD3SDfBLTt+KDgIgL rKrA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jgVyfr2YzbO5U2qg0iwKt/5G8FtPmY5dMaI8lQjujmY=; b=HXJgXRyajA/HoNsrm2+gy4t4hMAc0dmZ+gPXwrCG9Uc7tyvLOtgTYhmmU4bhm6OSLa Q5UFmTadV574ajb+JVjqt031w9doKQK5SnESk3hbkbOY8G8nSl4PQYe/wEdlmoJKSz5c ojm4qonm+4tsFNbWOd7zbbaEET8NH0uT64cBSp4yXxl5H+Z4Y3jBMPOPVgu4YXM38cPb d0EekfPA87jF4I8KSHnVO1xgLRGJnKcwfcD2qnIa+RWzUO57aMyhgYABkE/MrMVWlCv5 jSMi0mX8kRSsUlkvXFvRapLjoNw4uXOvi+iY9F7sC8sNO2on263ELmfvGdBVJ30S22dj gmxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QwNmlrAE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si6396013ilu.55.2021.05.26.04.48.13; Wed, 26 May 2021 04:48:28 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QwNmlrAE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233284AbhEZIFx (ORCPT + 99 others); Wed, 26 May 2021 04:05:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:40948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232873AbhEZIFu (ORCPT ); Wed, 26 May 2021 04:05:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1FE0E613E6; Wed, 26 May 2021 08:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622016259; bh=3iDqN6IbfHW8PfeoC8K9td24ZOufoTiVRxV3XEeWOhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QwNmlrAEsmm+PPrntKATZVPVpsEnSHSWy+NV6ZvjoWZ72i4bwJZnxHh/57RbPxjQW oDhtYPFIqA+Cr18GCU7FV5qSFkVL57Uy4WuZ6Ts0Fn524PY9wRlj/GeXAJFMW8juI2 xnkGZ7pFiULrOSsSKrknMXxuHRKcntveqiWDVQqm3Y0/hptWd/esu/WvZ1dKL0DIHE ZQZ/IRPBvTX+PJBl5hlcLxU3TK6JGxU9cJPwn+hJfa637je2yjsXRT4uWCRXy39apP kqrTEdHMSXe39qdROvbLD9jQh8dSkNH0VWBUSPu2vcV6fPZfqcrQnzDtxwolXQxGIi jz4RRVDIvi7Xw== From: Masami Hiramatsu To: Steven Rostedt , Ingo Molnar Cc: X86 ML , Masami Hiramatsu , Daniel Xu , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kuba@kernel.org, mingo@redhat.com, ast@kernel.org, tglx@linutronix.de, kernel-team@fb.com, yhs@fb.com, Josh Poimboeuf , linux-ia64@vger.kernel.org, Abhishek Sagar , Andrii Nakryiko Subject: [PATCH -tip v6 12/13] tracing: Show kretprobe unknown indicator only for kretprobe_trampoline Date: Wed, 26 May 2021 17:04:14 +0900 Message-Id: <162201625426.278331.16464105461089821909.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162201612941.278331.5293566981784464165.stgit@devnote2> References: <162201612941.278331.5293566981784464165.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ftrace shows "[unknown/kretprobe'd]" indicator all addresses in the kretprobe_trampoline, but the modified address by kretprobe should be only kretprobe_trampoline+0. Signed-off-by: Masami Hiramatsu Acked-by: Steven Rostedt (VMware) --- kernel/trace/trace_output.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index d0368a569bfa..e46780670742 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -346,22 +347,12 @@ int trace_output_call(struct trace_iterator *iter, char *name, char *fmt, ...) } EXPORT_SYMBOL_GPL(trace_output_call); -#ifdef CONFIG_KRETPROBES -static inline const char *kretprobed(const char *name) +static inline const char *kretprobed(const char *name, unsigned long addr) { - static const char tramp_name[] = "kretprobe_trampoline"; - int size = sizeof(tramp_name); - - if (strncmp(tramp_name, name, size) == 0) + if (is_kretprobe_trampoline(addr)) return "[unknown/kretprobe'd]"; return name; } -#else -static inline const char *kretprobed(const char *name) -{ - return name; -} -#endif /* CONFIG_KRETPROBES */ void trace_seq_print_sym(struct trace_seq *s, unsigned long address, bool offset) @@ -374,7 +365,7 @@ trace_seq_print_sym(struct trace_seq *s, unsigned long address, bool offset) sprint_symbol(str, address); else kallsyms_lookup(address, NULL, NULL, NULL, str); - name = kretprobed(str); + name = kretprobed(str, address); if (name && strlen(name)) { trace_seq_puts(s, name);