I don't know how to get the PID, but you can get a context identifier
for the process that is running on a given CPU. This is a bit tricky
though. The actual PID is an OS construct that I don't think is
available from simics. The context identifier is another OS specific
variable, but they seem to be unique per thread. I think this is
stored because the PID would be the same on all threads of a
multithreaded application, and the OS scheduler needs to be concerned
with thread scheduling more so than process scheduling.
That said, if you can get the processor number of the cache miss, it
is possible to get the context with the following code:
conf_object_t *cpu, mmu_obj;
cpu=SIM_get_processor (ProcessorNumber);
mmu_obj=SIM_get_attribute(cpu, "mmu").u.object;
CPU_CTX=SIM_get_attribute(mmu_obj,"ctxt-primary").u.integer & 0x1fff;
One thing to be careful with though is that the processor number is
likely not just the node id within ruby. I am only familiar with the
sunfire (bagle) machine, but the processors are numbered oddly there,
and have the following numbers in simics: cpu0,cpu1,cpu4,cpu5 .. .
and I don't know after that offhand. The serengeti machines likely
do something different, so you'd have to check in simics what the
processor ordering is. Also, if you enable SMT inside opal, things
might get more difficult, as the ruby node id doesn't directly
translate to a CPU number. I am not positive if the requests sent
into ruby have actual cpu ids embedded in them, if not, you might have
to add that.
Phil
On Dec 16, 2009, at 1:17 PM, blacuesa wrote:
Hello,
Does anyone know if it is possible to get the PID of the process
that has
caused a specific cache miss? I've tried to it by using the
parameters of the
"ruby_operate" function, but I didn't achieved it.
Thanks in advance!
Regards.
_______________________________________________
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.
|