Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kieran Bingham <kieranbingham@gmail.com>
To: Jeff Mahoney <jeffm@suse.com>, Ales Novak <alnovak@suse.cz>,
	Kieran Bingham <kieran.bingham@linaro.org>
Cc: gdb-patches@sourceware.org,
	Peter Griffin <peter.griffin@linaro.org>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: Enable gdb to open Linux kernel dumps
Date: Tue, 02 Feb 2016 09:12:00 -0000	[thread overview]
Message-ID: <56B07305.7040905@gmail.com> (raw)
In-Reply-To: <56AF7332.2060702@suse.com>

On 01/02/16 15:01, Jeff Mahoney wrote:
> On 2/1/16 9:32 AM, Ales Novak wrote:
>> On 2016-2-1 12:51, Kieran Bingham wrote:
> 
>>>
>>> On 01/02/16 11:27, Kieran Bingham wrote:
>>>> Hi Ales,
>>>>
>>>> I'm just checking out your tree now to try locally.
>>>>
>>>> It sounds like there is a high level of cross over in our work,
>>>> but I believe our work can complement each other's if we work
>>>> together.
> 
>> Yes. Our primary intention is to open kdumps (i.e. dead images of
>> the fallen kernels), but what can be shared between live and dead
>> kernel debugging, should be shared...
> 
>>>> On 31/01/16 21:44, Ales Novak wrote:
>>>>> Following patches are adding basic ability to access Linux
>>>>> kernel dumps using the libkdumpfile library. They're creating
>>>>> new target "kdump", so all one has to do is to provide
>>>>> appropriate debuginfo and then run "target kdump
>>>>> /path/to/vmcore".
>>>>>
>>>>> The tasks of the dumped kernel are mapped to threads in gdb.
>>>>>
>>>>> Except for that, there's a code adding understanding of Linux
>>>>> SLAB memory allocator, which means we can tell for the given
>>>>> address to which SLAB does it belong, or list objects for
>>>>> give SLAB name - and more.
>>>>>
>>>>> Patches are against "gdb-7.10-release" (but will apply
>>>>> elsewhere).
>>>>>
>>>>> Note: registers of task are fetched accordingly - either from
>>>>> the dump metadata (the active tasks) or from their stacks. It
>>>>> should be noted that as this mechanism varies amongst the
>>>>> kernel versions and configurations, my naive implementation
>>>>> currently covers only the dumps I encounter, handling of
>>>>> different kernel versions is to be added.
>>>> In the work that I am doing, I had expected this to be done in
>>>> python for exactly this reason. The kernel version specifics,
>>>> (and architecture specifics) can then live alongside their
>>>> respective trees.
>>>>> In the near future, our plan is to remove the clumsy C-code
>>>>> handling this and reimplement it in Python - only the binding
>>>>> to certain gdb structures (e.g. thread, regcache) has to be
>>>>> added. A colleague of mine is already working on that.
>>>> This sounds exactly like the work I am doing right now. Could
>>>> you pass on my details to your colleague so we can discuss?
>>>
>>> Aha, or is your colleague Andreas Arnez? I'm just about to reply
>>> to his mail over on gbd@ next.
> 
>> No, it's Jeff Mahoney. His current efforts, which include Python
>> binding to threads' regcaches and more, are at:
> 
>> https://jeffm.io/git/cgit.cgi/gnu/binutils-gdb/log/
> 
>> And yes, you're right I've incorrectly removed autorship from some
>> of his older patches (which in fact are not necessary for the
>> current gdb-kdump to work, they are extending the Python binding).
> 
>> And as you've already found, his older patches are at:
> 
>> https://github.com/jeffmahoney/py-crash
> 
> Hi guys -
> 
> Ales gave me the heads up that you were discussing these.  The github
> repo is old and I haven't touched it in a year or so.  The link to my
> git server is the active one, but I should be clear that this is
> currently a WIP from my perspective.  I've been doing my work in the
> rel-7.10.1-kdump branch, which is based on the gdb-7.10.1-release tag,
> plus some SUSE patches to handle build-ids and external debuginfo files.

Of course, unstable branches are expected at this point. Thanks for the
reference.

Have you used the kernel python commands at all (CONFIG_GDB_SCRIPTS)? I
have implemented a few recently, although they're not quite finished yet
(mainly just lx-interrupts left to complete, the radix-tree parser
doesn't work yet)

The expected working commands include:
  lx-version
     (although I think we've discovered a bug in gdb.Value.string())
  lx-cmdline
  lx-iomem
  lx-ioports
  lx-meminfo
  lx-mounts

I'd love to hear if they work for you on a non-running target, or if
not, I can look at fixing them up.

I believe these commands are probably even more useful on non-running
targets than a running target!

My python work lives at:
https://git.linaro.org/people/kieran.bingham/linux.git gdb-patches



> This branch is subject to rebasing as I make progess, but there should
> be a stable base underneath it that I can condense and put into a
> separate branch for public consumption.

Of course the same applies to my branches I'm afraid :)
--
Kieran

> 
> -Jeff
> 
> 
>>>
>>>
>>>
>>>>
>>>> I recently made a posting on gdb@ suggesting the addition of a 
>>>> gdb.Target object to work towards implementing this, and I have
>>>> been liasing with Jan Kiszka to manage the Linux/scripts/gdb/
>>>> integration.
>>>>
>>>>
>>>>
>>>>> The github home of these patches is at:
>>>>>
>>>>> https://github.com/alesax/gdb-kdump/tree/for-next
>>>>>
>>>>> libkdumpfile lives at:
>>>>>
>>>>> https://github.com/ptesarik/libkdumpfile
>>>>>
>>>>> Fork adding the SLAB support lives at:
>>>>>
>>>>> https://github.com/tehcaster/gdb-kdump/tree/slab-support
>>>>>
>>>>>
>>>> Regards
>>>>
>>>> Kieran Bingham
>>>>
>>>
> 
> 
> 
> 


  reply	other threads:[~2016-02-02  9:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-31 21:45 Ales Novak
2016-01-31 21:45 ` [PATCH 3/4] Add SLAB allocator understanding Ales Novak
2016-02-01 13:21   ` Kieran Bingham
2016-02-01 22:30     ` Doug Evans
2016-02-02  2:05       ` Ales Novak
2016-02-02  7:22         ` Jan Kiszka
2016-02-02 13:22           ` Petr Tesarik
2016-02-02 14:42             ` Jeff Mahoney
2016-02-02  8:11       ` Kieran Bingham
2016-02-02 10:04     ` Vlastimil Babka
2016-01-31 21:45 ` [PATCH 1/4] Create new target "kdump" which uses libkdumpfile: https://github.com/ptesarik/libkdumpfile to access contents of compressed kernel dump Ales Novak
2016-02-04 12:40   ` Pedro Alves
2016-02-04 12:45     ` Ales Novak
2016-01-31 21:45 ` [PATCH 2/4] Add Jeff Mahoney's py-crash patches Ales Novak
2016-02-01 12:35   ` Kieran Bingham
2016-02-01 22:23   ` Doug Evans
2016-02-02  2:56     ` Jeff Mahoney
2016-02-02  8:25       ` Kieran Bingham
2016-02-03 17:55       ` Jeff Mahoney
2016-02-03 18:31         ` Doug Evans
2016-02-03 19:29           ` Jeff Mahoney
2016-02-04 17:25           ` Petr Tesarik
2016-02-04 18:32             ` Matt Rice
2016-02-04 22:27             ` Doug Evans
2016-01-31 21:45 ` [PATCH 4/4] Minor cleanups Ales Novak
2016-02-01 11:27 ` Enable gdb to open Linux kernel dumps Kieran Bingham
2016-02-01 11:51   ` Kieran Bingham
2016-02-01 14:32     ` Ales Novak
2016-02-01 15:01       ` Jeff Mahoney
2016-02-02  9:12         ` Kieran Bingham [this message]
2016-02-10  3:24         ` Jeff Mahoney

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=56B07305.7040905@gmail.com \
    --to=kieranbingham@gmail.com \
    --cc=alnovak@suse.cz \
    --cc=gdb-patches@sourceware.org \
    --cc=jeffm@suse.com \
    --cc=kieran.bingham@linaro.org \
    --cc=lee.jones@linaro.org \
    --cc=peter.griffin@linaro.org \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox