qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: 陳韋任 <chenwj@iis.sinica.edu.tw>
To: Mulyadi Santosa <mulyadi.santosa@gmail.com>
Cc: qemu-devel@nongnu.org, 陳韋任 <chenwj@iis.sinica.edu.tw>
Subject: Re: [Qemu-devel] Is it possible to retrieve pre-process information in QEMU?
Date: Tue, 22 May 2012 10:38:33 +0800	[thread overview]
Message-ID: <20120522023833.GA90903@cs.nctu.edu.tw> (raw)
In-Reply-To: <CAGdaadaowPyU2n7WGrpjT2wOeQtVfKQDm4ggqz=abrM2VCmAcA@mail.gmail.com>

> >  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	other threads:[~2012-05-22  2:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17  3:09 [Qemu-devel] Is it possible to retrieve pre-process information in QEMU? 陳韋任
2012-05-20 14:06 ` Mulyadi Santosa
2012-05-22  2:38   ` 陳韋任 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120522023833.GA90903@cs.nctu.edu.tw \
    --to=chenwj@iis.sinica.edu.tw \
    --cc=mulyadi.santosa@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).