Mouse Click and Context Switch Question
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi
I wasn't sure if the email below went through , since I was not subscribed to the list. Would appreciate your response. Thanks
Sujata
---------- Forwarded message ----------
From: Sujata Doshi <[email protected]>
Date: Oct 13, 2006 10:37 AM
Subject: Mouse Click and Context Switch Question
To: [email protected]
Hello
I am starting a research project which involves using Xen. Basically we would like to monitor the input to an application running in the guest OS . Specifically, we need to be able to figure out when an input was made via a mouse click and what the coordinates of the mouse pointer were on that click. If I understand correctly, on a mouse click, an interrupt occurs which gets handled by the Xen VMM --- is there a way of figuring out at the Xen VMM level what the coordinates of the click are when this interrupt occurs ?
I understand this would also involve figuring out when a context switch occurs to that particular application so that we can grab the right mouse click. Is there an easy way to figure this context switch out ?
I would appreciate if you could guide me with the above queries and also which files in the Xen source I should be looking at to achieve this task.
Thank you very much for your help
Sujata
Quoted 23 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sujata Doshi
Sent: 13 October 2006 17:28
To: [email protected]
Subject: [Xen-devel] Fwd: Mouse Click and Context Switch QuestionHi
I wasn't sure if the email below went through , since I was not subscribed to the list. Would appreciate your response. Thanks
Sujata---------- Forwarded message ----------
From: Sujata Doshi <[email protected]>
Date: Oct 13, 2006 10:37 AM
Subject: Mouse Click and Context Switch Question
To: [email protected]
Quoted 9 lines
Hello
I am starting a research project which involves using Xen. Basically we would like to monitor the input to an application running in the guest OS . Specifically, we need to be able to figure out when an input was made via a mouse click and what the coordinates of the mouse pointer were on that click. If I understand correctly, on a mouse click, an interrupt occurs which gets handled by the Xen VMM --- is there a way of figuring out at the Xen VMM level what the coordinates of the click are when this interrupt occurs ?
You understand correctly on the principle of interrupts, but the actual mouse-movements are tracked in the mouse-handling code inside Linux Dom0, not in the VMM, as the VMM doesn't actually know (or care) anything about the mouse as a device, just about forwarding the interrupt to the rightfull owner.
If you know what application you want to track, and you're able to hack some code, I'd suggest that you go modify the X-windows code (such as XFree86) to track where the mouse-clicks are forwarded to the application. Since X-windows knows which application it forwards what information to, it's the "perfect" place to do this [from my understanding of the subject - I could of course be missing some important factor that isn't apparent from the above brief description].
Quoted 4 lines
I understand this would also involve figuring out when a context switch occurs to that particular application so that we can grab the right mouse click. Is there an easy way to figure this context switch out ?
The VMM scheduler is not per process but per virtual machine, so the application level would have to be understood by the operating system running on top of Xen, as Xen doesn't actually know what application (if any) is running at any given time, only the Linux kernel (typial case) that is running on top of Xen will know this.
Quoted 4 lines
I would appreciate if you could guide me with the above queries and also which files in the Xen source I should be looking at to achieve this task.
I could theoretically help you with any Xen-files, but I don't think that's the right approach in the first place - you want to be working further up in the architecture to have access to the "current application".
[Note: this is assuming that we're talking about para-virtualized clients. In the case of a full-virtualized guest [HVM, VT/AMD-V], such as a Windows guest, there is a possibility that you could follow the mouse within the qemu-dm [the device model that generates the virtual mouse], and use that information to record where the mouse moves to. However, it's still impossible to understand which application is running at that particular point in time - again, you need to have OS to help you with that].
--
Mats
Quoted 10 lines
Thank you very much for your help
Sujata_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Hi
Thank you very much for your response --- yes we are using full virtualization with a Windows Guest OS -- thanks for pointing out about the qemu-dm
On the context switching front, I was wondering if there is a way to leverage the memory information i.e every new process creation should have a new page directory and its own address space associated with it right ?-- so is there a way to use that information to figure out which was the current process ? --- I agree, we would still need application specific information to map the application to the process -- but can the context switching be inferred by the VMM on a process level without asking the guest OS?
Thanks again
Sujata
Quoted 91 lines · Mats
Quoted 23 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sujata Doshi
Sent: 13 October 2006 17:28
To: [email protected]
Subject: [Xen-devel] Fwd: Mouse Click and Context Switch QuestionHi
I wasn't sure if the email below went through , since I was not subscribed to the list. Would appreciate your response. Thanks
Sujata---------- Forwarded message ----------
From: Sujata Doshi <[email protected]>
Date: Oct 13, 2006 10:37 AM
Subject: Mouse Click and Context Switch Question
To: [email protected]Quoted 9 lines
Hello
I am starting a research project which involves using Xen. Basically we would like to monitor the input to an application running in the guest OS . Specifically, we need to be able to figure out when an input was made via a mouse click and what the coordinates of the mouse pointer were on that click. If I understand correctly, on a mouse click, an interrupt occurs which gets handled by the Xen VMM --- is there a way of figuring out at the Xen VMM level what the coordinates of the click are when this interrupt occurs ?You understand correctly on the principle of interrupts, but the actual mouse-movements are tracked in the mouse-handling code inside Linux Dom0, not in the VMM, as the VMM doesn't actually know (or care) anything about the mouse as a device, just about forwarding the interrupt to the rightfull owner.
If you know what application you want to track, and you're able to hack some code, I'd suggest that you go modify the X-windows code (such as XFree86) to track where the mouse-clicks are forwarded to the application. Since X-windows knows which application it forwards what information to, it's the "perfect" place to do this [from my understanding of the subject - I could of course be missing some important factor that isn't apparent from the above brief description].
Quoted 4 lines
I understand this would also involve figuring out when a context switch occurs to that particular application so that we can grab the right mouse click. Is there an easy way to figure this context switch out ?
The VMM scheduler is not per process but per virtual machine, so the application level would have to be understood by the operating system running on top of Xen, as Xen doesn't actually know what application (if any) is running at any given time, only the Linux kernel (typial case) that is running on top of Xen will know this.
Quoted 4 lines
I would appreciate if you could guide me with the above queries and also which files in the Xen source I should be looking at to achieve this task.
I could theoretically help you with any Xen-files, but I don't think that's the right approach in the first place - you want to be working further up in the architecture to have access to the "current application".
[Note: this is assuming that we're talking about para-virtualized clients. In the case of a full-virtualized guest [HVM, VT/AMD-V], such as a Windows guest, there is a possibility that you could follow the mouse within the qemu-dm [the device model that generates the virtual mouse], and use that information to record where the mouse moves to. However, it's still impossible to understand which application is running at that particular point in time - again, you need to have OS to help you with that].
--
MatsQuoted 10 lines
Thank you very much for your help
Sujata_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel