Previous - Up - Next

21.3   Switching Contexts Automatically

If all you want to do is let a context follow a process with a given PID, or follow processes that execute a given binary, you do not have to program elaborate scripts like the ones at the end of section 21.2. There is a module called context-switcher that will do these common tasks for you so that you do not have to talk to the tracker directly:

simics> switcher0.track-pid pid = 4711 context = my-little-context
Context 'my_little_context' is now tracking process 4711.
simics> switcher0.track-bin binary = "emacs" context = emacs-context
Context 'emacs_context' will be tracking the first process
that executes the binary 'emacs'.

(These commands assume the existence of a context-switcher object called switcher0.)

Of course, you might want to do more complicated things; in that case, feel free to write all the scripts you want, or modify context-switcher to fit your needs; it, too, comes with source code.

Previous - Up - Next