12 called from interrupt gate.
14 extern "C" void sys_ipc_log_wrapper(void)
16 Thread *curr = current_thread();
17 Entry_frame *regs = reinterpret_cast<Entry_frame*>(curr->regs());
18 Syscall_frame *ipc_regs = reinterpret_cast<Syscall_frame*>(curr->regs());
20 Mword entry_event_num = (Mword)-1;
21 Unsigned8 have_snd = (ipc_regs->ref().op() & L4_obj_ref::Ipc_send)
22 || (ipc_regs->ref().op() == L4_obj_ref::Ipc_call);
23 Unsigned8 is_next_period = ipc_regs->next_period();
24 Utcb *utcb = curr->utcb().access(true);
25 int do_log = Jdb_ipc_trace::log() &&
26 Jdb_ipc_trace::check_restriction (curr->dbg_id(),
27 static_cast<Task*>(curr->space())->dbg_id(),
30 if (Jdb_nextper_trace::log() && is_next_period)
32 Tb_entry_ipc *tb = static_cast<Tb_entry_ipc*>(Jdb_tbuf::new_entry());
33 tb->set(curr, regs->ip(), ipc_regs, utcb,
34 0, curr->sched_context()->left());
35 Jdb_tbuf::commit_entry();
43 Obj_cap r = ipc_regs->ref();
45 Kobject_iface *o = r.deref(&rights, true);
47 dbg_id = o->dbg_info()->dbg_id();
52 Tb_entry_ipc *tb = EXPECT_TRUE(Jdb_ipc_trace::log_buf())
53 ? Jdb_tbuf::new_entry<Tb_entry_ipc>()
55 tb->set(curr, regs->ip(), ipc_regs, utcb,
56 dbg_id, curr->sched_context()->left());
58 entry_event_num = tb->number();
60 if (EXPECT_TRUE(Jdb_ipc_trace::log_buf()))
61 Jdb_tbuf::commit_entry();
63 Jdb_tbuf::direct_log_entry(tb, "IPC");
68 // now pass control to regular sys_ipc()
71 if (Jdb_nextper_trace::log() && is_next_period)
73 Tb_entry_ipc_res *tb =
74 static_cast<Tb_entry_ipc_res*>(Jdb_tbuf::new_entry());
75 tb->set(curr, regs->ip(), ipc_regs, utcb, 0,
76 entry_event_num, have_snd, is_next_period);
77 Jdb_tbuf::commit_entry();
78 goto skip_ipc_res_log;
81 if (Jdb_ipc_trace::log() && Jdb_ipc_trace::log_result() && do_log)
83 Tb_entry_ipc_res _local;
84 Tb_entry_ipc_res *tb = static_cast<Tb_entry_ipc_res*>
85 (EXPECT_TRUE(Jdb_ipc_trace::log_buf()) ? Jdb_tbuf::new_entry()
87 tb->set(curr, regs->ip(), ipc_regs, utcb, utcb->error.raw(),
88 entry_event_num, have_snd, is_next_period);
90 if (EXPECT_TRUE(Jdb_ipc_trace::log_buf()))
91 Jdb_tbuf::commit_entry();
93 Jdb_tbuf::direct_log_entry(tb, "IPC result");
102 extern "C" void sys_ipc_trace_wrapper(void)
104 Thread *curr = current_thread();
105 Entry_frame *ef = nonull_static_cast<Entry_frame*>(curr->regs());
106 Syscall_frame *regs = curr->regs();
108 //Mword from_spec = regs->from_spec();
109 L4_obj_ref snd_dst = regs->ref();
111 Unsigned64 orig_tsc = Cpu::rdtsc();
113 // first try the fastpath, then the "slowpath"
116 // kernel is locked here => no Lock_guard <...> needed
117 Tb_entry_ipc_trace *tb =
118 static_cast<Tb_entry_ipc_trace*>(Jdb_tbuf::new_entry());
120 tb->set(curr, ef->ip(), orig_tsc, snd_dst, regs->from_spec(),
121 L4_msg_tag(0,0,0,0), 0, 0);
123 Jdb_tbuf::commit_entry();