I'm looking to use gem5 with some of my work, and have a very general question regarding its features.
My question is, using gem5, can I get statistics on behavior / system resource usage of individual threads, either in SE or FS mode. For example, if I have 2 threads running in my application, can I see that Thread 1 uses X cycles on CPU 1, Y cycles on CPU 2 etc, and Thread 2 uses Z cycles on CPU 3 etc. If this is possible, does it also extend to cache usage, memory usage etc?
I saw the following questions: Accessing logical (software) thread ID in gem5, but I think just using hardware thread statistics would work for our use case.
I see that the ThreadState class in src/cpu/thread_state.hh has the following feilds:
/** Number of instructions committed. */
Counter numInst;
/** Stat for number instructions committed. */
Stats::Scalar numInsts;
/** Number of ops (including micro ops) committed. */
Counter numOp;
/** Stat for number ops (including micro ops) committed. */
Stats::Scalar numOps;
/** Stat for number of memory references. */
Stats::Scalar numMemRefs;
This looks like something I could use. Would anyone know if these stats can be easily output per thread in the stats file?
Thanks!