mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
9pfs: improve v9fs_open() tracing
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> Message-Id: <E1tTgDR-000oRr-9g@kylie.crudebyte.com>
This commit is contained in:
parent
a2f17bd40b
commit
9a0dd4b3e4
5 changed files with 66 additions and 2 deletions
|
@ -267,4 +267,10 @@ int pthread_fchdir_np(int fd) __attribute__((weak_import));
|
|||
#endif
|
||||
int qemu_mknodat(int dirfd, const char *filename, mode_t mode, dev_t dev);
|
||||
|
||||
/*
|
||||
* Returns a newly allocated string presentation of open() flags, intended
|
||||
* for debugging (tracing) purposes only.
|
||||
*/
|
||||
char *qemu_open_flags_tostr(int flags);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue