diff options
Diffstat (limited to 'oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java')
-rw-r--r-- | oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java | 66 |
1 files changed, 27 insertions, 39 deletions
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java index 328b11fab1..d14aae5435 100644 --- a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java +++ b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java @@ -72,15 +72,6 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { private static final String OPD_KERNEL_NONE = "--no-vmlinux"; //$NON-NLS-1$ private static final String OPD_KERNEL_FILE = "--vmlinux="; //$NON-NLS-1$ - // Logging verbosity -// private static final String _OPD_VERBOSE_LOGGING = "--verbose="; //$NON-NSL-1$ -// private static final String _OPD_VERBOSE_ALL = "all"; //$NON-NLS-1$ -// private static final String _OPD_VERBOSE_SFILE = "sfile"; //$NON-NLS-1$ -// private static final String _OPD_VERBOSE_ARCS = "arcs"; //$NON-NLS-1$ -// private static final String _OPD_VERBOSE_SAMPLES = "samples"; //$NON-NLS-1$ -// private static final String _OPD_VERBOSE_MODULE = "module"; //$NON-NLS-1$ -// private static final String _OPD_VERBOSE_MISC = "misc"; //$NON-NLS-1$ - // Start the daemon process without starting data collection private static final String OPD_START_DAEMON = "--start-daemon"; //$NON-NLS-1$ @@ -88,30 +79,27 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { private static final String OPD_START_COLLECTION = "--start"; //$NON-NLS-1$ // Flush the collected profiling data to disk - private static final String _OPD_DUMP = "--dump"; //$NON-NLS-1$ + private static final String OPD_DUMP = "--dump"; //$NON-NLS-1$ // Stop data collection - private static final String _OPD_STOP_COLLECTION = "--stop"; //$NON-NLS-1$ + private static final String OPD_STOP_COLLECTION = "--stop"; //$NON-NLS-1$ // Stop data collection and stop daemon - private static final String _OPD_SHUTDOWN = "--shutdown"; //$NON-NLS-1$ + private static final String OPD_SHUTDOWN = "--shutdown"; //$NON-NLS-1$ // Clear out data from current session - private static final String _OPD_RESET = "--reset"; //$NON-NLS-1$ - - // Save data from the current session -// private static final String _OPD_SAVE_SESSION = "--save="; //$NON-NLS-1$ + private static final String OPD_RESET = "--reset"; //$NON-NLS-1$ // Unload the oprofile kernel module and oprofilefs - private static final String _OPD_DEINIT_MODULE = "--deinit"; //$NON-NLS-1$ + private static final String OPD_DEINIT_MODULE = "--deinit"; //$NON-NLS-1$ // Logging verbosity. Specified with setupDaemon. //--verbosity=all generates WAY too much stuff in the log - private String _verbosity = ""; //$NON-NLS-1$ + private String verbosity = ""; //$NON-NLS-1$ public LinuxOpcontrolProvider() throws OpcontrolException { - opcontrolProgram = _findOpcontrol(); + opcontrolProgram = findOpcontrol(); } /** @@ -119,7 +107,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { * @throws OpcontrolException */ public void deinitModule() throws OpcontrolException { - _runOpcontrol(_OPD_DEINIT_MODULE); + runOpcontrol(OPD_DEINIT_MODULE); } /** @@ -127,7 +115,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { * @throws OpcontrolException */ public void dumpSamples() throws OpcontrolException { - _runOpcontrol(_OPD_DUMP); + runOpcontrol(OPD_DUMP); } /** @@ -135,7 +123,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { * @throws OpcontrolException */ public void initModule() throws OpcontrolException { - _runOpcontrol(OPD_INIT_MODULE); + runOpcontrol(OPD_INIT_MODULE); } /** @@ -143,7 +131,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { * @throws OpcontrolException */ public void reset() throws OpcontrolException { - _runOpcontrol(_OPD_RESET); + runOpcontrol(OPD_RESET); } /** @@ -196,17 +184,17 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { // Convert options & events to arguments for opcontrol ArrayList<String> args = new ArrayList<String>(); args.add(OPD_SETUP); - _optionsToArguments(args, options); + optionsToArguments(args, options); if (!Oprofile.getTimerMode()) { if (events == null || events.length == 0) { args.add(OPD_SETUP_EVENT + OPD_SETUP_EVENT_DEFAULT); } else { for (int i = 0; i < events.length; ++i) { - _eventToArguments(args, events[i]); + eventToArguments(args, events[i]); } } } - _runOpcontrol(args); + runOpcontrol(args); } /** @@ -214,7 +202,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { * @throws OpcontrolException */ public void shutdownDaemon() throws OpcontrolException { - _runOpcontrol(_OPD_SHUTDOWN); + runOpcontrol(OPD_SHUTDOWN); } /** @@ -222,7 +210,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { * @throws OpcontrolException */ public void startCollection() throws OpcontrolException { - _runOpcontrol(OPD_START_COLLECTION); + runOpcontrol(OPD_START_COLLECTION); } /** @@ -230,7 +218,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { * @throws OpcontrolException */ public void startDaemon() throws OpcontrolException { - _runOpcontrol(OPD_START_DAEMON); + runOpcontrol(OPD_START_DAEMON); } /** @@ -238,7 +226,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { * @throws OpcontrolException */ public void stopCollection() throws OpcontrolException { - _runOpcontrol(_OPD_STOP_COLLECTION); + runOpcontrol(OPD_STOP_COLLECTION); } /** @@ -246,14 +234,14 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { * @throws OpcontrolException */ public boolean status() throws OpcontrolException { - return _runOpcontrol(OPD_HELP); + return runOpcontrol(OPD_HELP); } // Convenience function - private boolean _runOpcontrol(String cmd) throws OpcontrolException { + private boolean runOpcontrol(String cmd) throws OpcontrolException { ArrayList<String> list = new ArrayList<String>(); list.add(cmd); - return _runOpcontrol(list); + return runOpcontrol(list); } // Will add opcontrol program to beginning of args @@ -263,7 +251,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { * this appears to currently be the only way we can tell if user correctly * entered the password */ - private boolean _runOpcontrol(ArrayList<String> args) throws OpcontrolException { + private boolean runOpcontrol(ArrayList<String> args) throws OpcontrolException { IProject project = Oprofile.getCurrentProject(); @@ -277,8 +265,8 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { // Verbosity hack. If --start or --start-daemon, add verbosity, if set String cmd = (String) args.get(1); - if (_verbosity.length() > 0 && (cmd.equals (OPD_START_COLLECTION) || cmd.equals(OPD_START_DAEMON))) { - args.add(_verbosity); + if (verbosity.length() > 0 && (cmd.equals (OPD_START_COLLECTION) || cmd.equals(OPD_START_DAEMON))) { + args.add(verbosity); } String[] cmdArray = new String[args.size()]; @@ -353,7 +341,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { System.out.println(OprofileCorePlugin.DEBUG_PRINT_PREFIX + buf.toString()); } - private static String _findOpcontrol() throws OpcontrolException { + private static String findOpcontrol() throws OpcontrolException { IProject project = Oprofile.getCurrentProject(); URL url = FileLocator.find(Platform.getBundle(OprofileCorePlugin .getId()), new Path(OPCONTROL_REL_PATH), null); @@ -374,7 +362,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { } // Convert the event into arguments for opcontrol - private void _eventToArguments(ArrayList<String> args, OprofileDaemonEvent event) { + private void eventToArguments(ArrayList<String> args, OprofileDaemonEvent event) { // Event spec: "EVENT:count:mask:profileKernel:profileUser" String spec = new String(OPD_SETUP_EVENT); spec += event.getEvent().getText(); @@ -390,7 +378,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { } // Convert the options into arguments for opcontrol - private void _optionsToArguments(ArrayList<String> args, OprofileDaemonOptions options) { + private void optionsToArguments(ArrayList<String> args, OprofileDaemonOptions options) { // Add separate flags int mask = options.getSeparateProfilesMask(); |