xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Meng Xu <xumengpanda@gmail.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: "mengxu@cis.upenn.edu" <mengxu@cis.upenn.edu>
Subject: Question about running a program(Intel PCM) in ring 0 on Xen
Date: Mon, 17 Feb 2014 17:32:17 -0500	[thread overview]
Message-ID: <CAENZ-+k37zggHyp1aXMYF2jmoBThY5fMdKh_++NMr4LG0Ubujw@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1578 bytes --]

Hi,

I'm a PhD student, working on real time system.

*[My goal]*
I want to measure the cache hit/miss rate of each guest domain in Xen. I
may also want to measure some other events, say memory access rate, for
each program in each guest domain in Xen.

My machine's CPU uses intel IvyBridge architecture.

*[The problem I'm encountering]*
I tried intel's Performance Counter Monitor (PCM) in Linux on bare machine
to get the machine's cache access rate for each level of cache, it works
very well.

However, when I want to use the PCM in Xen and run it in dom0, it cannot
work. I think the PCM needs to run in ring 0 to read/write the MSR. Because
dom0 is running in ring 1, so PCM running in dom0 cannot work.

*So my question is:*
How can I run a program (say PCM) in ring 0 on Xen?

*What's in my mind is:*
Writing a hypercall to call the PCM in Xen's kernel space, then the PCM
will run in ring 0?
But the problem I'm concerned is that some of the PCM's instruction, say
printf(), may not be able to run in kernel space?

Do you have any suggestion on running PCM or other performance monitor
program in ring 0 on Xen?

*What I tried before:*
I wrote a hypercall to read and write the MSR and record the cache
hit/miss event for each level of cache, using Intel's performance counter.
It worked on my machine. But it's not portable to other machines since the
event number may be different. That's why I think running PCM or other
existing performance monitor program on Xen will be a better idea.

Thank you very much for your time and help in this question!

Best,

Meng

[-- Attachment #1.2: Type: text/html, Size: 3576 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

             reply	other threads:[~2014-02-17 22:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-17 22:32 Meng Xu [this message]
2014-02-18  9:14 ` Question about running a program(Intel PCM) in ring 0 on Xen Dario Faggioli
2014-02-18 11:29   ` Dario Faggioli
2014-02-18 15:24   ` Meng Xu
2014-02-18 16:16     ` Boris Ostrovsky
2014-02-19 14:12       ` Meng Xu

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=CAENZ-+k37zggHyp1aXMYF2jmoBThY5fMdKh_++NMr4LG0Ubujw@mail.gmail.com \
    --to=xumengpanda@gmail.com \
    --cc=mengxu@cis.upenn.edu \
    --cc=xen-devel@lists.xen.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).