24 switch (event.
type()) {
25 case EventType::EVENT_FAST_SYSCALL: {
26 SystemCall* syscall =
event.syscall().handler();
33 event.syscall().hook_return(
true);
39 event.syscall().hook_return(
true);
50 case EventType::EVENT_FAST_SYSCALL_RET: {
66 : flush_(flush), json_(json), unsupported_(unsupported) {}
70 void write_syscall(
const Event& event) {
71 std::lock_guard lock(mtx_);
73 const Vcpu& vcpu =
event.vcpu();
74 std::cout <<
"Vcpu " << vcpu.
id() <<
": [" <<
event.task().pid() <<
":"
75 <<
event.task().tid() <<
"] " <<
event.task().process_name() <<
'\n';
76 std::cout <<
event.syscall().name() <<
'\n';
78 event.syscall().handler()->write();
83 void write_json(
const Event& event) {
84 std::lock_guard lock(mtx_);
85 std::cout <<
event.json() <<
'\n';
93 const bool unsupported_;
Definition SystemCallMonitor.hh:21
SystemCallMonitor(bool flush, bool json, bool unsupported)
Definition SystemCallMonitor.hh:65
~SystemCallMonitor()
Definition SystemCallMonitor.hh:67
void process_event(Event &event) override
Process an incoming event.
Definition SystemCallMonitor.hh:23
Interface for an event poller callback.
Definition EventCallback.hh:29
Interface class for hypervisor events.
Definition Event.hh:43
virtual SystemCallEvent & syscall()=0
Get system call event information.
virtual EventType type() const =0
Get the type of event.
virtual SystemCall * handler()=0
Gets the associated system call handler with this event.
Definition SystemCall.hh:31
virtual bool will_return() const =0
virtual bool supported() const =0
Check if this system call is supported by a more specific handler.
A class representing a single virtual processor.
Definition Vcpu.hh:33
virtual uint32_t id() const =0
Get the number of this Vcpu.
#define likely(x)
Definition compiler.hh:26
#define unlikely(x)
Definition compiler.hh:27
Classes related to Microsoft Windows guests.
Definition LanguageId.hh:21
Core IntroVirt classes.
Definition Cr0.hh:20