2#include <clues/syscalls/thread.hxx>
32 using enum item::FutexOperation::Command;
34 auto setNewReturnItem = [
this](
auto &new_ret) {
39 auto setWokenUpReturnValue = [
this, setNewReturnItem]() {
44 const auto command = operation.command();
47 case WAIT: [[fallthrough]];
49 value.emplace(item::Uint32Value{
"value"});
51 if (command == WAIT) {
58 case WAKE: [[fallthrough]];
60 wake_count.emplace(item::Uint32Value{
"nwakeup",
"number of waiters to wake up"});
61 if (command == WAKE) {
68 setWokenUpReturnValue();
81 case REQUEUE: [[fallthrough]];
82 case CMP_REQUEUE: [[fallthrough]];
84 wake_count.emplace(item::Uint32Value{
"nwakeup",
"number of waiters to wake up"});
85 requeue_limit.emplace(item::Uint32Value{
"val2",
"max number of waiters to requeue"});
87 if (command == REQUEUE) {
90 requeue_value.emplace(item::Uint32Value{
"val3",
"comparison value"});
94 setWokenUpReturnValue();
97 wake_count.emplace(item::Uint32Value{
"nwakeup",
"number of waiters to wake up at addr1"});
98 wake_count2.emplace(item::Uint32Value{
"nwakeup2",
"number of waiters to wake up at addr2"});
103 setWokenUpReturnValue();
105 case LOCK_PI: [[fallthrough]];
111 addParameters(item::unused, *
timeout);
113 case TRYLOCK_PI: [[fallthrough]];
117 case WAIT_REQUEUE_PI:
118 value.emplace(item::Uint32Value{
"value"});
void setReturnItem(SystemCallItem &ret)
Sets the return value system call item.
ParameterVector m_pars
The array of system call parameters, if any.
Base class for traced processes.
Base class for file descriptor system call items.
Composite bit values used in val3 for futex() operation FUTEX_WAKE_OP.
Base class for a system call return values.
A signal number specification.
An always-success return value.
The struct timespec used for various timing and timeout operations in system calls.
@ RETVAL
A system call return value.
void updateFDTracking(const Tracee &proc) override
Update file descriptor tracking.
std::optional< item::Uint32Value > wake_count2
! "val2", number of waiters at futex2_addr to wakeup (WAKE_OP).
std::optional< item::Uint32Value > requeue_limit
! "val2", upper limit on waiters to be requeued to addr2 (REQUEUE, CMP_REQUEUE, CMP_REQUEUE_PI).
std::optional< item::FileDescriptor > new_fd
! new file descriptor (CREATE_FD).
std::optional< item::FutexWakeOperation > wake_op
! instructions for how to perform the wake operation (WAKE_OP).
std::optional< item::Uint32Value > requeue_value
! "val3" used for comparison in CMP_REQUEUE, CMP_REQUEUE_PI.
std::optional< item::GenericPointerValue > bitset
! bitset to restrict wait/wakeup (FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET).
std::optional< item::Uint32Value > wake_count
! number of waiters to wake up (WAKE, REQUEUE, CMP_REQUEUE, WAKE_OP, CMD_REQUEUE_PI).
std::optional< item::Uint32Value > value
! the value expected at futex_addr (WAIT, WAIT_REQUEUE_PI).
void prepareNewSystemCall() override
Perform any necessary actions before processing a new system call entry event.
std::optional< item::TimeSpecParameter > timeout
! optional relative timeout (WAIT) or absolute timeout (WAIT_BITSET, LOCK_PI, LOCK_PI2).
std::optional< item::SuccessResult > result
! success status (all remaining operations).
std::optional< item::SignalNumber > fd_sig
! signal used for asynchronous notifications (CREATE_FD).
std::optional< item::GenericPointerValue > futex2_addr
! "uaddr2" requeue address (REQUEUE, CMP_REQUEUE, CMP_REQUEUE_PI, WAIT_REQUEUE_PI) or additional fute...
bool check2ndPass(const Tracee &) override
Check whether a second pass needs to be made processing parameters.
std::optional< item::ReturnValue > num_woken_up
! number of waiters woken up (WAKE, WAKE_OP).