Re: [Qemu-devel] TCG questions

2012-09-12 Thread Lluís Vilanova
Xin Tong writes:

 i do not know. could be similar. I am doing architecture research. i
 need traces of memory access for programming running under a full
 system environment, so i wrote this.

 i do nto seem to be able to access the linked provided from the link
 you give me though.

 https://projects.gso.ac.upc.edu/projects/qemu-dbi/wiki

Well, if you tried to access it during the last few days, we've been having some
issues with the server.

It should all work now.

The main idea is to have an API similar in spirit to that of PIN [1]. You can
have a look at the instrumentation docs [2] for some simple examples.

I had some plans to modify QEMU's address translation mechanism to provide a
performant mechanism to retrieve physical addresses (traces of virtual addresses
are already supported), but that will have to wait until I finish some other
unrelated tasks.


[1] http://pintool.org
[2] 
https://projects.gso.ac.upc.edu/projects/qemu-dbi/repository/entry/docs/instrumentation.txt#L202

Lluis



 On Tue, Sep 11, 2012 at 6:52 PM, 陳韋任 (Wei-Ren Chen)
 che...@iis.sinica.edu.tw wrote:
 I have created a set of instrument API on QEMU. one can write client
 programs that compile into shared library. the shared library is then
 loaded into qemu and extract statistics out of QEMU.
 
 Instrument API? Same as what Liuis did?
 
 Regards,
 chenwj
 
 [1] http://lists.gnu.org/archive/html/qemu-devel/2012-09/msg00379.html
 
 --
 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


-- 
 And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer.
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth



Re: [Qemu-devel] TCG questions

2012-09-12 Thread Xin Tong
On Wed, Sep 12, 2012 at 6:14 AM, Lluís Vilanova vilan...@ac.upc.edu wrote:
 Xin Tong writes:

 i do not know. could be similar. I am doing architecture research. i
 need traces of memory access for programming running under a full
 system environment, so i wrote this.

 i do nto seem to be able to access the linked provided from the link
 you give me though.

 https://projects.gso.ac.upc.edu/projects/qemu-dbi/wiki

 Well, if you tried to access it during the last few days, we've been having 
 some
 issues with the server.

 It should all work now.

 The main idea is to have an API similar in spirit to that of PIN [1]. You can
 have a look at the instrumentation docs [2] for some simple examples.

 I had some plans to modify QEMU's address translation mechanism to provide a
 performant mechanism to retrieve physical addresses (traces of virtual 
 addresses
 are already supported), but that will have to wait until I finish some other
 unrelated tasks.


 [1] http://pintool.org
 [2] 
 https://projects.gso.ac.upc.edu/projects/qemu-dbi/repository/entry/docs/instrumentation.txt#L202

By the way Luis. this is exactly what i am doing. i am writing up a
ISPASS paper for this as well. I am also using PIN to verify the
instrumentation interface.

Xin


 Lluis



 On Tue, Sep 11, 2012 at 6:52 PM, 陳韋任 (Wei-Ren Chen)
 che...@iis.sinica.edu.tw wrote:
 I have created a set of instrument API on QEMU. one can write client
 programs that compile into shared library. the shared library is then
 loaded into qemu and extract statistics out of QEMU.

 Instrument API? Same as what Liuis did?

 Regards,
 chenwj

 [1] http://lists.gnu.org/archive/html/qemu-devel/2012-09/msg00379.html

 --
 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


 --
  And it's much the same thing with knowledge, for whenever you learn
  something new, the whole world becomes that much richer.
  -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
  Tollbooth



Re: [Qemu-devel] TCG questions

2012-09-12 Thread Xin Tong
I have the code on http://code.google.com/p/qemu-trace/. I currently
have memory trace, branch trace and some special instructions traces
ready ( unverified though). we should discuss about what is the best
way to do this btw.

Xin


On Wed, Sep 12, 2012 at 10:09 AM, Xin Tong xerox.time.t...@gmail.com wrote:
 On Wed, Sep 12, 2012 at 6:14 AM, Lluís Vilanova vilan...@ac.upc.edu wrote:
 Xin Tong writes:

 i do not know. could be similar. I am doing architecture research. i
 need traces of memory access for programming running under a full
 system environment, so i wrote this.

 i do nto seem to be able to access the linked provided from the link
 you give me though.

 https://projects.gso.ac.upc.edu/projects/qemu-dbi/wiki

 Well, if you tried to access it during the last few days, we've been having 
 some
 issues with the server.

 It should all work now.

 The main idea is to have an API similar in spirit to that of PIN [1]. You can
 have a look at the instrumentation docs [2] for some simple examples.

 I had some plans to modify QEMU's address translation mechanism to provide a
 performant mechanism to retrieve physical addresses (traces of virtual 
 addresses
 are already supported), but that will have to wait until I finish some other
 unrelated tasks.


 [1] http://pintool.org
 [2] 
 https://projects.gso.ac.upc.edu/projects/qemu-dbi/repository/entry/docs/instrumentation.txt#L202

 By the way Luis. this is exactly what i am doing. i am writing up a
 ISPASS paper for this as well. I am also using PIN to verify the
 instrumentation interface.

 Xin


 Lluis



 On Tue, Sep 11, 2012 at 6:52 PM, 陳韋任 (Wei-Ren Chen)
 che...@iis.sinica.edu.tw wrote:
 I have created a set of instrument API on QEMU. one can write client
 programs that compile into shared library. the shared library is then
 loaded into qemu and extract statistics out of QEMU.

 Instrument API? Same as what Liuis did?

 Regards,
 chenwj

 [1] http://lists.gnu.org/archive/html/qemu-devel/2012-09/msg00379.html

 --
 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


 --
  And it's much the same thing with knowledge, for whenever you learn
  something new, the whole world becomes that much richer.
  -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
  Tollbooth



Re: [Qemu-devel] TCG questions

2012-09-11 Thread Richard Henderson
On 09/10/2012 08:17 PM, Xin Tong wrote:
 I have 2 questions about TCGv.
 
 1.  if DEBUG is enabled on TCGv, TCGv is wrapped in a C struct. and
 would it not be very expensive to pass TCGv by copy for all the
 tcg_gen_xxx functions.i.e. tcg_gen_mov_tl(cpu_cc_src, cpu_T[1]);

No.  The compiler is (generally) able to look through a struct with
a single member.

 2. I have created some files that need to include tcg-op.h and cpu.h (
 i use TCGv in the files). since cpu.h are architecture specific. what
 do i put as the include path and how i should organize the files so
 that the correct architecture specific cpu.h gets picked up. i tried
 many things. but it seems none of them works very well.

You've not provided enough details to give a meaningful answer.


r~




Re: [Qemu-devel] TCG questions

2012-09-11 Thread Peter Maydell
On 11 September 2012 17:12, Richard Henderson r...@twiddle.net wrote:
 On 09/10/2012 08:17 PM, Xin Tong wrote:
 1.  if DEBUG is enabled on TCGv, TCGv is wrapped in a C struct. and
 would it not be very expensive to pass TCGv by copy for all the
 tcg_gen_xxx functions.i.e. tcg_gen_mov_tl(cpu_cc_src, cpu_T[1]);

 No.  The compiler is (generally) able to look through a struct with
 a single member.

...and in any case if you've enabled debug you have explicitly
said you are more interested in catching bugs than in raw
performance.

-- PMM



Re: [Qemu-devel] TCG questions

2012-09-11 Thread Xin Tong
On Tue, Sep 11, 2012 at 9:12 AM, Richard Henderson r...@twiddle.net wrote:
 On 09/10/2012 08:17 PM, Xin Tong wrote:
 I have 2 questions about TCGv.

 1.  if DEBUG is enabled on TCGv, TCGv is wrapped in a C struct. and
 would it not be very expensive to pass TCGv by copy for all the
 tcg_gen_xxx functions.i.e. tcg_gen_mov_tl(cpu_cc_src, cpu_T[1]);

 No.  The compiler is (generally) able to look through a struct with
 a single member.

 2. I have created some files that need to include tcg-op.h and cpu.h (
 i use TCGv in the files). since cpu.h are architecture specific. what
 do i put as the include path and how i should organize the files so
 that the correct architecture specific cpu.h gets picked up. i tried
 many things. but it seems none of them works very well.

 You've not provided enough details to give a meaningful answer.

I have created a set of instrument API on QEMU. one can write client
programs that compile into shared library. the shared library is then
loaded into qemu and extract statistics out of QEMU.

Basically when QEMU translates the guest ISA to emulation code. it
pushes some of the value (i.e. virt address, phys address of a memory
access) of interested into a structure in the CPUState.

Some of the files in the instrumentation module depends on TCGv. i
just want to find a way to include the tcg-op.h. it is not easy as it
is architecture dependent.

Xin



 r~




Re: [Qemu-devel] TCG questions

2012-09-11 Thread Richard Henderson
On 09/11/2012 03:56 PM, Xin Tong wrote:
 Some of the files in the instrumentation module depends on TCGv. i
 just want to find a way to include the tcg-op.h. it is not easy as it
 is architecture dependent.

It's not.  Look at some of the other files in tcg/.


r~



Re: [Qemu-devel] TCG questions

2012-09-11 Thread Wei-Ren Chen
 I have created a set of instrument API on QEMU. one can write client
 programs that compile into shared library. the shared library is then
 loaded into qemu and extract statistics out of QEMU.

  Instrument API? Same as what Liuis did?

Regards,
chenwj

[1] http://lists.gnu.org/archive/html/qemu-devel/2012-09/msg00379.html

-- 
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



Re: [Qemu-devel] TCG questions

2012-09-11 Thread Xin Tong
i do not know. could be similar. I am doing architecture research. i
need traces of memory access for programming running under a full
system environment, so i wrote this.

i do nto seem to be able to access the linked provided from the link
you give me though.

https://projects.gso.ac.upc.edu/projects/qemu-dbi/wiki

Xin



On Tue, Sep 11, 2012 at 6:52 PM, 陳韋任 (Wei-Ren Chen)
che...@iis.sinica.edu.tw wrote:
 I have created a set of instrument API on QEMU. one can write client
 programs that compile into shared library. the shared library is then
 loaded into qemu and extract statistics out of QEMU.

   Instrument API? Same as what Liuis did?

 Regards,
 chenwj

 [1] http://lists.gnu.org/archive/html/qemu-devel/2012-09/msg00379.html

 --
 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



[Qemu-devel] TCG questions

2012-09-10 Thread Xin Tong
I have 2 questions about TCGv.

1.  if DEBUG is enabled on TCGv, TCGv is wrapped in a C struct. and
would it not be very expensive to pass TCGv by copy for all the
tcg_gen_xxx functions.i.e. tcg_gen_mov_tl(cpu_cc_src, cpu_T[1]);

2. I have created some files that need to include tcg-op.h and cpu.h (
i use TCGv in the files). since cpu.h are architecture specific. what
do i put as the include path and how i should organize the files so
that the correct architecture specific cpu.h gets picked up. i tried
many things. but it seems none of them works very well.

Thank you very much

Xin