Hi Xiaoyu,

I had to do something similar a while back on ARM. From the looks of
arch/x86/stacktrace.hh, I think it will work the same for your case. There
was a thread that had an example on how to get the pid, but I'm not seeing
it in this forum.

ThreadContext *tc = system()->getThreadContext(pkt->req->threadId());
// use Packet object, Request object

Addr stackPtr = tc->readIntReg(INTREG_SP_SVC); // INTREG_SP_SVC is the
SP register for ARM

ProcessInfo procInfo = new ProcessInfo(tc); // make sure to include
stacktrace.hh

int pid = procInfo->pid(stackPtr);

delete procInfo;


Hopefully this works for you, or at least helps you in some way.



On Tue, Nov 19, 2013 at 9:08 PM, Xiaoyu Zheng <xiaoy...@umich.edu> wrote:

> Hi all,
>
> I want to record the pid for each cache block in X86. I tried to use the
> function defined in arch/generic/linux/threadinfo.hh, but there's some
> error. Is that the threadinfo.hh doesn't support X86? Can I call the
> function int pid(Addr ksp) defined in arch/x86/stacktrace.hh in
> mem/cache/blk.hh? If I can do in this way, what does the parameter address
> mean?
>
> Thanks a lot! I appreciate your help!
>
> With respects,
>
> Xiaoyu
>
> _______________________________________________
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>



-- 
Martin
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to