Hi, I'm doing an experiment using a full-system simulator running a simulated sparc machine with solaris 10. I would like to detect context switches and print out processs-specific information such as the pid, the command name, etc.
My current approach is to detect both transitions into kernel mode and writes to register %g7. This seems to indicate a context switch. Once there, the register seems to point to the running thread. I have looked the code in the source browser here and noticed some interesting entries such as p_pid in the proc structure (that can be reached from the _kthread structure) and u_comm entry in the user structure (correct? maybe this entry does not point to the command?). The problem I'm facing is to actually access these entries without being able to use symbols such as curthread and so on. I can only read (and write) directly to memory and cannot access symbols, so my question is whether there are defined offset values that I can use to access these entries? Or is there any other way to do this? I'm thankful for any suggestions you might have. Regards, Mladen This message posted from opensolaris.org _______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
