Skip to content

io_pgetevents

Intro

io_pgetevents - retrieves at least min_nr and at most nr of completed and ready aio operations

Description

The io_pgetevents syscall retrieves at least min_nr and at most nr of completed and ready aio operations (submitted via io_submit) and up to nr jopbs wich have been canceled. The operations are identified by ctx_id - the AIO context which contains them.

events is a pointer to an array of io_event structures - to which the completed/ready events' results will be stored. timeout specifies a timeout which limits the amount of time this call will block. usig can be used to request a signal to be sent when ready/completed events are available.

The buffers which were submitted with io_submit must not be changed until io_pgetevents is finished.

Arguments

  • ctx_id:aio_context_t - The aio context which contains the operations to be retrieved.
  • min_nr:long - The minimum amount of operations to retrieve. If less than this amount of operations are available, the call will block until the desired amount is ready.
  • nr:long - The maximum amount of operations to retrieve.
  • events:struct io_event*[K] - A pointer to an array of io_event structures, to be filled in with the operations' results.
  • timeout:struct timespec*[K] - A timeout value - the call will block no longer than this.
  • usig:const struct __aio_sigset*[K] - A pointer to an __aio_sigset structure which specifies an optional signal to be sent when events become available.

Available Tags

  • K - Originated from kernel-space.

Hooks

sys_io_pgetevents

Type

Kprobe + Kretprobe

Purpose

Analyze and profile AIO operations in order to debug and improve system performance.

Example Use Case

An application utilizing AIO operations needs to be tested in order to find out if there are any issues with operation latency or the amount of calls with the same arguments. Using io_pgetevents in conjunction with a tracing software to retrieve AIO operation data can help identify issues and improve performance.

Issues

Care must be taken with arguments which might change between the time they are checked ("time of check") and the time they are used ("time of use"), as they might result in errors.

  • io_submit - Submitting AIO operations
  • io_cancel - Cancel AIO operations
  • aio_sigset - Update aio code's signal settings.

This document was automatically generated by OpenAI and needs review. It might not be accurate and might contain errors. The authors of Tracee recommend that the user reads the "events.go" source file to understand the events and their arguments better.