From patchwork Tue Sep 29 10:59:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290731 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61211C4741F for ; Tue, 29 Sep 2020 12:44:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10FD820725 for ; Tue, 29 Sep 2020 12:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601383497; bh=6yKaPe55goq/PHR0ViTp5J+ZZOx/edQ+2jb3KOU+iFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=K5H4zFPWBg4hJzr1AIfCkG1h1PSnyFQEsKgXoJLKs9rf0aAh8nRFlS/Hu44fOVRi9 uyiOMCn7+haeGsN8JehzIuAH9hmPbEKF1pq9MD4qcSu3AOYHjS2T914zzmQy/jzK0G 3+3Qocw+XT8QQWZF0fJT4NntOrehOkXL6BzmrFnc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729512AbgI2Mo4 (ORCPT ); Tue, 29 Sep 2020 08:44:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:47414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728742AbgI2LIY (ORCPT ); Tue, 29 Sep 2020 07:08:24 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 0D53C221EF; Tue, 29 Sep 2020 11:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377691; bh=6yKaPe55goq/PHR0ViTp5J+ZZOx/edQ+2jb3KOU+iFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mO1q2uapjpo/EacvORjxP4HbCJZhKv4cFJ4yPyYF3eCaVSQeaRGl9HpGI0NbJLwfs n1MxySEWovSy1XO99dIjeODbCwFKTLkpMEkkRry4OleqPlQt8xm3tRyXmPPIP/cOAv PzcJF8eercm9r0ot5FQXZ5Xw5ZJTZuyU3cpKtStE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josef Bacik , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 4.9 037/121] tracing: Set kernel_stacks caller size properly Date: Tue, 29 Sep 2020 12:59:41 +0200 Message-Id: <20200929105932.024647110@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105930.172747117@linuxfoundation.org> References: <20200929105930.172747117@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Josef Bacik [ Upstream commit cbc3b92ce037f5e7536f6db157d185cd8b8f615c ] I noticed when trying to use the trace-cmd python interface that reading the raw buffer wasn't working for kernel_stack events. This is because it uses a stubbed version of __dynamic_array that doesn't do the __data_loc trick and encode the length of the array into the field. Instead it just shows up as a size of 0. So change this to __array and set the len to FTRACE_STACK_ENTRIES since this is what we actually do in practice and matches how user_stack_trace works. Link: http://lkml.kernel.org/r/1411589652-1318-1-git-send-email-jbacik@fb.com Signed-off-by: Josef Bacik [ Pulled from the archeological digging of my INBOX ] Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin --- kernel/trace/trace_entries.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h index d1cc37e78f997..1430f6bbb1a07 100644 --- a/kernel/trace/trace_entries.h +++ b/kernel/trace/trace_entries.h @@ -178,7 +178,7 @@ FTRACE_ENTRY(kernel_stack, stack_entry, F_STRUCT( __field( int, size ) - __dynamic_array(unsigned long, caller ) + __array( unsigned long, caller, FTRACE_STACK_ENTRIES ) ), F_printk("\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n\t=> (" IP_FMT ")\n"