Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10260644ybi; Wed, 24 Jul 2019 19:33:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMhTH4ACWdWJEnBY7Mjh/uoKRTgODp22yqsPIteKreYWYvyvtU4aOHPsWI/XlpoCVSOqWk X-Received: by 2002:aa7:9298:: with SMTP id j24mr13838959pfa.58.1564021988122; Wed, 24 Jul 2019 19:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564021988; cv=none; d=google.com; s=arc-20160816; b=o2JltZjMJ7JYoAR+6pK3iw4mI47rBmPPnGiHLHSZulycg7owN4DljGLItBMVqdSXGj SAYsCLQo8xPhz+mcUzjQhHAw95CGbXj0P2myz4vTMXGjiq1r67jLVQGl076kwdMtkDmc YDHGDCfM8Ck5POl5a7mwX2PYpGApgJyQhbd6BJcVN8gnIl/cK4Bz29XwVDGdleQpJmq0 XDslQPeg8NbRSxYOqzUgR8BnVrjb5pw32LjPl7kuBvP0na/KIMaZJurX+FfoFtrW0M7U eQCfAsudkn+jfpDGg7dm0bqS/etcKv8XfdL7M4Eky0ProS8GcnsHMueBG+S4VJ/Aw9zN NmZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s9KJBCS9SCOJKT1aYD60rrYfFLsyYkjoHcvfU7C8uoY=; b=asXHzu7vX5NIbb8CW69gmdS2rQ/O6CGP/HIl8ltuAUetCZU066lWe6QPLxmJkrIBE4 oQkxJELTh7Jdn/fRaUcVya9CT2UA/yClZm33b2uk/cShvCy3WezLD47cBUB/rPRYNz/e 9faw/4B6hyQHSHoGfbaJYGEGmFT5ZrWOOYAxw1ETpQzGraMPzSEE4fIfh4v9aaxHFZds TCqYHokO+u8qg4JMcRd8NxWvIzFVtM5VVg7fTJcHDl5emVrPFtmLPAmoJDK/SG2MiGo9 bNQi1TwD4BeOKsy9P020NhJdDfNp3pocl2A+CdKRiUzNPiQQYoLU3+EfZ+v7It81dPw8 247A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j+1nZAhN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si19128347pfq.181.2019.07.24.19.32.53; Wed, 24 Jul 2019 19:33:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j+1nZAhN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389954AbfGXTjd (ORCPT + 99 others); Wed, 24 Jul 2019 15:39:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:40564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389939AbfGXTja (ORCPT ); Wed, 24 Jul 2019 15:39:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 A8197229F3; Wed, 24 Jul 2019 19:39:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997170; bh=qIUI0Na8vCijcEjObETvQCA0O1xN6Q4ok4GitC6WA3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j+1nZAhNUyurQ/0+ih4vN1cpl0KcT7sYzQDksrNjxryJ9V5U1/gLCe3+2c1AEhCU6 OkW8A+uyVPnVjhDqeffa/RiT3vDwMkQTgVHwSbXD32ZkG2/9sH2obaDYgNviFHxrxN zyQ4t0ysXEu8KtXhWwHkBvsjPB0Zi5GmDsXcP3T4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eiichi Tsukata , "Steven Rostedt (VMware)" Subject: [PATCH 5.2 303/413] tracing: Fix user stack trace "??" output Date: Wed, 24 Jul 2019 21:19:54 +0200 Message-Id: <20190724191757.558048310@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eiichi Tsukata commit 6d54ceb539aacc3df65c89500e8b045924f3ef81 upstream. Commit c5c27a0a5838 ("x86/stacktrace: Remove the pointless ULONG_MAX marker") removes ULONG_MAX marker from user stack trace entries but trace_user_stack_print() still uses the marker and it outputs unnecessary "??". For example: less-1911 [001] d..2 34.758944: => <00007f16f2295910> => ?? => ?? => ?? => ?? => ?? => ?? => ?? The user stack trace code zeroes the storage before saving the stack, so if the trace is shorter than the maximum number of entries it can terminate the print loop if a zero entry is detected. Link: http://lkml.kernel.org/r/20190630085438.25545-1-devel@etsukata.com Cc: stable@vger.kernel.org Fixes: 4285f2fcef80 ("tracing: Remove the ULONG_MAX stack trace hackery") Signed-off-by: Eiichi Tsukata Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_output.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -1109,17 +1109,10 @@ static enum print_line_t trace_user_stac for (i = 0; i < FTRACE_STACK_ENTRIES; i++) { unsigned long ip = field->caller[i]; - if (ip == ULONG_MAX || trace_seq_has_overflowed(s)) + if (!ip || trace_seq_has_overflowed(s)) break; trace_seq_puts(s, " => "); - - if (!ip) { - trace_seq_puts(s, "??"); - trace_seq_putc(s, '\n'); - continue; - } - seq_print_user_ip(s, mm, ip, flags); trace_seq_putc(s, '\n'); }