profile: add PROFILE_remote_page_fault

This commit is contained in:
Balazs Gerofi
2017-07-23 19:00:00 +09:00
parent bf5ac7afc8
commit 4cd1c120fa
4 changed files with 36 additions and 11 deletions

View File

@@ -182,8 +182,12 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
int mstatus = 0;
#ifdef PROFILE_ENABLE
uint64_t t_s;
t_s = rdtsc();
/* We cannot use thread->profile_start_ts here because the
* caller may be utilizing it already */
unsigned long t_s = 0;
if (thread->profile) {
t_s = rdtsc();
}
#endif // PROFILE_ENABLE
dkprintf("SC(%d)[%3d] sending syscall\n",
@@ -273,6 +277,15 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
}
if (res.status == STATUS_PAGE_FAULT) {
#ifdef PROFILE_ENABLE
/* We cannot use thread->profile_start_ts here because the
* caller may be utilizing it already */
unsigned long t_s = 0;
if (thread->profile) {
t_s = rdtsc();
}
#endif // PROFILE_ENABLE
dkprintf("STATUS_PAGE_FAULT in syscall, pid: %d\n",
cpu_local_var(current)->proc->pid);
error = page_fault_process_vm(thread->vm,
@@ -291,6 +304,10 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
res.req_thread_status = IHK_SCD_REQ_THREAD_SPINNING;
send_syscall(&req2, cpu, pid, &res);
#ifdef PROFILE_ENABLE
profile_event_add(PROFILE_remote_page_fault,
(rdtsc() - t_s));
#endif // PROFILE_ENABLE
}
if (res.status == STATUS_SYACALL) {
@@ -9382,7 +9399,7 @@ long syscall(int num, ihk_mc_user_context_t *ctx)
}
#ifdef PROFILE_ENABLE
if (thread->profile) {
{
unsigned long ts = rdtsc();
/*