* [SPDK] gdb macros
@ 2019-01-27 12:47 Shahar Salzman
0 siblings, 0 replies; 6+ messages in thread
From: Shahar Salzman @ 2019-01-27 12:47 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 1470 bytes --]
Hi,
Been debugging some spdk issues lately (mainly crashes due to my ineptitude).
In order to print out the bdevs, subsystems, io_channels and threads, I wrote a few python gdb macros that may be useful to others.
Do these macros have a place in the project? If so, where do I put them in, scripts?
Shahar
P.S. Here is an example:
(gdb) spdk_print_threads
SPDK object of type struct spdk_thead at 0x7f7f7c008980
((struct spdk_thead*) 0x7f7f7c008980)
name 0x7f7f7c000f70 "reactor_1"
IO Channels:
SPDK object of type struct spdk_io_channel at 0x7f7f7c83b730
((struct spdk_io_channel*) 0x7f7f7c83b730)
name
ref 1
device 0x7f7f7c008b50 (0x7f7f7c008bb0 "nvmf_tgt")
---------------
SPDK object of type struct spdk_io_channel at 0x7f7f7ca532f0
((struct spdk_io_channel*) 0x7f7f7ca532f0)
name
ref 7
device 0x7f7f7c008e20 (0x7f7f7c008e80 "rdma_transport")
---------------
(gdb) spdk_print_nvmf_subsystems
SPDK object of type struct spdk_nvmf_subsystem at 0x7f7f7c008bd0
((struct spdk_nvmf_subsystem*) 0x7f7f7c008bd0)
name "nqn.2014-08.org.nvmexpress.discovery", '\000' <repeats 187 times>
nqn "nqn.2014-08.org.nvmexpress.discovery", '\000' <repeats 187 times>
ID 0
(gdb) spdk_print_io_devices
SPDK object of type struct io_device at 0x7f7f7c0053e0
((struct io_device*) 0x7f7f7c0053e0)
name 0x7f7f7c008590 "memcpy_engine"
...
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPDK] gdb macros
@ 2019-01-28 5:16 Cao, Gang
0 siblings, 0 replies; 6+ messages in thread
From: Cao, Gang @ 2019-01-28 5:16 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 2016 bytes --]
Thanks Shahar on your sharing of these valuable gdb scripts.
Maybe you can submit into <spdk_root_folder>/scripts folder and have a proper name like gdb_macro.
Thanks,
Gang
-----Original Message-----
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Shahar Salzman
Sent: Sunday, January 27, 2019 8:47 PM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] gdb macros
Hi,
Been debugging some spdk issues lately (mainly crashes due to my ineptitude).
In order to print out the bdevs, subsystems, io_channels and threads, I wrote a few python gdb macros that may be useful to others.
Do these macros have a place in the project? If so, where do I put them in, scripts?
Shahar
P.S. Here is an example:
(gdb) spdk_print_threads
SPDK object of type struct spdk_thead at 0x7f7f7c008980 ((struct spdk_thead*) 0x7f7f7c008980) name 0x7f7f7c000f70 "reactor_1"
IO Channels:
SPDK object of type struct spdk_io_channel at 0x7f7f7c83b730
((struct spdk_io_channel*) 0x7f7f7c83b730)
name
ref 1
device 0x7f7f7c008b50 (0x7f7f7c008bb0 "nvmf_tgt")
---------------
SPDK object of type struct spdk_io_channel at 0x7f7f7ca532f0
((struct spdk_io_channel*) 0x7f7f7ca532f0)
name
ref 7
device 0x7f7f7c008e20 (0x7f7f7c008e80 "rdma_transport")
---------------
(gdb) spdk_print_nvmf_subsystems
SPDK object of type struct spdk_nvmf_subsystem at 0x7f7f7c008bd0 ((struct spdk_nvmf_subsystem*) 0x7f7f7c008bd0) name "nqn.2014-08.org.nvmexpress.discovery", '\000' <repeats 187 times> nqn "nqn.2014-08.org.nvmexpress.discovery", '\000' <repeats 187 times> ID 0
(gdb) spdk_print_io_devices
SPDK object of type struct io_device at 0x7f7f7c0053e0 ((struct io_device*) 0x7f7f7c0053e0) name 0x7f7f7c008590 "memcpy_engine"
...
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPDK] gdb macros
@ 2019-01-28 14:39 Shahar Salzman
0 siblings, 0 replies; 6+ messages in thread
From: Shahar Salzman @ 2019-01-28 14:39 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 2712 bytes --]
Posted the code for review:
https://review.gerrithub.io/c/spdk/spdk/+/442325
I know that there is a ton of additional information which can be shown for these objects.
I currently implemented what was useful to me, I will probably add some more later on when other needs arise, but this should be a nice starting point.
________________________________
From: SPDK <spdk-bounces(a)lists.01.org> on behalf of Cao, Gang <gang.cao(a)intel.com>
Sent: Monday, January 28, 2019 7:16 AM
To: Storage Performance Development Kit
Subject: Re: [SPDK] gdb macros
Thanks Shahar on your sharing of these valuable gdb scripts.
Maybe you can submit into <spdk_root_folder>/scripts folder and have a proper name like gdb_macro.
Thanks,
Gang
-----Original Message-----
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Shahar Salzman
Sent: Sunday, January 27, 2019 8:47 PM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] gdb macros
Hi,
Been debugging some spdk issues lately (mainly crashes due to my ineptitude).
In order to print out the bdevs, subsystems, io_channels and threads, I wrote a few python gdb macros that may be useful to others.
Do these macros have a place in the project? If so, where do I put them in, scripts?
Shahar
P.S. Here is an example:
(gdb) spdk_print_threads
SPDK object of type struct spdk_thead at 0x7f7f7c008980 ((struct spdk_thead*) 0x7f7f7c008980) name 0x7f7f7c000f70 "reactor_1"
IO Channels:
SPDK object of type struct spdk_io_channel at 0x7f7f7c83b730
((struct spdk_io_channel*) 0x7f7f7c83b730)
name
ref 1
device 0x7f7f7c008b50 (0x7f7f7c008bb0 "nvmf_tgt")
---------------
SPDK object of type struct spdk_io_channel at 0x7f7f7ca532f0
((struct spdk_io_channel*) 0x7f7f7ca532f0)
name
ref 7
device 0x7f7f7c008e20 (0x7f7f7c008e80 "rdma_transport")
---------------
(gdb) spdk_print_nvmf_subsystems
SPDK object of type struct spdk_nvmf_subsystem at 0x7f7f7c008bd0 ((struct spdk_nvmf_subsystem*) 0x7f7f7c008bd0) name "nqn.2014-08.org.nvmexpress.discovery", '\000' <repeats 187 times> nqn "nqn.2014-08.org.nvmexpress.discovery", '\000' <repeats 187 times> ID 0
(gdb) spdk_print_io_devices
SPDK object of type struct io_device at 0x7f7f7c0053e0 ((struct io_device*) 0x7f7f7c0053e0) name 0x7f7f7c008590 "memcpy_engine"
...
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPDK] gdb macros
@ 2019-01-28 14:44 Shahar Salzman
0 siblings, 0 replies; 6+ messages in thread
From: Shahar Salzman @ 2019-01-28 14:44 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 3092 bytes --]
For some reason jenkins failed with a link to a page with http error 404.
Not sure of the reason, this code doesn't go in any test/lib, and I ran the check_format.sh tool before I did my local commit...
________________________________
From: Shahar Salzman
Sent: Monday, January 28, 2019 4:39 PM
To: Cao, Gang; Storage Performance Development Kit
Subject: Re: gdb macros
Posted the code for review:
https://review.gerrithub.io/c/spdk/spdk/+/442325
I know that there is a ton of additional information which can be shown for these objects.
I currently implemented what was useful to me, I will probably add some more later on when other needs arise, but this should be a nice starting point.
________________________________
From: SPDK <spdk-bounces(a)lists.01.org> on behalf of Cao, Gang <gang.cao(a)intel.com>
Sent: Monday, January 28, 2019 7:16 AM
To: Storage Performance Development Kit
Subject: Re: [SPDK] gdb macros
Thanks Shahar on your sharing of these valuable gdb scripts.
Maybe you can submit into <spdk_root_folder>/scripts folder and have a proper name like gdb_macro.
Thanks,
Gang
-----Original Message-----
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Shahar Salzman
Sent: Sunday, January 27, 2019 8:47 PM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] gdb macros
Hi,
Been debugging some spdk issues lately (mainly crashes due to my ineptitude).
In order to print out the bdevs, subsystems, io_channels and threads, I wrote a few python gdb macros that may be useful to others.
Do these macros have a place in the project? If so, where do I put them in, scripts?
Shahar
P.S. Here is an example:
(gdb) spdk_print_threads
SPDK object of type struct spdk_thead at 0x7f7f7c008980 ((struct spdk_thead*) 0x7f7f7c008980) name 0x7f7f7c000f70 "reactor_1"
IO Channels:
SPDK object of type struct spdk_io_channel at 0x7f7f7c83b730
((struct spdk_io_channel*) 0x7f7f7c83b730)
name
ref 1
device 0x7f7f7c008b50 (0x7f7f7c008bb0 "nvmf_tgt")
---------------
SPDK object of type struct spdk_io_channel at 0x7f7f7ca532f0
((struct spdk_io_channel*) 0x7f7f7ca532f0)
name
ref 7
device 0x7f7f7c008e20 (0x7f7f7c008e80 "rdma_transport")
---------------
(gdb) spdk_print_nvmf_subsystems
SPDK object of type struct spdk_nvmf_subsystem at 0x7f7f7c008bd0 ((struct spdk_nvmf_subsystem*) 0x7f7f7c008bd0) name "nqn.2014-08.org.nvmexpress.discovery", '\000' <repeats 187 times> nqn "nqn.2014-08.org.nvmexpress.discovery", '\000' <repeats 187 times> ID 0
(gdb) spdk_print_io_devices
SPDK object of type struct io_device at 0x7f7f7c0053e0 ((struct io_device*) 0x7f7f7c0053e0) name 0x7f7f7c008590 "memcpy_engine"
...
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPDK] gdb macros
@ 2019-01-28 16:02 Luse, Paul E
0 siblings, 0 replies; 6+ messages in thread
From: Luse, Paul E @ 2019-01-28 16:02 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 2926 bytes --]
Yeah, it be great to have this collection grow! We do need to be careful though as these scripts will need to be maintained as structures change in patches where maybe folks don't realize and/or don't use the gdb scripts. I think it's OK to start them now with a readme that has a disclaimer on it or something btu we should look and see about some quick tests - if each can be run automated with a minimal app and we can use something like match to check the results that be really cool. Maintainers, other thoughts?
Thx
Paul
-----Original Message-----
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Cao, Gang
Sent: Sunday, January 27, 2019 10:17 PM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: Re: [SPDK] gdb macros
Thanks Shahar on your sharing of these valuable gdb scripts.
Maybe you can submit into <spdk_root_folder>/scripts folder and have a proper name like gdb_macro.
Thanks,
Gang
-----Original Message-----
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Shahar Salzman
Sent: Sunday, January 27, 2019 8:47 PM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] gdb macros
Hi,
Been debugging some spdk issues lately (mainly crashes due to my ineptitude).
In order to print out the bdevs, subsystems, io_channels and threads, I wrote a few python gdb macros that may be useful to others.
Do these macros have a place in the project? If so, where do I put them in, scripts?
Shahar
P.S. Here is an example:
(gdb) spdk_print_threads
SPDK object of type struct spdk_thead at 0x7f7f7c008980 ((struct spdk_thead*) 0x7f7f7c008980) name 0x7f7f7c000f70 "reactor_1"
IO Channels:
SPDK object of type struct spdk_io_channel at 0x7f7f7c83b730
((struct spdk_io_channel*) 0x7f7f7c83b730)
name
ref 1
device 0x7f7f7c008b50 (0x7f7f7c008bb0 "nvmf_tgt")
---------------
SPDK object of type struct spdk_io_channel at 0x7f7f7ca532f0
((struct spdk_io_channel*) 0x7f7f7ca532f0)
name
ref 7
device 0x7f7f7c008e20 (0x7f7f7c008e80 "rdma_transport")
---------------
(gdb) spdk_print_nvmf_subsystems
SPDK object of type struct spdk_nvmf_subsystem at 0x7f7f7c008bd0 ((struct spdk_nvmf_subsystem*) 0x7f7f7c008bd0) name "nqn.2014-08.org.nvmexpress.discovery", '\000' <repeats 187 times> nqn "nqn.2014-08.org.nvmexpress.discovery", '\000' <repeats 187 times> ID 0
(gdb) spdk_print_io_devices
SPDK object of type struct io_device at 0x7f7f7c0053e0 ((struct io_device*) 0x7f7f7c0053e0) name 0x7f7f7c008590 "memcpy_engine"
...
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPDK] gdb macros
@ 2019-01-28 16:42 Walker, Benjamin
0 siblings, 0 replies; 6+ messages in thread
From: Walker, Benjamin @ 2019-01-28 16:42 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 889 bytes --]
On Mon, 2019-01-28 at 14:44 +0000, Shahar Salzman wrote:
> For some reason jenkins failed with a link to a page with http error 404.
> Not sure of the reason, this code doesn't go in any test/lib, and I ran the
> check_format.sh tool before I did my local commit...
>
> Posted the code for review:
> https://review.gerrithub.io/c/spdk/spdk/+/442325
>
> I know that there is a ton of additional information which can be shown for
> these objects.
> I currently implemented what was useful to me, I will probably add some more
> later on when other needs arise, but this should be a nice starting point.
Thanks so much for writing these! I'm going to pick up the discussion as
comments on that code review. I think tooling like this is absolutely invaluable
to SPDK (and it really shows how much easier it is to program in user space than
in the kernel).
Thanks,
Ben
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-01-28 16:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-28 16:42 [SPDK] gdb macros Walker, Benjamin
-- strict thread matches above, loose matches on Subject: below --
2019-01-28 16:02 Luse, Paul E
2019-01-28 14:44 Shahar Salzman
2019-01-28 14:39 Shahar Salzman
2019-01-28 5:16 Cao, Gang
2019-01-27 12:47 Shahar Salzman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox