[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] 9pfs: improve v9fs_open() tracing
From: |
Christian Schoenebeck |
Subject: |
Re: [PATCH] 9pfs: improve v9fs_open() tracing |
Date: |
Mon, 30 Dec 2024 10:50:59 +0100 |
On Monday, December 16, 2024 11:30:09 AM CET Christian Schoenebeck wrote:
> Improve tracing of 9p 'Topen' request type by showing open() flags as
> human-readable text.
>
> E.g. trace output:
>
> v9fs_open tag 0 id 12 fid 2 mode 100352
>
> would become:
>
> v9fs_open tag=0 id=12 fid=2 mode=100352(RDONLY|NONBLOCK|DIRECTORY|
> TMPFILE|NDELAY)
>
> Therefor add a new utility function qemu_open_flags_tostr() that converts
> numeric open() flags from host's native O_* flag constants to a string
> presentation.
>
> 9p2000.L and 9p2000.u protocol variants use different numeric 'mode'
> constants for 'Topen' requests. Instead of writing string conversion code
> for both protocol variants, use the already existing conversion functions
> that convert the mode flags from respective protocol constants to host's
> native open() numeric flag constants and pass that result to the new
> string conversion function qemu_open_flags_tostr().
>
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
> hw/9pfs/9p-util-generic.c | 44 +++++++++++++++++++++++++++++++++++++++
> hw/9pfs/9p-util.h | 6 ++++++
> hw/9pfs/9p.c | 9 +++++++-
> hw/9pfs/meson.build | 1 +
> hw/9pfs/trace-events | 2 +-
> 5 files changed, 60 insertions(+), 2 deletions(-)
> create mode 100644 hw/9pfs/9p-util-generic.c
Queued on 9p.next:
https://github.com/cschoenebeck/qemu/commits/9p.next
Thanks!
/Christian