From: Corey Minyard <cminyard@mvista.com> To: Baoquan He <bhe@redhat.com>, Corey Minyard <minyard@acm.org> Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Vivek Goyal <vgoyal@redhat.com>, Haren Myneni <hbabu@us.ibm.com>, dyoung@redhat.com Subject: Re: [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels Date: Mon, 9 May 2016 10:40:38 -0500 [thread overview] Message-ID: <5730AF76.3000608@mvista.com> (raw) In-Reply-To: <20160509142953.GA2978@x1> On 05/09/2016 09:29 AM, Baoquan He wrote: > 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. I think you are correct. We should use something like: set var $stack_top = ($stackp & ~(sizeof(thread_union) - 1)) + sizeof(thread_union) Is this what you are suggesting? -corey > > Thanks > Baoquan > >>>>> while ($stackp < $stack_top) >>>>> @@ -31,12 +31,12 @@ define bttnobp >>>>> end >>>>> set $stackp += 4 >>>>> end
WARNING: multiple messages have this Message-ID (diff)
From: Corey Minyard <cminyard@mvista.com> To: Baoquan He <bhe@redhat.com>, Corey Minyard <minyard@acm.org> Cc: Haren Myneni <hbabu@us.ibm.com>, dyoung@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Vivek Goyal <vgoyal@redhat.com> Subject: Re: [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels Date: Mon, 9 May 2016 10:40:38 -0500 [thread overview] Message-ID: <5730AF76.3000608@mvista.com> (raw) In-Reply-To: <20160509142953.GA2978@x1> On 05/09/2016 09:29 AM, Baoquan He wrote: > 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. I think you are correct. We should use something like: set var $stack_top = ($stackp & ~(sizeof(thread_union) - 1)) + sizeof(thread_union) Is this what you are suggesting? -corey > > Thanks > Baoquan > >>>>> while ($stackp < $stack_top) >>>>> @@ -31,12 +31,12 @@ define bttnobp >>>>> end >>>>> set $stackp += 4 >>>>> end _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2016-05-09 15:40 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-02-25 13:51 [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels minyard 2016-02-25 13:51 ` minyard 2016-04-27 12:21 ` Corey Minyard 2016-04-27 12:21 ` Corey Minyard 2016-05-05 2:37 ` Baoquan He 2016-05-05 2:37 ` Baoquan He 2016-05-09 5:18 ` Baoquan He 2016-05-09 5:18 ` Baoquan He 2016-05-09 12:10 ` Corey Minyard 2016-05-09 12:10 ` Corey Minyard 2016-05-09 14:29 ` Baoquan He 2016-05-09 14:29 ` Baoquan He 2016-05-09 15:40 ` Corey Minyard [this message] 2016-05-09 15:40 ` Corey Minyard 2016-05-10 1:37 ` Baoquan He 2016-05-10 1:37 ` Baoquan He 2016-05-10 1:48 ` Baoquan He 2016-05-10 1:48 ` Baoquan He -- strict thread matches above, loose matches on Subject: below -- 2016-01-19 16:57 minyard
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=5730AF76.3000608@mvista.com \ --to=cminyard@mvista.com \ --cc=bhe@redhat.com \ --cc=dyoung@redhat.com \ --cc=hbabu@us.ibm.com \ --cc=kexec@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=minyard@acm.org \ --cc=vgoyal@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.