* [Qemu-devel] TCG questions @ 2012-09-11 3:17 Xin Tong 2012-09-11 16:12 ` Richard Henderson 0 siblings, 1 reply; 10+ messages in thread From: Xin Tong @ 2012-09-11 3:17 UTC (permalink / raw) To: qemu-devel 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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] TCG questions 2012-09-11 3:17 [Qemu-devel] TCG questions Xin Tong @ 2012-09-11 16:12 ` Richard Henderson 2012-09-11 17:04 ` Peter Maydell 2012-09-11 22:56 ` Xin Tong 0 siblings, 2 replies; 10+ messages in thread From: Richard Henderson @ 2012-09-11 16:12 UTC (permalink / raw) To: Xin Tong; +Cc: qemu-devel 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~ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] TCG questions 2012-09-11 16:12 ` Richard Henderson @ 2012-09-11 17:04 ` Peter Maydell 2012-09-11 22:56 ` Xin Tong 1 sibling, 0 replies; 10+ messages in thread From: Peter Maydell @ 2012-09-11 17:04 UTC (permalink / raw) To: Richard Henderson; +Cc: qemu-devel, Xin Tong On 11 September 2012 17:12, Richard Henderson <rth@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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] TCG questions 2012-09-11 16:12 ` Richard Henderson 2012-09-11 17:04 ` Peter Maydell @ 2012-09-11 22:56 ` Xin Tong 2012-09-11 23:23 ` Richard Henderson 2012-09-12 1:52 ` 陳韋任 (Wei-Ren Chen) 1 sibling, 2 replies; 10+ messages in thread From: Xin Tong @ 2012-09-11 22:56 UTC (permalink / raw) To: Richard Henderson; +Cc: qemu-devel On Tue, Sep 11, 2012 at 9:12 AM, Richard Henderson <rth@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~ > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] TCG questions 2012-09-11 22:56 ` Xin Tong @ 2012-09-11 23:23 ` Richard Henderson 2012-09-12 1:52 ` 陳韋任 (Wei-Ren Chen) 1 sibling, 0 replies; 10+ messages in thread From: Richard Henderson @ 2012-09-11 23:23 UTC (permalink / raw) To: Xin Tong; +Cc: qemu-devel 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~ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] TCG questions 2012-09-11 22:56 ` Xin Tong 2012-09-11 23:23 ` Richard Henderson @ 2012-09-12 1:52 ` 陳韋任 (Wei-Ren Chen) 2012-09-12 2:34 ` Xin Tong 1 sibling, 1 reply; 10+ messages in thread From: 陳韋任 (Wei-Ren Chen) @ 2012-09-12 1:52 UTC (permalink / raw) To: Xin Tong; +Cc: qemu-devel, Richard Henderson > 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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] TCG questions 2012-09-12 1:52 ` 陳韋任 (Wei-Ren Chen) @ 2012-09-12 2:34 ` Xin Tong 2012-09-12 13:14 ` Lluís Vilanova 0 siblings, 1 reply; 10+ messages in thread From: Xin Tong @ 2012-09-12 2:34 UTC (permalink / raw) To: 陳韋任 (Wei-Ren Chen); +Cc: qemu-devel, Richard Henderson 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) <chenwj@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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] TCG questions 2012-09-12 2:34 ` Xin Tong @ 2012-09-12 13:14 ` Lluís Vilanova 2012-09-12 17:09 ` Xin Tong 0 siblings, 1 reply; 10+ messages in thread From: Lluís Vilanova @ 2012-09-12 13:14 UTC (permalink / raw) To: Xin Tong Cc: qemu-devel, 陳韋任 (Wei-Ren Chen), Richard Henderson 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) > <chenwj@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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] TCG questions 2012-09-12 13:14 ` Lluís Vilanova @ 2012-09-12 17:09 ` Xin Tong 2012-09-12 17:11 ` Xin Tong 0 siblings, 1 reply; 10+ messages in thread From: Xin Tong @ 2012-09-12 17:09 UTC (permalink / raw) To: Lluís Vilanova Cc: qemu-devel, 陳韋任 (Wei-Ren Chen), Richard Henderson On Wed, Sep 12, 2012 at 6:14 AM, Lluís Vilanova <vilanova@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) >> <chenwj@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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] TCG questions 2012-09-12 17:09 ` Xin Tong @ 2012-09-12 17:11 ` Xin Tong 0 siblings, 0 replies; 10+ messages in thread From: Xin Tong @ 2012-09-12 17:11 UTC (permalink / raw) To: Lluís Vilanova Cc: qemu-devel, 陳韋任 (Wei-Ren Chen), Richard Henderson 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.tech@gmail.com> wrote: > On Wed, Sep 12, 2012 at 6:14 AM, Lluís Vilanova <vilanova@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) >>> <chenwj@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 ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-09-12 17:11 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-09-11 3:17 [Qemu-devel] TCG questions Xin Tong 2012-09-11 16:12 ` Richard Henderson 2012-09-11 17:04 ` Peter Maydell 2012-09-11 22:56 ` Xin Tong 2012-09-11 23:23 ` Richard Henderson 2012-09-12 1:52 ` 陳韋任 (Wei-Ren Chen) 2012-09-12 2:34 ` Xin Tong 2012-09-12 13:14 ` Lluís Vilanova 2012-09-12 17:09 ` Xin Tong 2012-09-12 17:11 ` Xin Tong
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).