qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Is it possible to retrieve pre-process information in Q


From: 陳韋任
Subject: Re: [Qemu-devel] Is it possible to retrieve pre-process information in QEMU?
Date: Tue, 22 May 2012 10:38:33 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

> >  I would like to know if I can retrieve pre-process information in QEMU
> > system mode. For example, I want to know each process's page fault ratio.
> > Is there a way to do that?
> 
> logically, it's possible, but you need to locate the task_struct of
> each processes first. Using GDB, that might be a bit easier but still
> not easy.
> 
> Why not just monitor it inside the guest? using system tap for example?

  O.K., what I did is something like below,

---
void tlb_fill(CPUARMState *env1, target_ulong addr, int is_write, int mmu_idx,
              uintptr_t retaddr)
{
    ret = cpu_arm_handle_mmu_fault(env, addr, is_write, mmu_idx);
    if (unlikely(ret)) {
        page_fault++;   // page fault
    }
    env = saved_env;
}
---

  IIUC, cpu_arm_handle_mmu_fault will lookup guest page table, return 1 if there
is a page fault, that's why I add a counter there. But this way I'll collect a
global static not per-process one. I'll try systemtap latter but not sure it
does the same thing I want to do.

  Any thoughts? :)

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj



reply via email to

[Prev in Thread] Current Thread [Next in Thread]