Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3611197pxb; Mon, 24 Jan 2022 13:29:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwAw2eXHbEJKI91V3wTt7vKKdInQpNexEhrBNAyrnFVzOX/FAH1WCAXOMouUfCyGLLXW3LE X-Received: by 2002:a17:903:31c8:b0:149:a463:ad38 with SMTP id v8-20020a17090331c800b00149a463ad38mr15694415ple.76.1643059789910; Mon, 24 Jan 2022 13:29:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059789; cv=none; d=google.com; s=arc-20160816; b=TJIl8YoAmTLzRrT6PaC/sL1fslZCMlrVbdoqZrQ2kFyzLxGTnQ+t3IO3Q9FADN0Krl zyP9zHoECNzyuLvwzon61gKNgNPNpAFT2Z4maXNmlAVsLooT3zulUFn6PZjKHmlXuEZO ndPefsMk26CymNRjKA3MmVeJF0RnmWnBxTdJubgHQecgyv6DImx5oZEL7JGZkUTvWiAe sgGlwMmTD6Re2Wr43td7YNKotIHiSNnhNxulmXEHelKKQy2iVpTG7ihoLg+q3kfyFd+H LLoMcZPHSkPa60Nx07oE5NM305bEeg/Bmzojpkdvpmza4JfBoI3YeBkZ3ktZm0aUmEpk DrYA== 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=c95hiMLnKR+jC2WpM+85/EgzwtAVb2M0F+NF+nKXfRU=; b=LNxqZkRf/QNNe+2MxjJEwnJc9vineYe6S542PoY7utKzyl+5Kr/izBb6pzyUOAW8fz 78kRSEmJF8HnGp/GoRSjEaTr+fnqTMu/rlhgeYSxKWKBC3geIqktyRxaYUBrPZ9/yg44 qWTjleZAArUQww50OlfDtgIhwM5vBa69FVfi9SkN00uMswRf7MOeUZcTiJ3VdqLWPExP dAh2ri2dyZ250yhACnmjg7ApqciKJmnLvFseZNu7Csac9h7wY9/RbACgHruGZkY5BNbP Im1A4hKMvexNORI+kDgMLKZIE9Z0qcasyx4Vs+IuaXg/O3WT3Or82y2hMQOQ6lX1UO/P kHVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n8Xee6lv; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u31si16204304pgk.546.2022.01.24.13.29.35; Mon, 24 Jan 2022 13:29:49 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n8Xee6lv; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377527AbiAXVIx (ORCPT + 99 others); Mon, 24 Jan 2022 16:08:53 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:46552 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390578AbiAXUpv (ORCPT ); Mon, 24 Jan 2022 15:45:51 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E4CBBB81233; Mon, 24 Jan 2022 20:45:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBFABC340E5; Mon, 24 Jan 2022 20:45:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057148; bh=5AGW86GgCVBdDSNiNAWaOndxhA3SdVsmWaD0uYtrEB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n8Xee6lvQssqFRLpGdAi9CGAodpcrOV5WJW8xo6MhmStsv9kFDXvxMcadxBPLaiWg 7lVAAboXwX9iSKY5YEVVa3fvvvBFBOylI0Td6jvUW1lbEa6ux2zwBGGIth7dfW16Cz xQOD79nk0gI6ZhNSTR/ICInLKa/z+vOYzlbiSqRw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , Xiangyang Zhang , Steven Rostedt Subject: [PATCH 5.15 684/846] tracing/kprobes: nmissed not showed correctly for kretprobe Date: Mon, 24 Jan 2022 19:43:21 +0100 Message-Id: <20220124184124.661981094@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Xiangyang Zhang commit dfea08a2116fe327f79d8f4d4b2cf6e0c88be11f upstream. The 'nmissed' column of the 'kprobe_profile' file for kretprobe is not showed correctly, kretprobe can be skipped by two reasons, shortage of kretprobe_instance which is counted by tk->rp.nmissed, and kprobe itself is missed by some reason, so to show the sum. Link: https://lkml.kernel.org/r/20220107150242.5019-1-xyz.sun.ok@gmail.com Cc: stable@vger.kernel.org Fixes: 4a846b443b4e ("tracing/kprobes: Cleanup kprobe tracer code") Acked-by: Masami Hiramatsu Signed-off-by: Xiangyang Zhang Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_kprobe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -1175,15 +1175,18 @@ static int probes_profile_seq_show(struc { struct dyn_event *ev = v; struct trace_kprobe *tk; + unsigned long nmissed; if (!is_trace_kprobe(ev)) return 0; tk = to_trace_kprobe(ev); + nmissed = trace_kprobe_is_return(tk) ? + tk->rp.kp.nmissed + tk->rp.nmissed : tk->rp.kp.nmissed; seq_printf(m, " %-44s %15lu %15lu\n", trace_probe_name(&tk->tp), trace_kprobe_nhit(tk), - tk->rp.kp.nmissed); + nmissed); return 0; }