If you're trying to calculate some of these stats for a multiprocessor system with single threaded applications running, you really would want to keep track on instructions committed per context ID. The OS (at least in Linux) will use context 0, whereas applications will have different context IDs. What you probably don't want to do is count cycles/instructions where a CPU isn't doing useful work. I have a somewhat modified version of pseq that keeps track of per context information, but it's also tailored to other needs. In general, I've found it useful, as you can also track whether applications have migrated across cpu's in multicore workloads.
Phil On Jun 2, 2009, at 12:58 PM, David Bonavila wrote: Hi.
I have added the following lines to the pseq.C file:
/*------------------------------------------------------------------------*/ /* Variable declarations */ /*------------------------------------------------------------------------*/ int iPriv[2] = { 0, 0 }; // I am simulating a 2-core processor int iUser[2] = { 0, 0 };
if (d_instr) { last_mode = d_instr->getPrivilegeMode(); // this line already existed if (last_mode) iPriv[proc]++; // I have added these two lines else iUser[proc]++; }
out_info(" %-50.50s %10llu\n", "PRIVILEGED INSTRUCTIONS:", iPriv[k]); out_info(" %-50.50s %10llu\n", "USER_MODE INSTRUCTIONS:", iUser[k]);
I have simulated 1 Million instructions with Opal, and the Opal output file has this: [0] PRIVILEGED INSTRUCTIONS: 219278 [0] USER_MODE INSTRUCTIONS: 175210 [1] PRIVILEGED INSTRUCTIONS: 219278 [1] USER_MODE INSTRUCTIONS: 175210
The two processors have executed the same number of privileged instructions?? And the total instructions (Privileged + User) is different from 1M (I have changed Opal so the number of instructions passed to the opal0.sim-step command is the TOTAL number of instructions executed between all processors, not just CPU0). I am simulating a workload which runs only 1 thread.
Is all this right?? Am I doing something wrong??
Thanks!!
_______________________________________________ Gems-users mailing list Gems-users@xxxxxxxxxxx https://lists.cs.wisc.edu/mailman/listinfo/gems-users Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/" to your search.
|
|