[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] 9pfs: improve v9fs_walk() tracing
From: |
Christian Schoenebeck |
Subject: |
Re: [PATCH v2] 9pfs: improve v9fs_walk() tracing |
Date: |
Wed, 11 Dec 2024 11:53:07 +0100 |
On Friday, December 6, 2024 4:56:40 PM CET Christian Schoenebeck wrote:
> 'Twalk' is the most important request type in the 9p protocol to look out
> for when debugging 9p communication. That's because it is the only part
> of the 9p protocol which actually deals with human-readable path names,
> whereas all other 9p request types work on numeric file IDs (FIDs) only.
>
> Improve tracing of 'Twalk' requests, e.g. let's say client wanted to walk
> to "/home/bob/src", then improve trace output from:
>
> v9fs_walk tag 0 id 110 fid 0 newfid 1 nwnames 3
>
> to:
>
> v9fs_walk tag=0 id=110 fid=0 newfid=1 nwnames=3 wnames={home, bob, src}
>
> To achieve this, add a new helper function trace_v9fs_walk_wnames() which
> converts the received V9fsString array of individual path elements into a
> comma-separated string presentation for being passed to the tracing system.
> As this conversion is somewhat expensive, this conversion function is only
> called if tracing of event 'v9fs_walk' is currently enabled.
>
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> Reviewed-by: Greg Kurz <groug@kaod.org>
> ---
> V2:
> - Use trace_event_get_state_backends(TRACE_V9FS_WALK) instead of
> trace_event_get_state(TRACE_V9FS_WALK) && qemu_loglevel_mask(LOG_TRACE).
> - Move that check from helper function trace_v9fs_walk_wnames() to caller
> function v9fs_walk().
>
> hw/9pfs/9p.c | 36 +++++++++++++++++++++++++++++++-----
> hw/9pfs/trace-events | 2 +-
> 2 files changed, 32 insertions(+), 6 deletions(-)
Queued on 9p.next:
https://github.com/cschoenebeck/qemu/commits/9p.next
Thanks!
/Christian