libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
signals.hxx
1#pragma once
2
3// clues
4#include <clues/items/signal.hxx>
5#include <clues/items/process.hxx>
6#include <clues/sysnrs/generic.hxx>
7#include <clues/SystemCall.hxx>
8
9namespace clues {
10
11struct CLUES_API AlarmSystemCall :
12 public SystemCall {
13
14 AlarmSystemCall() :
15 SystemCall{SystemCallNr::ALARM},
16 seconds{"seconds"},
17 old_seconds{"old_seconds", "remaining seconds from previous timer", ItemType::RETVAL} {
18 setReturnItem(old_seconds);
19 setParameters(seconds);
20 }
21
22 item::UintValue seconds;
23 item::UintValue old_seconds;
24};
25
27struct CLUES_API SigActionSystemCall :
28 public SystemCall {
29
30 explicit SigActionSystemCall(const SystemCallNr nr = SystemCallNr::SIGACTION) :
31 SystemCall{nr},
32 old_action{"old_action", "struct sigaction", ItemType::PARAM_OUT} {
33 setReturnItem(result);
34 setParameters(signum, action, old_action);
35 }
36
37 /* parameters */
38 item::SignalNumber signum;
40 item::SigActionParameter old_action;
41
42 /* return value */
44};
45
47struct CLUES_API RtSigActionSystemCall :
48 public SigActionSystemCall {
49
50 explicit RtSigActionSystemCall() :
51 SigActionSystemCall{SystemCallNr::RT_SIGACTION},
52 sigset_size{"sigset_size", "sizeof(sigset_t)"} {
53 addParameters(sigset_size);
54 }
55
57
62 item::SizeValue sigset_size;
63};
64
66struct CLUES_API SigProcMaskSystemCall :
67 public SystemCall {
68
69 explicit SigProcMaskSystemCall(const SystemCallNr nr = SystemCallNr::SIGPROCMASK) :
70 SystemCall{nr},
71 new_mask{ItemType::PARAM_IN, "new mask"},
72 old_mask{ItemType::PARAM_OUT, "old mask"} {
73 setReturnItem(result);
74 setParameters(operation, new_mask, old_mask);
75 }
76
77 /* parameters */
78 item::SigSetOperation operation;
79 item::SigSetParameter new_mask;
80 item::SigSetParameter old_mask;
81
82 /* return value */
84};
85
87struct CLUES_API RtSigProcMaskSystemCall :
88 public SigProcMaskSystemCall {
89
90 explicit RtSigProcMaskSystemCall() :
91 SigProcMaskSystemCall{SystemCallNr::RT_SIGPROCMASK},
92 sigset_size{"sigset_size", "sizeof(sigset_t)"} {
93 addParameters(sigset_size);
94 }
95
97 item::SizeValue sigset_size;
98};
99
100struct CLUES_API TgKillSystemCall :
101 public SystemCall {
102
103 TgKillSystemCall() :
104 SystemCall{SystemCallNr::TGKILL},
105 thread_group{ItemType::PARAM_IN, "thread group id"},
106 thread_id{ItemType::PARAM_IN} {
107 setReturnItem(result);
108 setParameters(thread_group, thread_id, signum);
109 }
110
111 /* parameters */
112 item::ProcessIDItem thread_group;
113 item::ThreadIDItem thread_id;
114 item::SignalNumber signum;
115
116 /* return value */
117 item::SuccessResult result;
118};
119
120} // end ns
void setReturnItem(SystemCallItem &ret)
Sets the return value system call item.
SystemCall(const SystemCallNr nr)
Instantiates a new SystemCall object with given properties.
The struct sigaction used in various signal related system calls.
Definition signal.hxx:76
The operation to performed on a signal set.
Definition signal.hxx:17
A set of POSIX signals for setting or masking in the context of various system calls.
Definition signal.hxx:102
A signal number specification.
Definition signal.hxx:51
An always-success return value.
Definition error.hxx:15
@ PARAM_OUT
An output parameter filled by in by the system call.
@ PARAM_IN
An input parameter to the system call.
@ RETVAL
A system call return value.
SystemCallNr
Abstract system call number usable across architectures and ABIs.
Definition generic.hxx:29
item::SizeValue sigset_size
Provides sizeof(sigset_t) as found in the sigaction struct.
Definition signals.hxx:62
item::SizeValue sigset_size
size of sigset_t, fixed to "8".
Definition signals.hxx:97