From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: Question about running a program(Intel PCM) in ring 0 on Xen Date: Tue, 18 Feb 2014 10:14:50 +0100 Message-ID: <1392714890.32038.463.camel@Solace> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3379800297325698129==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Meng Xu Cc: Boris Ostrovsky , "mengxu@cis.upenn.edu" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============3379800297325698129== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-cFFrSb3FSWgb3Ns4iQJG" --=-cFFrSb3FSWgb3Ns4iQJG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On lun, 2014-02-17 at 17:32 -0500, Meng Xu wrote: > Hi, >=20 Hi, > I'm a PhD student, working on real time system.=20 >=20 Cool. There really seems to be a lot of interest in Real-Time virtualization these days. :-D > [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. >=20 Ok. Can I, out of curiosity, as you to detail a bit more what your *final* goal is (I mean, you're interested in these measurements for a reason, not just for the sake of having them, right?). > [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.=20 >=20 >=20 > 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.=20 >=20 Indeed. > So my question is: > How can I run a program (say PCM) in ring 0 on Xen?=20 >=20 Running "a program" in there is going to be terribly difficult. What I think you're better off is trying to access, from dom0 and/or (para)virtualize the counters. In fact, there is work going on already on this, although I don't have all the details about what's the current status. > 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?=20 > 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?=20 >=20 Well, Xen can print, e.g., on a serial console, but again, that's not what you want. I'm adding the link to a few conversation about virtual PMU. These are just the very first google's result, so there may well be more: http://xen.1045712.n5.nabble.com/Virtualization-of-the-CPU-Performance-Moni= toring-Unit-td5623065.html https://lwn.net/Articles/566159/ Boris (which I'm Cc-ing), gave a presentation about this at latest Xen Developers Summit: http://www.slideshare.net/xen_com_mgr/xen-pmu-xensummit2013 Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-cFFrSb3FSWgb3Ns4iQJG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlMDJIsACgkQk4XaBE3IOsQhZACgitLZKlyuMjkHe4uGGo+FkEaT S24An3Mxb1aGQf2MT4LTDOfeYVrTKd4Z =v/ld -----END PGP SIGNATURE----- --=-cFFrSb3FSWgb3Ns4iQJG-- --===============3379800297325698129== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============3379800297325698129==--