ThreadId is the hardware thread executing on a single CPU. ContextId is the execution context (think register file + PC) for a given cpu.
Getting the process id and sw thread id isn't particularly easy, although there are some bits of code to help for some architectures. You need to examine the kernel memory to figure out what the running processes pid/tid is. See src/arch/alpha/linux/threadinfo.hh for more info. Ali On Mar 29, 2012, at 5:04 PM, Hongil Yoon wrote: > Hi guys, > > have been looking for a way to identify a thread when a pseudo instruction is > executed in it. So, I used threadId() and contextId() of ThreadContext object > to get the thread id. According to the link below, the outputs are not what I > have expected: 1) threadID() != S/W thread Id 2) contextId() != Process Id. > > http://www.mail-archive.com/[email protected]/msg00556.html > > I have checked work_start/end() in Pseudo_inst.h using both Rdi and Rsi for > workid and threadid passed through the pseudo_inst that is called in the user > code. > > Besides, in order to uniquely identify them, the pointer of ThreadContext > could be utilized. However, 1) I am wondering whether there is a register > maintaining an identifier of a current thread. And 2) what's exact meaning of > threadid in ThreadContext? > > -- > Hongil > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users > _______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
