This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: relate io_submit to io_getevents


"Sloot, Hans-Peter" <hans-peter.sloot@atosorigin.com> writes:

> [...]
> It seems that parameter 1 is the same for related calls.
>
> io_submit(47052561891328, 1, {{0x2acb475edfe0, 0, 1, 0, 34}}) = 1
> gettimeofday({1294832202, 259883}, NULL) = 0
> io_getevents(47052561891328, 1, 128, {{0x2acb475edfe0, 0x2acb475edfe0,
> 8192, 0}}, {600, 0}) = 1
>
> Is there a way that I can read parameter #1 so that I can relate them?

Certainly.  List the probe points and available script/context
variables:

% stap -L 'syscall.io_*'

syscall.io_cancel name:string ctx_id:long iocb_uaddr:long result_uaddr:long argstr:string $ctx_id:aio_context_t $iocb:struct iocb* $result:struct io_event* $__func__:char[] const
syscall.io_destroy name:string ctx:long argstr:string $ctx:aio_context_t $__func__:char[] const
syscall.io_getevents name:string ctx_id:long min_nr:long nr:long events_uaddr:long timeout_uaddr:long timestr:string argstr:string $ctx_id:aio_context_t $min_nr:long int $nr:long int $events:struct io_event* $timeout:struct timespec*
syscall.io_setup name:string maxevents:long ctxp_uaddr:long argstr:string $nr_events:unsigned int $ctxp:aio_context_t* $__func__:char[] const
syscall.io_submit name:string ctx_id:long nr:long iocbpp_uaddr:long argstr:string $ctx_id:aio_context_t $nr:long int $iocbpp:struct iocb**

The ctx and/or ctx_id variables give you that value.  (io_destroy
calls it "ctx", inconsistently with the others.)  So

% stap -e 'probe syscall.io_submit, syscall.io_getevents {
  println(ctx_id)  /* or store it into a script global, or whatever */
}'


- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]