Display the arguments of aio_read(2), aio_write(2), aio_suspend(2), aio_error(2), aio_return(2), aio_cancel(2), aio_fsync(2), aio_mlock(2), aio_waitcomplete(2) and lio_listio(2) in human-readable form.
Details
- Reviewers
asomers - Commits
- rS368500: truss: Add AIO syscalls.
Trace simple test programs. Example output:
aio_read({ 3,0,0x7fffffffc5f0,1,LIO_NOP,{ sigev_notify=SIGEV_NONE } }) = 0 (0x0) aio_waitcomplete({ 3,0,0x7fffffffc5f0,1,LIO_NOP,{ sigev_notify=SIGEV_NONE } },{ 1.000000000 }) = 1 (0x1) lio_listio(LIO_NOWAIT,[{ 3,0,0x7fffffffc5f0,1,LIO_READ,{ sigev_notify=SIGEV_NONE } },{ 3,0,0x7fffffffc5f0,1,LIO_WRITE,{ sigev_notify=SIGEV_NONE } }],2,0x0) = 0 (0x0)
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
This looks like a good change, but I'm not a truss user. I use ktrace instead. With this patch, how does the output of truss compare to ktrace? And could you also please add aio_mlock?
I'm not too familiar with ktrace, but kdump doesn't seem to show the contents of the aiocb structs/arrays, just pointers; with -r it shows some other structs as STRU records but not these ones, perhaps some ktrstruct() calls might need to be sprinkled in vfs_aio.c?
96425 a.out CALL lio_listio(LIO_NOWAIT,0x7fffffffb0d0,0x2,0) 96425 a.out RET lio_listio 0
usr.bin/truss/syscalls.c | ||
---|---|---|
1384 ↗ | (On Diff #80467) | Probably not very useful to print sigev_notify_function if it's just a pointer, don't you think? |
2732 ↗ | (On Diff #80467) | This limit is obsolete. I removed it in r324941 (but now I see that I neglected to update the man page accordingly). You should either malloc cbs so there won't be a limit, or else impose some reasonable limit based on the text format of the output, or something like that. |
Dropped the SIGEV_THREAD function pointer. Switched to a hardcoded limit on how many lio_listio array elements to display, following a coding pattern from nearby similar things.
Thanks for doing this. It looks like it could be pretty helpful. Helpful enough that I may need to learn to start using truss.
Thanks for the review! I've found this useful for debugging a complicated AIO-based app.