From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <groug@kaod.org>, Stefan Hajnoczi <stefanha@redhat.com>,
Mads Ynddal <mads@ynddal.dk>
Subject: Re: [PATCH v2] 9pfs: improve v9fs_walk() tracing
Date: Wed, 11 Dec 2024 11:53:07 +0100 [thread overview]
Message-ID: <8337596.dz3T9txbhL@silver> (raw)
In-Reply-To: <E1tJamT-007Cqk-9E@kylie.crudebyte.com>
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
prev parent reply other threads:[~2024-12-11 10:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 15:56 [PATCH v2] 9pfs: improve v9fs_walk() tracing Christian Schoenebeck
2024-12-06 17:19 ` Stefan Hajnoczi
2024-12-11 10:53 ` Christian Schoenebeck [this message]
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=8337596.dz3T9txbhL@silver \
--to=qemu_oss@crudebyte.com \
--cc=groug@kaod.org \
--cc=mads@ynddal.dk \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).