From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751586AbcEIOaE (ORCPT ); Mon, 9 May 2016 10:30:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57743 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751452AbcEIOaB (ORCPT ); Mon, 9 May 2016 10:30:01 -0400 Date: Mon, 9 May 2016 22:29:53 +0800 From: Baoquan He To: Corey Minyard Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Vivek Goyal , Haren Myneni , Corey Minyard , dyoung@redhat.com Subject: Re: [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels Message-ID: <20160509142953.GA2978@x1> References: <1456408291-29559-1-git-send-email-minyard@acm.org> <5720AEDC.3080409@acm.org> <20160509051724.GA2460@x1.redhat.com> <57307E53.4060300@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57307E53.4060300@acm.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 09 May 2016 14:30:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/09/16 at 07:10am, Corey Minyard wrote: > On 05/09/2016 12:18 AM, Baoquan He wrote: > >Hi Corey, > > > >I am trying to review this patch now, and these fixes contained are very > >great. Just several concerns are added in inline comment. > > > >By the way, did you run this in your side? > > Yes, I tested on x86, x86_64, ARM and MIPS. > > Comments inline... That's awesome. I will have a try too. > >>>diff --git a/Documentation/kdump/gdbmacros.txt b/Documentation/kdump/gdbmacros.txt > >>>index 9b9b454..e5bbd8d 100644 > >>>--- a/Documentation/kdump/gdbmacros.txt > >>>+++ b/Documentation/kdump/gdbmacros.txt > >>>@@ -15,14 +15,14 @@ > >>> define bttnobp > >>> set $tasks_off=((size_t)&((struct task_struct *)0)->tasks) > >>>- set $pid_off=((size_t)&((struct task_struct *)0)->pids[1].pid_list.next) > >>>+ set $pid_off=((size_t)&((struct task_struct *)0)->thread_group.next) > >This is a quite nice fix. > > > >>> set $init_t=&init_task > >>> set $next_t=(((char *)($init_t->tasks).next) - $tasks_off) > >>> while ($next_t != $init_t) > >>> set $next_t=(struct task_struct *)$next_t > >>> printf "\npid %d; comm %s:\n", $next_t.pid, $next_t.comm > >>> printf "===================\n" > >>>- set var $stackp = $next_t.thread.esp > >>>+ set var $stackp = $next_t.thread.sp > >>> set var $stack_top = ($stackp & ~4095) + 4096 Missed one place here. Currently the kernel stack is decided by THREAD_SIZE since the definition: union thread_union { struct thread_info thread_info; unsigned long stack[THREAD_SIZE/sizeof(long)]; }; Should we get the top and bottom of stack according to this now? Correct me if I was wrong. Thanks Baoquan > >>> while ($stackp < $stack_top) > >>>@@ -31,12 +31,12 @@ define bttnobp > >>> end > >>> set $stackp += 4 > >>> end