On Wed, Dec 15, 2010 at 6:57 AM, Shen Zhong <[email protected]> wrote:

> Dear all,
>    I want to get the address of each memory access. Meanwhile, I also  want
> to know which thread the memory access belongs to.
>    Now I found that we can figure out the thread id by reading from memory
> address %fs+0x10. However, there might be page fault if I try to read from
> this address.
>    I think I only need to record the thread id when there is a context
>  switch, in which case, the thread id information must be in the memory.
>    However I don't know how to detect the thread context switch in ptlsim.
>    Any ideas? Thanks a lot!!!!!
>
> Take a look at CR-3 register (control register 3). Value of this register
is kept unique to the running OS threads so when there is a context switch,
this value will be changed. So you can make hash of value of CR3 and memory
addresses to differentiate between multiple OS threads.

- Avadh


> -Regards
> Shen Zhong
>
> _______________________________________________
> http://www.marss86.org
> Marss86-Devel mailing list
> [email protected]
> https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel
>
_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel

Reply via email to