mbox series

[v2,0/2] rte_dump_stack: improvements

Message ID 20220212184433.66791-1-stephen@networkplumber.org (mailing list archive)
Headers
Series rte_dump_stack: improvements |

Message

Stephen Hemminger Feb. 12, 2022, 6:44 p.m. UTC
  This is update to earlier RFC. Add some more comments and changes
to have common code for Linux and FreeBSD

Stephen Hemminger (2):
  eal_debug: do not use malloc in rte_dump_stack
  eal: common rte_dump_stack for both Linux and FreeBSD

 lib/eal/freebsd/eal_debug.c | 43 ------------------------
 lib/eal/freebsd/meson.build |  1 -
 lib/eal/linux/eal_debug.c   | 43 ------------------------
 lib/eal/linux/meson.build   |  1 -
 lib/eal/unix/eal_debug.c    | 65 +++++++++++++++++++++++++++++++++++++
 lib/eal/unix/meson.build    |  5 +--
 6 files changed, 68 insertions(+), 90 deletions(-)
 delete mode 100644 lib/eal/freebsd/eal_debug.c
 delete mode 100644 lib/eal/linux/eal_debug.c
 create mode 100644 lib/eal/unix/eal_debug.c
  

Comments

Morten Brørup Feb. 14, 2022, 11:10 a.m. UTC | #1
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Saturday, 12 February 2022 19.45
> 
> This is update to earlier RFC. Add some more comments and changes
> to have common code for Linux and FreeBSD
> 
> Stephen Hemminger (2):
>   eal_debug: do not use malloc in rte_dump_stack
>   eal: common rte_dump_stack for both Linux and FreeBSD
> 
>  lib/eal/freebsd/eal_debug.c | 43 ------------------------
>  lib/eal/freebsd/meson.build |  1 -
>  lib/eal/linux/eal_debug.c   | 43 ------------------------
>  lib/eal/linux/meson.build   |  1 -
>  lib/eal/unix/eal_debug.c    | 65 +++++++++++++++++++++++++++++++++++++
>  lib/eal/unix/meson.build    |  5 +--
>  6 files changed, 68 insertions(+), 90 deletions(-)
>  delete mode 100644 lib/eal/freebsd/eal_debug.c
>  delete mode 100644 lib/eal/linux/eal_debug.c
>  create mode 100644 lib/eal/unix/eal_debug.c
> 
> --
> 2.34.1
> 

The dladdr() man page mentions that linking with -ldl is required; I assume this is already part of the DPDK EAL build system?

For the series,
Acked-by: Morten Brørup <mb@smartsharesystems.com>
  
Bruce Richardson Feb. 14, 2022, 11:51 a.m. UTC | #2
On Mon, Feb 14, 2022 at 12:10:30PM +0100, Morten Brørup wrote:
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Saturday, 12 February 2022 19.45
> > 
> > This is update to earlier RFC. Add some more comments and changes
> > to have common code for Linux and FreeBSD
> > 
> > Stephen Hemminger (2):
> >   eal_debug: do not use malloc in rte_dump_stack
> >   eal: common rte_dump_stack for both Linux and FreeBSD
> > 
> >  lib/eal/freebsd/eal_debug.c | 43 ------------------------
> >  lib/eal/freebsd/meson.build |  1 -
> >  lib/eal/linux/eal_debug.c   | 43 ------------------------
> >  lib/eal/linux/meson.build   |  1 -
> >  lib/eal/unix/eal_debug.c    | 65 +++++++++++++++++++++++++++++++++++++
> >  lib/eal/unix/meson.build    |  5 +--
> >  6 files changed, 68 insertions(+), 90 deletions(-)
> >  delete mode 100644 lib/eal/freebsd/eal_debug.c
> >  delete mode 100644 lib/eal/linux/eal_debug.c
> >  create mode 100644 lib/eal/unix/eal_debug.c
> > 
> > --
> > 2.34.1
> > 
> 
> The dladdr() man page mentions that linking with -ldl is required; I assume this is already part of the DPDK EAL build system?
>
Yes, we should be already linking against dl because of the use of dlopen
for loading drivers dynamically.
  
David Marchand April 7, 2022, 12:45 p.m. UTC | #3
On Sat, Feb 12, 2022 at 7:44 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> This is update to earlier RFC. Add some more comments and changes
> to have common code for Linux and FreeBSD
>
> Stephen Hemminger (2):
>   eal_debug: do not use malloc in rte_dump_stack
>   eal: common rte_dump_stack for both Linux and FreeBSD
>
>  lib/eal/freebsd/eal_debug.c | 43 ------------------------
>  lib/eal/freebsd/meson.build |  1 -
>  lib/eal/linux/eal_debug.c   | 43 ------------------------
>  lib/eal/linux/meson.build   |  1 -
>  lib/eal/unix/eal_debug.c    | 65 +++++++++++++++++++++++++++++++++++++
>  lib/eal/unix/meson.build    |  5 +--
>  6 files changed, 68 insertions(+), 90 deletions(-)
>  delete mode 100644 lib/eal/freebsd/eal_debug.c
>  delete mode 100644 lib/eal/linux/eal_debug.c
>  create mode 100644 lib/eal/unix/eal_debug.c

Strange to change only the Linux implementation as a first patch, then
merge implementations in a second time effectively changing FreeBSD
implementation in what is presented in commitlog as a factorisation
cleanup.
Please invert the patches.

Besides, the series does not compile on current main.
It's probably a result of the header inclusion cleanup we had in
v22.03, but I prefer you check.


Thanks.
  
Stephen Hemminger April 7, 2022, 11:06 p.m. UTC | #4
On Thu, 7 Apr 2022 14:45:07 +0200
David Marchand <david.marchand@redhat.com> wrote:

> On Sat, Feb 12, 2022 at 7:44 PM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > This is update to earlier RFC. Add some more comments and changes
> > to have common code for Linux and FreeBSD
> >
> > Stephen Hemminger (2):
> >   eal_debug: do not use malloc in rte_dump_stack
> >   eal: common rte_dump_stack for both Linux and FreeBSD
> >
> >  lib/eal/freebsd/eal_debug.c | 43 ------------------------
> >  lib/eal/freebsd/meson.build |  1 -
> >  lib/eal/linux/eal_debug.c   | 43 ------------------------
> >  lib/eal/linux/meson.build   |  1 -
> >  lib/eal/unix/eal_debug.c    | 65 +++++++++++++++++++++++++++++++++++++
> >  lib/eal/unix/meson.build    |  5 +--
> >  6 files changed, 68 insertions(+), 90 deletions(-)
> >  delete mode 100644 lib/eal/freebsd/eal_debug.c
> >  delete mode 100644 lib/eal/linux/eal_debug.c
> >  create mode 100644 lib/eal/unix/eal_debug.c  
> 
> Strange to change only the Linux implementation as a first patch, then
> merge implementations in a second time effectively changing FreeBSD
> implementation in what is presented in commitlog as a factorisation
> cleanup.
> Please invert the patches.
> 
> Besides, the series does not compile on current main.
> It's probably a result of the header inclusion cleanup we had in
> v22.03, but I prefer you check.
> 
> 
> Thanks.


As I looked at it more, there was more there.
Turns out that printf and therefore rte_log() is not signal safe.
There is a version of backtrace_symbols_fd that just uses writev() on  glibc for Linux
so that is a better alternative, but format changes.

But the BSD version of backtrace_symbols_fd uses printf and is therefore not signal safe.
Not sure if that matters.