Fix ocount/operf tests when cpu type 'timer' is detected
If running the full testsuite (i.e., 'runtest --tool=oprofile'), the
oprofile-opcontrol runs before the operf tests. However, the exit proc
does not run until we're completely finished, so opcontrol_exit will
not have been called to do the deinit. Some newer processor models
are not supported by opcontrol except in timer mode, so running
opcontrol results in /dev/oprofile/cpu_type being set to 'timer' by
the oprofile kernel module. If operf/ocount are run in such a situation,
they detect the "timer" mode and exit with a message telling the user
to run 'opcontrol --deinit'. This causes the ocount and operf tests
to fail when we attempt to get the operf or ocount version.
The change made with this patch is to try to run 'opcontrol deinit'
(assuming we are root user) if the initial attempt to get the tool version
failed; then we'll try again to get the version for the ocount or operf tool.
If we're not user, we'll print a big message asking the user to
try 'opcontrol --deinit'.
Signed-off-by: Maynard Johnson <email@example.com>