Ok, I looked into this, and I'm pretty sure you're right. The code in
question is reading an "int" from a structure set up and installed into
the Linux kernel by this special M5 patch:

http://repo.m5sim.org/linux-patches/file/0ab58d9bd9a5/m5/m5struct.diff

The size of that int, according to gdb, is 4 bytes. That corresponds to
the size of an int32_t but not of an Addr which is 8 bytes. This problem
exists in curTaskPID and also curTaskStart.

I'll fix the problem and submit a patch to our patch review system
reviewboard. I'm not sure exactly how it'll show up on the web
interface, but when I commit the change I'll put your name on it if
you'd like. Is it alright to use "Yi Xiang <y...@colostate.edu>"?

Gabe

On 03/04/11 00:41, Yi Xiang wrote:
> sorry for the ambiguity. Here is some detail:
>
> At first, I followed this instruction
> https://docs.google.com/View?id=dfkk59gg_1079rhf4bd5 AND ran splash2
> benchmark on m5.opt (Alpha architecture) with --trace-flags=thread option
> enabled to get trace of threads:
> //////////////////////////////
> ///////////////////////////////////////
> ./build/ALPHA_FS/m5.opt --trace-flags=Ruby
> *--trace-flags=Thread*--trace-file=memory.trace configs/example/fs.py
> -n 8 -b fft
> /////////////////////////////////////////////////////////////////////
>
> To get trace with threads information, I removed the false condition from
> /src/arch/alpha/linux like what suggested before in M5 maling-list. However,
> the output thread pids and start_times were obvious incorrect, while thread
> name was correct. Like follows:
> /////////////////////////////////////////////////////////////////////
> 2288515504500: threadinfo: Currently Executing Thread FFT,* pid
> 3211264*, *started
> at: -4398043299840*
> 2288517642500: threadinfo: Currently Executing Thread swapper, *pid 3211264*,
> *started at: -4398043299840*
> 2288589029000: threadinfo: Currently Executing Thread swapper, pid 3211264,
> started at: -4398043299840
> 2288592770000: threadinfo: Currently Executing Thread FFT, pid 3211264,
> started at: -4398043299840
> 2288772642500: threadinfo: Currently Executing Thread script, pid 3211264,
> started at: -4398043299840
> 2288818042500: threadinfo: Currently Executing Thread script, pid 3211264,
> started at: -4398043299840
> /////////////////////////////////////////////////////////////////////
>
> To fix this issue, I made two slightly changes to
> /src/arch/alpha/linux/threadinfo.hh:
> /////////////////////////////////////////////////////////////////////
> line 106 and line 119:        "Addr offset;"   ----->    "int32_t offset;"
> /////////////////////////////////////////////////////////////////////
>
> Then I got a much more reasonable trace:
> /////////////////////////////////////////////////////////////////////
> 2288589029000: threadinfo: Currently Executing Thread swapper, pid 0,
> started at: 0
> 2288592770000: threadinfo: Currently Executing Thread FFT, pid 813, started
> at: 2
> 2288772642500: threadinfo: Currently Executing Thread script, pid 808,
> started at: 2
> 2288818042500: threadinfo: Currently Executing Thread script, pid 821,
> started at: 2
> 2288840942000: threadinfo: Currently Executing Thread swapper, pid 0,
> started at: 0
> 2288883227000: threadinfo: Currently Executing Thread migration/4, pid 15,
> started at: 0
> /////////////////////////////////////////////////////////////////////
>
> I guess /src/arch/mips/linux/threadinfo.hh also needs to be modified in this
> way.
>
> Thanks.
>
> Yi Xiang
> _______________________________________________
> m5-dev mailing list
> m5-dev@m5sim.org
> http://m5sim.org/mailman/listinfo/m5-dev

_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to