Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3730176pxb; Mon, 24 Jan 2022 16:33:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZB7LUbLypmWRpQH26+wawaFmZyWl6LZiZp9bEICP5JYXx9/uYPnQl4hj6LZdyz5gMP5s5 X-Received: by 2002:a17:902:a404:b0:148:bdd6:d752 with SMTP id p4-20020a170902a40400b00148bdd6d752mr16843555plq.20.1643070799781; Mon, 24 Jan 2022 16:33:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070799; cv=none; d=google.com; s=arc-20160816; b=hWw03Sn/CXh9IVyoTD9cNXhkMOE5tP7I5PiVwkG5vVUQRbL99ngJF0MByn7PzQM3gZ sZmAlhhU/CadHpzV2+Pvd998jfAgESjW5AAwEXDRV56EApKS+Wa48fg1D28jsf1iCk4e 6pXJq3CQHbPhTaqD5gGyJH0DsaB8VXtr+aK1AqITqfi/n0Eg+dtjHeYFHzl5g+rh341O 9KZawv7lvyEIS3uyA26+vpab1FW2OLO49WSIXIUqDGftsLXy4Dwm+gR7L6ZfF3MMDK8M CH9cv7pXGM8WY4Prt8NzNPGIap1XFFMEwT0hGg5Zqti+nMf57jWs1phR8YTy5bPifMt+ 9LsA== 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=TfNYTv8+YRPJg3ATKpXNQXxGxk58F0dbykfeTfHNsWWkDCP53vA28GyjxDQUfP2YAo o1okyVRR1QWnkCQYHAtM/nIYk9tkHWlgTxZUS3i3DritzhMC4NZQufY17xgYeMR7Y4GC 56IfocVKCgJHrFL8evT+Zi0U+pYRUCQY+rqhBCqO7f/oPnXbpwR01mV83VVvaIX82zFD BZ3Axy/kvkfhZhiqnMF9zQosrl1WBGQbHsNIOBluuicI4Bh72+mVfhS2GbSp+d8exUFx rqR7coJzlJZEjsuki9SufRgdCJLdBE7ubBRCE6zfVl7bh7ivXmMR9YQUqQWR9xzi2vNS ZB4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rk+cOvW0; 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 u8si14232014pgm.303.2022.01.24.16.33.07; Mon, 24 Jan 2022 16:33:19 -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=rk+cOvW0; 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 S3410553AbiAYA3b (ORCPT + 99 others); Mon, 24 Jan 2022 19:29:31 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:54650 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1455612AbiAXVfo (ORCPT ); Mon, 24 Jan 2022 16:35:44 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D435A60C60; Mon, 24 Jan 2022 21:35:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B9A2C340E4; Mon, 24 Jan 2022 21:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060143; bh=5AGW86GgCVBdDSNiNAWaOndxhA3SdVsmWaD0uYtrEB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rk+cOvW0RlqNgsBqH5PvVSY0tYylQrmS62H4dnZr/Gy104A+5jh25ZAMjQS76BVQk GRtUiYih2dRUKHnH7YLHr4tdCldTgxvF9RlyaKsWxy0tKknoNOeuZ0TMlSvIAYTo/D 8YIIWaPk/38TimacOOxtPxgq9ANImC3g1fiqTviw= 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.16 0853/1039] tracing/kprobes: nmissed not showed correctly for kretprobe Date: Mon, 24 Jan 2022 19:44:02 +0100 Message-Id: <20220124184153.948925642@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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; }