gprof: All kind of warning fixes.
Identified by Sonar.
Change-Id: Ibdf80281657598fd30604b5044f7940f6af0547f
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Reviewed-on: https://git.eclipse.org/r/25047
Tested-by: Hudson CI
diff --git a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunch.java b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunch.java
index 6531040..b0b1b03 100644
--- a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunch.java
+++ b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunch.java
@@ -14,6 +14,6 @@
* Constants for the Gprof launcher.
*/
public interface GprofLaunch {
- String PLUGIN_ID = "org.eclipse.linuxtools.gprof.launch"; //$NON-NLS-1$
- String LAUNCH_ID = PLUGIN_ID + ".gprofLaunch"; //$NON-NLS-1$
+ String PLUGIN_ID = "org.eclipse.linuxtools.gprof.launch"; //$NON-NLS-1$
+ String LAUNCH_ID = PLUGIN_ID + ".gprofLaunch"; //$NON-NLS-1$
}
diff --git a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchConfigurationDelegate.java b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchConfigurationDelegate.java
index ad32a63..c170135 100644
--- a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchConfigurationDelegate.java
+++ b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchConfigurationDelegate.java
@@ -41,151 +41,151 @@
import org.eclipse.ui.PlatformUI;
public class GprofLaunchConfigurationDelegate extends ProfileLaunchConfigurationDelegate {
- protected ILaunchConfiguration config;
+ private ILaunchConfiguration config;
- @Override
- public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- this.config = config;
- IPath exePath = getExePath(config);
+ @Override
+ public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ this.config = config;
+ IPath exePath = getExePath(config);
- /*
- * this code written by QNX Software Systems and others and was
- * originally in the CDT under LocalCDILaunchDelegate::RunLocalApplication
- */
- //set up and launch the local c/c++ program
- IRemoteCommandLauncher launcher = RemoteProxyManager.getInstance().getLauncher(getProject());
+ /*
+ * this code written by QNX Software Systems and others and was
+ * originally in the CDT under LocalCDILaunchDelegate::RunLocalApplication
+ */
+ //set up and launch the local c/c++ program
+ IRemoteCommandLauncher launcher = RemoteProxyManager.getInstance().getLauncher(getProject());
- File workDir = getWorkingDirectory(config);
- if (workDir == null) {
- workDir = new File(System.getProperty("user.home", ".")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- String arguments[] = getProgramArgumentsArray( config );
+ File workDir = getWorkingDirectory(config);
+ if (workDir == null) {
+ workDir = new File(System.getProperty("user.home", ".")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ String arguments[] = getProgramArgumentsArray( config );
- //add a listener for termination of the launch
- ILaunchManager lmgr = DebugPlugin.getDefault().getLaunchManager();
- lmgr.addLaunchListener(new LaunchTerminationWatcher(launch, exePath));
+ //add a listener for termination of the launch
+ ILaunchManager lmgr = DebugPlugin.getDefault().getLaunchManager();
+ lmgr.addLaunchListener(new LaunchTerminationWatcher(launch, exePath));
- Process process = launcher.execute(exePath, arguments, getEnvironment(config), new Path(workDir.getAbsolutePath()), monitor);
+ Process process = launcher.execute(exePath, arguments, getEnvironment(config), new Path(workDir.getAbsolutePath()), monitor);
- DebugPlugin.newProcess( launch, process, renderProcessLabel( exePath.toOSString() ) );
+ DebugPlugin.newProcess( launch, process, renderProcessLabel( exePath.toOSString() ) );
- }
+ }
- //A class used to listen for the termination of the current launch, and
- // run some functions when it is finished.
- class LaunchTerminationWatcher implements ILaunchesListener2 {
- private ILaunch launch;
- private IPath exePath;
+ //A class used to listen for the termination of the current launch, and
+ // run some functions when it is finished.
+ class LaunchTerminationWatcher implements ILaunchesListener2 {
+ private ILaunch launch;
+ private IPath exePath;
- class LaunchTerminationWatcherRunnable implements Runnable {
+ class LaunchTerminationWatcherRunnable implements Runnable {
- private String exePath;
- private String gmonPath;
+ private String exePath;
+ private String gmonPath;
- public LaunchTerminationWatcherRunnable(String exePath, String gmonPath) {
- this.exePath = exePath;
- this.gmonPath = gmonPath;
- }
+ public LaunchTerminationWatcherRunnable(String exePath, String gmonPath) {
+ this.exePath = exePath;
+ this.gmonPath = gmonPath;
+ }
- @Override
- public void run() {
- GmonView.displayGprofView(exePath, gmonPath, getProject());
- }
- }
+ @Override
+ public void run() {
+ GmonView.displayGprofView(exePath, gmonPath, getProject());
+ }
+ }
- public LaunchTerminationWatcher(ILaunch il, IPath exePath) {
- launch = il;
- this.exePath = exePath;
- }
- @Override
- public void launchesTerminated(ILaunch[] launches) {
+ public LaunchTerminationWatcher(ILaunch il, IPath exePath) {
+ launch = il;
+ this.exePath = exePath;
+ }
+ @Override
+ public void launchesTerminated(ILaunch[] launches) {
- for (ILaunch l : launches) {
- /**
- * Retrieve the gmon file, and open profiling results.
- */
- if (l.equals(launch)) {
- //need to run this in the ui thread otherwise get SWT Exceptions
- // based on concurrency issues
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- try {
- String s = exePath.toOSString();
- URI workingDirURI = getProject().getLocationURI();
- RemoteProxyManager rpmgr = RemoteProxyManager.getInstance();
- IRemoteFileProxy proxy = rpmgr.getFileProxy(getProject());
- String workingDirPath = proxy.toPath(workingDirURI);
- // Because we set the working directory on execution to the top-level
- // project directory, the gmon.out file should be found there
- String gmonExpected = workingDirPath + "/gmon.out"; //$NON-NLS-1$
- IFileStore f = proxy.getResource(gmonExpected);
- if (!f.fetchInfo().exists()) {
- Shell parent = PlatformUI.getWorkbench().getDisplay().getActiveShell();
- GprofNoGmonDialog dialog = new GprofNoGmonDialog(parent, getProject());
- if (dialog.open() != 0) {
- gmonExpected = dialog.getPathToGmon();
- f = proxy.getResource(gmonExpected);
- } else {
- return;
- }
- }
+ for (ILaunch l : launches) {
+ /**
+ * Retrieve the gmon file, and open profiling results.
+ */
+ if (l.equals(launch)) {
+ //need to run this in the ui thread otherwise get SWT Exceptions
+ // based on concurrency issues
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ String s = exePath.toOSString();
+ URI workingDirURI = getProject().getLocationURI();
+ RemoteProxyManager rpmgr = RemoteProxyManager.getInstance();
+ IRemoteFileProxy proxy = rpmgr.getFileProxy(getProject());
+ String workingDirPath = proxy.toPath(workingDirURI);
+ // Because we set the working directory on execution to the top-level
+ // project directory, the gmon.out file should be found there
+ String gmonExpected = workingDirPath + "/gmon.out"; //$NON-NLS-1$
+ IFileStore f = proxy.getResource(gmonExpected);
+ if (!f.fetchInfo().exists()) {
+ Shell parent = PlatformUI.getWorkbench().getDisplay().getActiveShell();
+ GprofNoGmonDialog dialog = new GprofNoGmonDialog(parent, getProject());
+ if (dialog.open() != 0) {
+ gmonExpected = dialog.getPathToGmon();
+ f = proxy.getResource(gmonExpected);
+ } else {
+ return;
+ }
+ }
- // We found gmon.out. Make sure it was generated after the executable was formed.
- IFileStore exe = proxy.getResource(exePath.toString());
- if (exe.fetchInfo().getLastModified() > f.fetchInfo().getLastModified()) {
- String title = GprofLaunchMessages.GprofGmonStale_msg;
- String message = GprofLaunchMessages.GprofGmonStaleExplanation_msg;
- Shell parent = PlatformUI.getWorkbench().getDisplay().getActiveShell();
- MessageDialog.openWarning(parent, title, message);
- }
- Display.getDefault().asyncExec(new LaunchTerminationWatcherRunnable(s, gmonExpected));
+ // We found gmon.out. Make sure it was generated after the executable was formed.
+ IFileStore exe = proxy.getResource(exePath.toString());
+ if (exe.fetchInfo().getLastModified() > f.fetchInfo().getLastModified()) {
+ String title = GprofLaunchMessages.GprofGmonStale_msg;
+ String message = GprofLaunchMessages.GprofGmonStaleExplanation_msg;
+ Shell parent = PlatformUI.getWorkbench().getDisplay().getActiveShell();
+ MessageDialog.openWarning(parent, title, message);
+ }
+ Display.getDefault().asyncExec(new LaunchTerminationWatcherRunnable(s, gmonExpected));
- } catch (NullPointerException e) {
- // Do nothing
- } catch (CoreException e) {
- // Do nothing
- }
- }
- });
- }
- }
- }
+ } catch (NullPointerException e) {
+ // Do nothing
+ } catch (CoreException e) {
+ // Do nothing
+ }
+ }
+ });
+ }
+ }
+ }
- @Override
- public void launchesAdded(ILaunch[] launches) { /* dont care */}
- @Override
- public void launchesChanged(ILaunch[] launches) { /* dont care */ }
- @Override
- public void launchesRemoved(ILaunch[] launches) { /* dont care */ }
+ @Override
+ public void launchesAdded(ILaunch[] launches) { /* dont care */}
+ @Override
+ public void launchesChanged(ILaunch[] launches) { /* dont care */ }
+ @Override
+ public void launchesRemoved(ILaunch[] launches) { /* dont care */ }
- }
+ }
- @Override
- protected String getPluginID() {
- return GprofLaunch.PLUGIN_ID;
- }
+ @Override
+ protected String getPluginID() {
+ return GprofLaunch.PLUGIN_ID;
+ }
- /* all these functions exist to be overridden by the test class in order to allow launch testing */
+ /* all these functions exist to be overridden by the test class in order to allow launch testing */
- protected IProject getProject(){
- try{
- return CDebugUtils.verifyCProject(config).getProject();
- } catch (CoreException e) {
- e.printStackTrace();
- }
- return null;
- }
- /**
- *
- * Return the exe path of the binary to be profiled.
- * @param config
- * @return the exe path of the binary stored in the configuration
- * @throws CoreException
- * @since 1.1
- */
- protected IPath getExePath(ILaunchConfiguration config) throws CoreException{
- return CDebugUtils.verifyProgramPath( config );
- }
+ private IProject getProject(){
+ try{
+ return CDebugUtils.verifyCProject(config).getProject();
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+ /**
+ *
+ * Return the exe path of the binary to be profiled.
+ * @param config
+ * @return the exe path of the binary stored in the configuration
+ * @throws CoreException
+ * @since 1.1
+ */
+ private IPath getExePath(ILaunchConfiguration config) throws CoreException{
+ return CDebugUtils.verifyProgramPath( config );
+ }
}
diff --git a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchConfigurationTabGroup.java b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchConfigurationTabGroup.java
index ffd40df..3d69442 100644
--- a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchConfigurationTabGroup.java
+++ b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchConfigurationTabGroup.java
@@ -7,18 +7,18 @@
*
* Contributors:
* Red Hat Inc. - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.linuxtools.internal.gprof.launch;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.linuxtools.profiling.launch.ProfileLaunchConfigurationTabGroup;
public class GprofLaunchConfigurationTabGroup extends
- ProfileLaunchConfigurationTabGroup {
+ ProfileLaunchConfigurationTabGroup {
- @Override
- public AbstractLaunchConfigurationTab[] getProfileTabs() {
- return new AbstractLaunchConfigurationTab[0];
- }
-
+ @Override
+ public AbstractLaunchConfigurationTab[] getProfileTabs() {
+ return new AbstractLaunchConfigurationTab[0];
+ }
+
}
diff --git a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchMessages.java b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchMessages.java
index 33d3923..d6b366f 100644
--- a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchMessages.java
+++ b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchMessages.java
@@ -14,18 +14,18 @@
public class GprofLaunchMessages extends NLS {
- public static String GprofCompilerOptions_msg;
- public static String GprofCompileAgain_msg;
- public static String GprofGmonStale_msg;
- public static String GprofGmonStaleExplanation_msg;
+ public static String GprofCompilerOptions_msg;
+ public static String GprofCompileAgain_msg;
+ public static String GprofGmonStale_msg;
+ public static String GprofGmonStaleExplanation_msg;
- public static String GprofNoGmonDialog_Browse;
- public static String GprofNoGmonDialog_Cancel;
- public static String GprofNoGmonDialog_OpenGmon;
- public static String GprofNoGmonDialog_Workspace;
+ public static String GprofNoGmonDialog_Browse;
+ public static String GprofNoGmonDialog_Cancel;
+ public static String GprofNoGmonDialog_OpenGmon;
+ public static String GprofNoGmonDialog_Workspace;
- static {
- NLS.initializeMessages(GprofLaunchMessages.class.getName(), GprofLaunchMessages.class);
- }
+ static {
+ NLS.initializeMessages(GprofLaunchMessages.class.getName(), GprofLaunchMessages.class);
+ }
}
diff --git a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchShortcut.java b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchShortcut.java
index 2431c4b..5d39f07 100644
--- a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchShortcut.java
+++ b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofLaunchShortcut.java
@@ -17,20 +17,19 @@
public class GprofLaunchShortcut extends ProfileLaunchShortcut {
+ @Override
+ protected void setDefaultProfileAttributes(
+ ILaunchConfigurationWorkingCopy wc) {
+ //nothing to do
+ }
- @Override
- protected void setDefaultProfileAttributes(
- ILaunchConfigurationWorkingCopy wc) {
- //nothing to do
- }
-
- /**
- * Method getValgrindLaunchConfigType.
- * @return ILaunchConfigurationType
- */
- @Override
- protected ILaunchConfigurationType getLaunchConfigType() {
- return getLaunchManager().getLaunchConfigurationType(GprofLaunch.LAUNCH_ID);
- }
+ /**
+ * Method getValgrindLaunchConfigType.
+ * @return ILaunchConfigurationType
+ */
+ @Override
+ protected ILaunchConfigurationType getLaunchConfigType() {
+ return getLaunchManager().getLaunchConfigurationType(GprofLaunch.LAUNCH_ID);
+ }
}
diff --git a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofNoGmonDialog.java b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofNoGmonDialog.java
index 00eeadf..c0e92c8 100644
--- a/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofNoGmonDialog.java
+++ b/gprof/org.eclipse.linuxtools.gprof.launch/src/org/eclipse/linuxtools/internal/gprof/launch/GprofNoGmonDialog.java
@@ -33,71 +33,71 @@
*/
public class GprofNoGmonDialog extends MessageDialog {
- private final IProject fProject;
- private String fGmonPath = null;
+ private final IProject project;
+ private String gmonPath = null;
- private static String[] buildButtons() {
- //future enhancement: add a button to edit project settings (managed make project only).
- return new String[] {
- GprofLaunchMessages.GprofNoGmonDialog_Cancel, GprofLaunchMessages.GprofNoGmonDialog_Browse, GprofLaunchMessages.GprofNoGmonDialog_Workspace
- };
- }
+ private static String[] buildButtons() {
+ //future enhancement: add a button to edit project settings (managed make project only).
+ return new String[] {
+ GprofLaunchMessages.GprofNoGmonDialog_Cancel, GprofLaunchMessages.GprofNoGmonDialog_Browse, GprofLaunchMessages.GprofNoGmonDialog_Workspace
+ };
+ }
- protected GprofNoGmonDialog(Shell parentShell, IProject project) {
- super(parentShell, GprofLaunchMessages.GprofCompilerOptions_msg, null,
- GprofLaunchMessages.GprofCompileAgain_msg, WARNING, buildButtons(), 0);
- this.fProject = project;
- }
+ protected GprofNoGmonDialog(Shell parentShell, IProject project) {
+ super(parentShell, GprofLaunchMessages.GprofCompilerOptions_msg, null,
+ GprofLaunchMessages.GprofCompileAgain_msg, WARNING, buildButtons(), 0);
+ this.project = project;
+ }
- @Override
- protected void buttonPressed(int buttonId) {
- if (buttonId == 1) {
- FileDialog dialog = new FileDialog(this.getShell(), SWT.OPEN);
- dialog.setText(GprofLaunchMessages.GprofNoGmonDialog_OpenGmon);
- if (fProject != null) {
- dialog.setFilterPath(fProject.getLocation().toOSString());
- }
- String s = dialog.open();
- if (s != null) {
- fGmonPath = s;
- }
- } else if (buttonId == 2) {
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(),
- new WorkbenchContentProvider());
- dialog.setTitle(GprofLaunchMessages.GprofNoGmonDialog_OpenGmon);
- dialog.setMessage(GprofLaunchMessages.GprofNoGmonDialog_OpenGmon);
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
- dialog.setAllowMultiple(false);
- dialog.setInitialSelection(fProject);
- dialog.setValidator(new ISelectionStatusValidator() {
- @Override
- public IStatus validate(Object[] selection) {
- if (selection.length != 1) {
- return new Status(IStatus.ERROR, GprofLaunch.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- if (!(selection[0] instanceof IFile)) {
- return new Status(IStatus.ERROR, GprofLaunch.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- return new Status(IStatus.OK, GprofLaunch.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
- }
- });
- if (dialog.open() == IDialogConstants.OK_ID) {
- IResource resource = (IResource) dialog.getFirstResult();
- fGmonPath = resource.getLocation().toOSString();
- }
- }
+ @Override
+ protected void buttonPressed(int buttonId) {
+ if (buttonId == 1) {
+ FileDialog dialog = new FileDialog(this.getShell(), SWT.OPEN);
+ dialog.setText(GprofLaunchMessages.GprofNoGmonDialog_OpenGmon);
+ if (project != null) {
+ dialog.setFilterPath(project.getLocation().toOSString());
+ }
+ String s = dialog.open();
+ if (s != null) {
+ gmonPath = s;
+ }
+ } else if (buttonId == 2) {
+ ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(),
+ new WorkbenchContentProvider());
+ dialog.setTitle(GprofLaunchMessages.GprofNoGmonDialog_OpenGmon);
+ dialog.setMessage(GprofLaunchMessages.GprofNoGmonDialog_OpenGmon);
+ dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
+ dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
+ dialog.setAllowMultiple(false);
+ dialog.setInitialSelection(project);
+ dialog.setValidator(new ISelectionStatusValidator() {
+ @Override
+ public IStatus validate(Object[] selection) {
+ if (selection.length != 1) {
+ return new Status(IStatus.ERROR, GprofLaunch.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
+ }
+ if (!(selection[0] instanceof IFile)) {
+ return new Status(IStatus.ERROR, GprofLaunch.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
+ }
+ return new Status(IStatus.OK, GprofLaunch.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
+ }
+ });
+ if (dialog.open() == IDialogConstants.OK_ID) {
+ IResource resource = (IResource) dialog.getFirstResult();
+ gmonPath = resource.getLocation().toOSString();
+ }
+ }
- if (fGmonPath == null) {
- setReturnCode(0);
- } else {
- setReturnCode(buttonId);
- }
+ if (gmonPath == null) {
+ setReturnCode(0);
+ } else {
+ setReturnCode(buttonId);
+ }
close();
- }
+ }
- public String getPathToGmon() {
- return fGmonPath;
- }
+ public String getPathToGmon() {
+ return gmonPath;
+ }
}
diff --git a/gprof/org.eclipse.linuxtools.gprof.test/src/org/eclipse/linuxtools/internal/gprof/test/GprofTest.java b/gprof/org.eclipse.linuxtools.gprof.test/src/org/eclipse/linuxtools/internal/gprof/test/GprofTest.java
index 68a51a5..41667aa 100644
--- a/gprof/org.eclipse.linuxtools.gprof.test/src/org/eclipse/linuxtools/internal/gprof/test/GprofTest.java
+++ b/gprof/org.eclipse.linuxtools.gprof.test/src/org/eclipse/linuxtools/internal/gprof/test/GprofTest.java
@@ -183,7 +183,7 @@
AbstractSTTreeViewer gmonViewer = (AbstractSTTreeViewer) view
.getSTViewer();
GmonDecoder decoder = (GmonDecoder) gmonViewer.getInput();
- int prof_rate = decoder.getHistogramDecoder().getProf_rate();
+ int prof_rate = decoder.getHistogramDecoder().getProfRate();
if (prof_rate == 0) {
return;
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/.settings/org.eclipse.jdt.core.prefs b/gprof/org.eclipse.linuxtools.gprof/.settings/org.eclipse.jdt.core.prefs
index 37db8e0..855eb36 100644
--- a/gprof/org.eclipse.linuxtools.gprof/.settings/org.eclipse.jdt.core.prefs
+++ b/gprof/org.eclipse.linuxtools.gprof/.settings/org.eclipse.jdt.core.prefs
@@ -84,8 +84,8 @@
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/Activator.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/Activator.java
index 70e1e24..40f7da0 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/Activator.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/Activator.java
@@ -25,20 +25,12 @@
// The shared instance
private static Activator plugin;
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/OpenGmonAction.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/OpenGmonAction.java
index 42bf354..5b6d7af 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/OpenGmonAction.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/OpenGmonAction.java
@@ -44,7 +44,9 @@
String binaryPath = d.getBinaryFile();
IProject project = null;
IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(file);
- if (f != null) project = f.getProject();
+ if (f != null) {
+ project = f.getProject();
+ }
GmonView.displayGprofView(binaryPath, file.toOSString(), project);
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/SwitchContentProviderAction.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/SwitchContentProviderAction.java
index 6f4681c..0fb697c 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/SwitchContentProviderAction.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/SwitchContentProviderAction.java
@@ -16,9 +16,6 @@
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.linuxtools.internal.gprof.Activator;
-
-
-
/**
* This action changes the content provider of
* the {@link org.eclipse.linuxtools.internal.gprof.view.GmonView}
@@ -29,7 +26,7 @@
private final ColumnViewer viewer;
private final ITreeContentProvider provider;
-
+
/**
* Constructor
* @param name of the action
@@ -40,20 +37,17 @@
public SwitchContentProviderAction(String name, String iconPath, ColumnViewer viewer, ITreeContentProvider provider) {
super(name, AS_RADIO_BUTTON);
this.setImageDescriptor(Activator.getImageDescriptor(iconPath));
- this.setToolTipText(name);
+ this.setToolTipText(name);
this.viewer = viewer;
this.provider = provider;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
@Override
public void run() {
viewer.getControl().setRedraw(false);
viewer.setContentProvider(provider);
((TreeViewer)viewer).expandToLevel(2);
- viewer.getControl().setRedraw(true);
+ viewer.getControl().setRedraw(true);
}
-
+
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/SwitchSampleTimeAction.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/SwitchSampleTimeAction.java
index 2bfeaa0..6daef53 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/SwitchSampleTimeAction.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/action/SwitchSampleTimeAction.java
@@ -31,7 +31,7 @@
public class SwitchSampleTimeAction extends Action {
private final AbstractSTDataView view;
-
+
/**
* Constructor
* @param name name of the action
@@ -44,15 +44,12 @@
this.view = view;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
@Override
public void run() {
AbstractSTTreeViewer gmonViewer = (AbstractSTTreeViewer)view.getSTViewer();
GmonDecoder decoder = (GmonDecoder) gmonViewer.getInput();
if(decoder != null){
- int prof_rate = decoder.getHistogramDecoder().getProf_rate();
+ int prof_rate = decoder.getHistogramDecoder().getProfRate();
if (prof_rate == 0) {
MessageDialog.openError(view.getSite().getShell(),
@@ -68,6 +65,6 @@
gmonViewer.getViewer().refresh();
}
}
-
-
+
+
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/dialog/OpenGmonDialog.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/dialog/OpenGmonDialog.java
index ce42521..700d333 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/dialog/OpenGmonDialog.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/dialog/OpenGmonDialog.java
@@ -60,19 +60,12 @@
private Text binText;
private String binValue;
- /* buttons */
- private Button binBrowseWorkspaceButton;
- private Button binBrowseFileSystemButton;
-
/* error label */
private Label errorLabel;
/* validation boolean */
private boolean binaryValid;
- /* internal listener */
- private final BinaryModifyListener binModifyListener = new BinaryModifyListener();
-
private final String defaultValue;
private final IPath gmonFile;
@@ -131,13 +124,13 @@
data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
binText.setLayoutData(data);
- binText.addModifyListener(binModifyListener);
+ binText.addModifyListener(new BinaryModifyListener());
Composite cbBin = new Composite(c, SWT.NONE);
data = new GridData(GridData.HORIZONTAL_ALIGN_END);
cbBin.setLayoutData(data);
cbBin.setLayout(new GridLayout(2, true));
- binBrowseWorkspaceButton = new Button(cbBin, SWT.PUSH);
+ Button binBrowseWorkspaceButton = new Button(cbBin, SWT.PUSH);
binBrowseWorkspaceButton.setText(Messages.OpenGmonDialog_WORKSPACE);
binBrowseWorkspaceButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -145,7 +138,7 @@
handleBrowseWorkspace(Messages.OpenGmonDialog_OPEN_BINARY_FILE, binText);
}
});
- binBrowseFileSystemButton = new Button(cbBin, SWT.PUSH);
+ Button binBrowseFileSystemButton = new Button(cbBin, SWT.PUSH);
binBrowseFileSystemButton.setText(Messages.OpenGmonDialog_FILE_SYSTEM);
binBrowseFileSystemButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -200,7 +193,7 @@
}
- protected void handleBrowseWorkspace(String msg, Text text) {
+ private void handleBrowseWorkspace(String msg, Text text) {
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(),
new WorkbenchContentProvider());
dialog.setTitle(msg);
@@ -209,8 +202,9 @@
dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
dialog.setAllowMultiple(false);
IContainer c = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(this.gmonFile);
- if (c != null)
+ if (c != null) {
dialog.setInitialSelection(c.getProject());
+ }
dialog.setValidator(new ISelectionStatusValidator() {
@Override
public IStatus validate(Object[] selection) {
@@ -229,7 +223,7 @@
}
}
- protected void handleBrowse(String msg, Text text) {
+ private void handleBrowse(String msg, Text text) {
FileDialog dialog = new FileDialog(this.getShell(), SWT.OPEN);
dialog.setText(msg);
String t = text.getText();
@@ -246,7 +240,8 @@
}
dialog.setFilterPath(t);
String s = dialog.open();
- if (s != null)
+ if (s != null) {
text.setText(s);
+ }
}
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder.java
index c59503e..01b2605 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder.java
@@ -32,18 +32,18 @@
public class CallGraphDecoder {
protected final GmonDecoder decoder;
-
-
+
+
private final Map<ISymbol, CallGraphNode> nodes = new HashMap<>();
-
+
/**
* Constructor
- * @param decoder the Gmon decoder
+ * @param decoder the Gmon decoder
*/
public CallGraphDecoder(GmonDecoder decoder) {
this.decoder = decoder;
}
-
+
/**
* Decode call-graph record from gmon file.
* @param stream
@@ -64,16 +64,15 @@
}
addCallArc(parentSymbol, parentAddress, childSymbol, count);
}
-
-
+
+
protected long readAddress(DataInput stream) throws IOException {
long ret = stream.readInt() & 0xFFFFFFFFL;
return ret;
}
-
-
- public void addCallArc(ISymbol parent, IAddress parentAddress, ISymbol child, int count)
- {
+
+
+ private void addCallArc(ISymbol parent, IAddress parentAddress, ISymbol child, int count) {
CallGraphNode parentNode = nodes.get(parent);
CallGraphNode childNode = nodes.get(child);
if (parentNode == null) {
@@ -94,18 +93,11 @@
}
}
- /**
- * @return the nodes
- */
- public Map<ISymbol, CallGraphNode> getNodes() {
- return nodes;
- }
-
void populate(HistRoot rootNode) {
- for (CallGraphNode callGraphNode : getNodes().values()) {
+ for (CallGraphNode callGraphNode : nodes.values()) {
rootNode.addCallGraphNode(callGraphNode);
}
}
-
-
+
+
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder_64.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder64.java
similarity index 70%
copy from gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder_64.java
copy to gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder64.java
index 6eef428..7dd013b 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder_64.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder64.java
@@ -3,9 +3,9 @@
import java.io.DataInput;
import java.io.IOException;
-public class CallGraphDecoder_64 extends CallGraphDecoder{
+public class CallGraphDecoder64 extends CallGraphDecoder{
- public CallGraphDecoder_64(GmonDecoder decoder) {
+ public CallGraphDecoder64(GmonDecoder decoder) {
super(decoder);
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/GmonDecoder.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/GmonDecoder.java
index 371a25d..7061171 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/GmonDecoder.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/GmonDecoder.java
@@ -47,7 +47,7 @@
// header
private String cookie;
- private int gmon_version;
+ private int gmonVersion;
private byte[] spare;
private final IBinaryObject program;
@@ -88,8 +88,8 @@
program.getBinaryParser().getFormat();
String cpu = program.getCPU();
if (Platform.ARCH_X86_64.equals(cpu) || "ppc64".equals(cpu)) { //$NON-NLS-1$
- histo = new HistogramDecoder_64(this);
- callGraph = new CallGraphDecoder_64(this);
+ histo = new HistogramDecoder64(this);
+ callGraph = new CallGraphDecoder64(this);
_32_bit_platform = false;
} else {
_32_bit_platform = true;
@@ -113,7 +113,7 @@
leStream.mark(1000);
boolean gmonType = readHeader(leStream);
if (gmonType)
- ReadGmonContent(leStream);
+ readGmonContent(leStream);
else {
leStream.reset();
histo.decodeOldHeader(leStream);
@@ -126,7 +126,7 @@
// normal. End of file reached.
}
this.callGraph.populate(rootNode);
- this.histo.AssignSamplesSymbol();
+ this.histo.assignSamplesSymbol();
}
} finally {
leStream.close();
@@ -136,7 +136,7 @@
beStream.mark(1000);
boolean gmonType = readHeader(beStream);
if (gmonType)
- ReadGmonContent(beStream);
+ readGmonContent(beStream);
else {
beStream.reset();
histo.decodeOldHeader(beStream);
@@ -145,11 +145,11 @@
do {
this.callGraph.decodeCallGraphRecord(beStream, true);
} while (true);
- } catch (EOFException _) {
+ } catch (EOFException e) {
// normal. End of file reached.
}
this.callGraph.populate(rootNode);
- this.histo.AssignSamplesSymbol();
+ this.histo.assignSamplesSymbol();
}
} finally {
beStream.close();
@@ -165,11 +165,11 @@
* @throws IOException
* if an IO error occurs or if the stream is not a gmon file.
*/
- public boolean readHeader(DataInput stream) throws IOException {
+ private boolean readHeader(DataInput stream) throws IOException {
byte[] _cookie = new byte[4];
stream.readFully(_cookie);
cookie = new String(_cookie);
- gmon_version = stream.readInt();
+ gmonVersion = stream.readInt();
spare = new byte[12];
stream.readFully(spare);
return "gmon".equals(cookie); //$NON-NLS-1$
@@ -181,7 +181,7 @@
* @param stream
* @throws IOException
*/
- public void ReadGmonContent(DataInput stream) throws IOException {
+ private void readGmonContent(DataInput stream) throws IOException {
do {
// int tag = -1;
tag = -1;
@@ -203,13 +203,14 @@
throw new IOException(Messages.GmonDecoder_BAD_TAG_ERROR);
}
- if (shouldDump == true)
+ if (shouldDump == true) {
dumpGmonResult(ps == null ? System.out : ps);
+ }
} while (true);
this.callGraph.populate(rootNode);
- this.histo.AssignSamplesSymbol();
+ this.histo.assignSamplesSymbol();
}
@@ -217,7 +218,7 @@
ps.println("-- gmon Results --"); //$NON-NLS-1$
ps.println("cookie " + cookie); //$NON-NLS-1$
- ps.println("gmon_version " + gmon_version); //$NON-NLS-1$
+ ps.println("gmon_version " + gmonVersion); //$NON-NLS-1$
// ps.println("spare "+new String(spare));
ps.println("tag " + tag); //$NON-NLS-1$
@@ -239,13 +240,6 @@
}
/**
- * @return the call graph decoder
- */
- public CallGraphDecoder getCallGraphDecoder() {
- return callGraph;
- }
-
- /**
* @return the program
*/
public IBinaryObject getProgram() {
@@ -260,15 +254,6 @@
}
/**
- * Gets the version number parsed in the gmon file
- *
- * @return a gmon version
- */
- public int getGmonVersion() {
- return gmon_version;
- }
-
- /**
* @return the (last) parsed gmon file
*/
public String getGmonFile() {
@@ -286,8 +271,9 @@
String ret = filenames.get(s);
if (ret == null) {
ret = STSymbolManager.sharedInstance.getFilename(s, project);
- if (ret == null)
+ if (ret == null) {
ret = "??"; //$NON-NLS-1$
+ }
filenames.put(s, ret);
}
return ret;
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/HistogramDecoder.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/HistogramDecoder.java
index f95af76..11b9dab 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/HistogramDecoder.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/HistogramDecoder.java
@@ -33,7 +33,7 @@
private static final int GMON_HDRSIZE_OLDBSD_32 = (4 + 4 + 4) ;
private static final int GMON_HDRSIZE_OLDBSD_64 = (8 + 8 + 4);
-
+
/** the decoder */
protected final GmonDecoder decoder;
@@ -43,13 +43,11 @@
/** Max pc address of sampled buffer */
protected long highpc;
/** Profiling clock rate */
- protected int prof_rate;
- /** physical dimension - usually "seconds" */
- protected String dimen;
+ protected int profRate;
/** usually 's' for seconds, 'm' for milliseconds... */
- protected char dimen_abbrev;
+ protected char dimenAbbrev;
/** used when aggregate several gmon files */
- protected boolean initialized = false;
+ private boolean initialized = false;
/** Histogram samples (shorts in the file!). */
@@ -61,13 +59,13 @@
/**
- * Constructor
+ * Constructor
* @param decoder the Gmon decoder
*/
public HistogramDecoder(GmonDecoder decoder) {
this.decoder = decoder;
}
-
+
protected long readAddress(DataInput stream) throws IOException {
long ret = stream.readInt() & 0xFFFFFFFFL;
return ret;
@@ -91,17 +89,15 @@
stream.readFully(bytes);
byte b = stream.readByte();
- if (!isCompatible(lowpc, highpc, prof_rate, hist_num_bins))
- {
+ if (!isCompatible(lowpc, highpc, prof_rate, hist_num_bins)) {
// TODO exception to normalize
throw new RuntimeException(Messages.HistogramDecoder_INCOMPATIBLE_HIST_HEADER_ERROR_MSG);
}
this.lowpc = lowpc;
this.highpc = highpc;
- this.prof_rate = prof_rate;
+ this.profRate = prof_rate;
hist_sample = new int[hist_num_bins]; // Impl note: JVM sets all integers to 0
- dimen = new String(bytes);
- dimen_abbrev = (char) b;
+ dimenAbbrev = (char) b;
long temp = highpc - lowpc;
bucketSize = Math.round(temp/(double)hist_num_bins);
}
@@ -148,14 +144,13 @@
this.lowpc = low_pc;
this.highpc = high_pc;
- this.prof_rate = profrate;
+ this.profRate = profrate;
hist_sample = new int[hist_num_bins]; // Impl note: JVM sets all integers to 0
- dimen = "s"; //$NON-NLS-1$
- dimen_abbrev = 's';
+ dimenAbbrev = 's';
long temp = highpc - lowpc;
bucketSize = Math.round(temp/(double)hist_num_bins);
}
-
+
/**
* Checks whether the gmon file currently parsed is compatible with the previous one (if any).
@@ -165,12 +160,12 @@
* @param sample_count
* @return whether the gmon file currently parsed is compatible with the previous one (if any).
*/
- public boolean isCompatible(long lowpc, long highpc, int profrate, int sample_count) {
+ private boolean isCompatible(long lowpc, long highpc, int profrate, int sample_count) {
if (!initialized) return true;
return (
(this.lowpc == lowpc) &&
(this.highpc == highpc) &&
- (this.prof_rate == profrate) &&
+ (this.profRate == profrate) &&
(this.hist_sample.length == sample_count)
);
}
@@ -184,9 +179,9 @@
*/
public void decodeHistRecord(DataInput stream) throws IOException {
for (int i = 0; i<hist_sample.length; i++) {
- short _rv = stream.readShort();
- if (_rv != 0) {
- int hist_size = (_rv & 0xFFFF);
+ short rv = stream.readShort();
+ if (rv != 0) {
+ int hist_size = (rv & 0xFFFF);
hist_sample[i] += hist_size;
}
}
@@ -197,8 +192,7 @@
* Print the histogram header, for debug usage.
* @param ps a printstream (typically System.out)
*/
- public void printHistHeader(PrintStream ps)
- {
+ public void printHistHeader(PrintStream ps) {
ps.println(" \nHistogram Header : \n"); //$NON-NLS-1$
ps.print(" Base pc address of sample buffer = 0x"); //$NON-NLS-1$
ps.println(Long.toHexString(lowpc));
@@ -207,11 +201,11 @@
ps.print(" Number of histogram samples = "); //$NON-NLS-1$
ps.println(hist_sample.length);
ps.print(" Profiling clock rate = "); //$NON-NLS-1$
- ps.println(prof_rate);
+ ps.println(profRate);
// ps.print(" Physical dimension usually \"seconds\" = ");
// ps.println(dimen);
ps.print(" Physical dimension abreviation : 's' for \"seconds\" 'm' for \"milliseconds\" = "); //$NON-NLS-1$
- ps.println(dimen_abbrev);
+ ps.println(dimenAbbrev);
}
/**
@@ -237,10 +231,9 @@
/**
* Assign the hits to the given symbols
- * @param symblist
+ * @param symblist
*/
- public void AssignSamplesSymbol()
- {
+ public void assignSamplesSymbol() {
if (hist_sample == null || hist_sample.length == 0) return;
ISymbol[] symblist = this.decoder.getProgram().getSymbols();
/* read samples and assign to namelist symbols */
@@ -261,17 +254,16 @@
svalue1 = symblist[j+1].getAddress().getValue().longValue();
/* if high end of tick is below entry address,
* go for next tick. */
- if(pch < svalue0)
+ if(pch < svalue0) {
break;
+ }
/* if low end of tick into next routine,
* go for next routine. */
- if(pcl < svalue1)
- {
+ if(pcl < svalue1) {
long start_addr = pcl>svalue0?pcl:svalue0;
long end_addr = pch<svalue1?pch:svalue1;
long overlap = end_addr - start_addr;
- if(overlap > 0)
- {
+ if(overlap > 0) {
ISymbol symbol = symblist[j];
int time = (int) ((overlap * ccnt) / bucketSize);
Bucket bck = new Bucket(start_addr, end_addr, time);
@@ -289,18 +281,18 @@
}
/**
- * @return the prof_rate
+ * @return the profRate
*/
- public int getProf_rate() {
- return prof_rate;
+ public int getProfRate() {
+ return profRate;
}
/**
- *
+ *
* @return 's' for seconds, 'm' for ms, 'u' for �s....
*/
public char getTimeDimension() {
- return dimen_abbrev;
+ return dimenAbbrev;
}
/**
@@ -309,8 +301,4 @@
public long getBucketSize(){
return bucketSize;
}
-
-
-
-
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder_64.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/HistogramDecoder64.java
similarity index 70%
rename from gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder_64.java
rename to gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/HistogramDecoder64.java
index 6eef428..55f7aa1 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/CallGraphDecoder_64.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/HistogramDecoder64.java
@@ -3,16 +3,17 @@
import java.io.DataInput;
import java.io.IOException;
-public class CallGraphDecoder_64 extends CallGraphDecoder{
+public class HistogramDecoder64 extends HistogramDecoder {
- public CallGraphDecoder_64(GmonDecoder decoder) {
+ public HistogramDecoder64(GmonDecoder decoder) {
super(decoder);
}
-
+
@Override
protected long readAddress(DataInput stream) throws IOException {
long ret = stream.readLong();
return ret;
}
+
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/HistogramDecoder_64.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/HistogramDecoder_64.java
deleted file mode 100644
index dab927d..0000000
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/parser/HistogramDecoder_64.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.eclipse.linuxtools.internal.gprof.parser;
-
-import java.io.DataInput;
-import java.io.IOException;
-
-public class HistogramDecoder_64 extends HistogramDecoder {
-
- public HistogramDecoder_64(GmonDecoder decoder) {
- super(decoder);
- }
-
- @Override
- protected long readAddress(DataInput stream) throws IOException {
- long ret = stream.readLong();
- return ret;
- }
-
-
-}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/symbolManager/Bucket.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/symbolManager/Bucket.java
index e9429f6..c64b595 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/symbolManager/Bucket.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/symbolManager/Bucket.java
@@ -19,21 +19,21 @@
public class Bucket {
/** Start address of this bucket */
- public final long start_addr;
+ public final long startAddr;
/** End address of this bucket */
- public final long end_addr;
+ public final long endAddr;
/** time spent in this bucket */
public final int time;
/**
* Constructor
- * @param start_addr
- * @param end_addr
+ * @param startAddr
+ * @param endAddr
* @param time
*/
- public Bucket(long start_addr, long end_addr, int time) {
- this.start_addr = start_addr;
- this.end_addr = end_addr;
+ public Bucket(long startAddr, long endAddr, int time) {
+ this.startAddr = startAddr;
+ this.endAddr = endAddr;
this.time = time;
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/symbolManager/CallGraphNode.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/symbolManager/CallGraphNode.java
index 10930ab..b6a16ee 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/symbolManager/CallGraphNode.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/symbolManager/CallGraphNode.java
@@ -40,8 +40,9 @@
*/
public CallGraphArc getInputArc(CallGraphNode parent) {
for (CallGraphArc inputArc : parents) {
- if (inputArc.parent == parent)
+ if (inputArc.parent == parent) {
return inputArc;
+ }
}
return null;
}
@@ -53,8 +54,9 @@
*/
public CallGraphArc getOutputArc(CallGraphNode child) {
for (CallGraphArc outputArc : children) {
- if (outputArc.child == child)
+ if (outputArc.child == child) {
return outputArc;
+ }
}
return null;
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/Aggregator.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/Aggregator.java
index da39010..b820eec 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/Aggregator.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/Aggregator.java
@@ -101,7 +101,7 @@
break;
errorMessage += s + "\n"; //$NON-NLS-1$
} while (true);
- } catch (IOException _) {
+ } catch (IOException e) {
// do nothing
}
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/GprofProgramChecker.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/GprofProgramChecker.java
deleted file mode 100644
index 1f2530b..0000000
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/GprofProgramChecker.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 STMicroelectronics.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Xavier Raynaud <xavier.raynaud@st.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.linuxtools.internal.gprof.utils;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.WeakHashMap;
-
-import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.linuxtools.binutils.utils.STNMFactory;
-import org.eclipse.linuxtools.binutils.utils.STNMSymbolsHandler;
-import org.eclipse.linuxtools.binutils.utils.STSymbolManager;
-
-public class GprofProgramChecker implements STNMSymbolsHandler {
-
- private boolean mcountFound = false;
- private boolean mcleanupFound = false;
- private long timestamp;
- private final static WeakHashMap<File, GprofProgramChecker> map = new WeakHashMap<>();
- /** Private Constructor */
- private GprofProgramChecker(long timestamp) {
- this.timestamp = timestamp;
- }
-
- private static GprofProgramChecker getProgramChecker(IBinaryObject object, IProject project) throws IOException {
- File program = object.getPath().toFile();
- GprofProgramChecker pg = map.get(program);
- if (pg == null) {
- pg = new GprofProgramChecker(program.lastModified());
- STNMFactory.getNM(object.getCPU(), object.getPath().toOSString(), pg, project);
- map.put(program, pg);
- } else {
- long fileTime = program.lastModified();
- if (fileTime > pg.timestamp) {
- pg.timestamp = fileTime;
- pg.mcleanupFound = false;
- pg.mcountFound = false;
- STNMFactory.getNM(object.getCPU(), object.getPath().toOSString(), pg, project);
- }
- }
- return pg;
- }
-
- public static boolean isGProfCompatible(String s, IProject project) throws IOException {
- IBinaryObject object = STSymbolManager.sharedInstance.getBinaryObject(new Path(s));
- if (object == null) return false;
- return isGProfCompatible(object, project);
- }
-
- public static boolean isGProfCompatible(IBinaryObject object, IProject project) throws IOException {
- GprofProgramChecker pg = getProgramChecker(object, project);
- return pg.mcleanupFound && pg.mcountFound;
- }
-
- @Override
- public void foundBssSymbol(String symbol, String address) {
- }
-
- @Override
- public void foundDataSymbol(String symbol, String address) {
- }
-
- @Override
- public void foundTextSymbol(String symbol, String address) {
- if ("mcount".equals(symbol) //$NON-NLS-1$
- || "_mcount".equals(symbol) //$NON-NLS-1$
- || "__mcount".equals(symbol)) //$NON-NLS-1$
- {
- mcountFound = true;
- } else if ("mcleanup".equals(symbol) //$NON-NLS-1$
- || "_mcleanup".equals(symbol) //$NON-NLS-1$
- || "__mcleanup".equals(symbol)) //$NON-NLS-1$
- {
- mcleanupFound = true;
- }
- }
-
- @Override
- public void foundUndefSymbol(String symbol) {
- if (symbol.startsWith("mcount@@GLIBC") //$NON-NLS-1$
- || symbol.startsWith("_mcount@@GLIBC") //$NON-NLS-1$
- || symbol.startsWith("__mcount@@GLIBC")) //$NON-NLS-1$
- {
- mcountFound = true;
- } else if (symbol.startsWith("_mcleanup@@GLIBC") //$NON-NLS-1$
- || symbol.startsWith("mcleanup@@GLIBC") //$NON-NLS-1$
- || symbol.startsWith("__mcleanup@@GLIBC")) //$NON-NLS-1$
- {
- mcleanupFound = true;
- }
- }
-
-}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/LEDataInputStream.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/LEDataInputStream.java
index 653edc0..1eddc1f 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/LEDataInputStream.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/LEDataInputStream.java
@@ -33,53 +33,32 @@
this.in = in;
}
-
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readShort()
- */
@Override
- public final short readShort() throws IOException
- {
+ public final short readShort() throws IOException {
in.readFully(buffer, 0, 2);
return (short)(
(buffer[1]&0xff) << 8 |
(buffer[0]&0xff));
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readUnsignedShort()
- */
@Override
- public final int readUnsignedShort() throws IOException
- {
+ public final int readUnsignedShort() throws IOException {
in.readFully(buffer, 0, 2);
return (
(buffer[1]&0xff) << 8 |
(buffer[0]&0xff));
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readChar()
- */
@Override
- public final char readChar() throws IOException
- {
+ public final char readChar() throws IOException {
in.readFully(buffer, 0, 2);
return (char) (
(buffer[1]&0xff) << 8 |
(buffer[0]&0xff));
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readInt()
- */
@Override
- public final int readInt() throws IOException
- {
+ public final int readInt() throws IOException {
in.readFully(buffer, 0, 4);
return
(buffer[3]) << 24 |
@@ -88,13 +67,8 @@
(buffer[0]&0xff);
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readLong()
- */
@Override
- public final long readLong() throws IOException
- {
+ public final long readLong() throws IOException {
in.readFully(buffer, 0, 8);
return
(long)(buffer[7]) << 56 | /* long cast needed or shift done modulo 32 */
@@ -107,94 +81,52 @@
(long)(buffer[0]&0xff);
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readFloat()
- */
@Override
- public final float readFloat() throws IOException
- {
+ public final float readFloat() throws IOException {
return Float.intBitsToFloat(readInt());
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readDouble()
- */
@Override
- public final double readDouble() throws IOException
- {
+ public final double readDouble() throws IOException {
return Double.longBitsToDouble(readLong());
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readBoolean()
- */
@Override
public boolean readBoolean() throws IOException {
return in.readBoolean();
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readByte()
- */
@Override
public byte readByte() throws IOException {
return in.readByte();
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readFully(byte[])
- */
@Override
public void readFully(byte[] b) throws IOException {
in.readFully(b);
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readFully(byte[], int, int)
- */
@Override
public void readFully(byte[] b, int off, int len) throws IOException {
in.readFully(b,off,len);
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readLine()
- */
@Override
@Deprecated
public String readLine() throws IOException {
return in.readLine();
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readUTF()
- */
@Override
public String readUTF() throws IOException {
return in.readUTF();
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#readUnsignedByte()
- */
@Override
public int readUnsignedByte() throws IOException {
return in.readUnsignedByte();
}
- /*
- * (non-Javadoc)
- * @see java.io.DataInput#skipBytes(int)
- */
@Override
public int skipBytes(int n) throws IOException {
return in.skipBytes(n);
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/PPC64ElfBinaryObjectWrapper.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/PPC64ElfBinaryObjectWrapper.java
index ace81a6..010155b 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/PPC64ElfBinaryObjectWrapper.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/utils/PPC64ElfBinaryObjectWrapper.java
@@ -52,8 +52,9 @@
@Override
public ISymbol[] getSymbols() {
- if (symbols != null)
+ if (symbols != null) {
return symbols;
+ }
symbols = super.getSymbols();
try {
@@ -65,19 +66,22 @@
}
//Failed to load data Section
- if (dataSection == null)
+ if (dataSection == null) {
return symbols;
+ }
LinkedList<ISymbol> list = new LinkedList<>();
- for (ISymbol s : symbols)
+ for (ISymbol s : symbols) {
if (s.getType() == ISymbol.FUNCTION && s instanceof Symbol){
IAddress addr = fixAddr(s.getAddress());
- if (addr == null)
+ if (addr == null) {
addr = s.getAddress();
+ }
list.add(new Symbol((BinaryObjectAdapter)s.getBinaryObject(), s.getName(), s.getType(), addr, s.getSize()));
} else {
list.add(s);
}
+ }
symbols = list.toArray(new Symbol[0]);
Arrays.sort(symbols);
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/FlatHistogramContentProvider.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/FlatHistogramContentProvider.java
index 760d1fa..6e19c48 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/FlatHistogramContentProvider.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/FlatHistogramContentProvider.java
@@ -22,10 +22,10 @@
*
* @author Xavier Raynaud <xavier.raynaud@st.com>
*/
-public class FlatHistogramContentProvider extends FunctionHistogramContentProvider {
-
+public final class FlatHistogramContentProvider extends FunctionHistogramContentProvider {
+
public static final FlatHistogramContentProvider sharedInstance = new FlatHistogramContentProvider();
-
+
/**
* Constructor
*/
@@ -46,7 +46,7 @@
}
return ret;
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.linuxtools.internal.gprof.view.FunctionHistogramContentProvider#getParent(java.lang.Object)
@@ -59,5 +59,5 @@
}
return o;
}
-
+
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonView.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonView.java
index 8646d6b..4cbf1d5 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonView.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonView.java
@@ -220,7 +220,7 @@
+ " timestamp: " + decoder.getGmonFileTimeStamp(); //$NON-NLS-1$
HistogramDecoder histo = decoder.getHistogramDecoder();
if (histo.hasValues()) {
- double prof_rate = histo.getProf_rate();
+ double prof_rate = histo.getProfRate();
String period = ""; //$NON-NLS-1$
if (prof_rate != 0) {
char tUnit = histo.getTimeDimension();
@@ -287,7 +287,7 @@
}
gmonview = (GmonView) page.showView(ID, secondary_id_usually_path_to_gmon_file,
IWorkbenchPage.VIEW_ACTIVATE);
- if (decoder.getHistogramDecoder().getProf_rate() == 0) {
+ if (decoder.getHistogramDecoder().getProfRate() == 0) {
gmonview.switchSampleTime.setToolTipText("Unable to display time, because profiling rate is null"); //$NON-NLS-1$
gmonview.switchSampleTime.setEnabled(false);
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonViewer.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonViewer.java
index ddcaf38..020428b 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonViewer.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/GmonViewer.java
@@ -46,10 +46,6 @@
super(parent);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTTreeViewer#createViewer(org.eclipse.swt.widgets.Composite, int)
- */
@Override
protected TreeViewer createViewer(Composite parent, int style) {
TreeViewer tv = super.createViewer(parent, style);
@@ -81,11 +77,6 @@
return Activator.getDefault().getDialogSettings();
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTViewer#handleOpenEvent(org.eclipse.jface.viewers.OpenEvent)
- */
@Override
protected void handleOpenEvent(OpenEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
@@ -94,9 +85,8 @@
String s = element.getSourcePath();
if (s == null || "??".equals(s)) { //$NON-NLS-1$
return; // nothing to do here.
- }
- else {
- int lineNumber = element.getSourceLine();
+ } else {
+ int lineNumber = element.getSourceLine();
IBinaryObject exec = ((HistRoot)element.getRoot()).decoder.getProgram();
STLink2SourceSupport.sharedInstance.openSourceFileAtLocation(exec, s, lineNumber);
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/CallsProfField.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/CallsProfField.java
index fceb12d..513bad3 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/CallsProfField.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/CallsProfField.java
@@ -28,12 +28,6 @@
*/
public class CallsProfField extends AbstractSTDataViewersField implements IChartField {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.ISTDataViewersField#compare(java.lang.Object,
- * java.lang.Object)
- */
@Override
public int compare(Object obj1, Object obj2) {
TreeElement e1 = (TreeElement) obj1;
@@ -43,32 +37,16 @@
return s1 - s2;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.ISTDataViewersField#getColumnHeaderText()
- */
@Override
public String getColumnHeaderText() {
return Messages.CallsProfField_CALLS;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTDataViewersField#getColumnHeaderTooltip()
- */
@Override
public String getColumnHeaderTooltip() {
return null;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTDataViewersField#getToolTipText(java.lang.Object)
- */
@Override
public String getToolTipText(Object element) {
if (element instanceof HistRoot) {
@@ -103,11 +81,6 @@
return null;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.ISTDataViewersField#getValue(java.lang.Object)
- */
@Override
public String getValue(Object obj) {
TreeElement e = (TreeElement) obj;
@@ -118,12 +91,6 @@
return ret;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTDataViewersField#getBackground(java.lang.Object)
- */
@Override
public Color getBackground(Object element) {
return GmonView.getBackground(element);
@@ -133,8 +100,9 @@
public Number getNumber(Object obj) {
TreeElement e = (TreeElement) obj;
int i = e.getCalls();
- if (i == -1)
+ if (i == -1) {
return 0L;
+ }
return i;
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/NameProfField.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/NameProfField.java
index 35dfd7a..ab756d5 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/NameProfField.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/NameProfField.java
@@ -23,80 +23,56 @@
*/
public class NameProfField extends AbstractSTDataViewersField {
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.ISTDataViewersField#compare(java.lang.Object, java.lang.Object)
- */
- @Override
- public int compare(Object obj1, Object obj2) {
- TreeElement e1 = (TreeElement) obj1;
- TreeElement e2 = (TreeElement) obj2;
- String s1 = e1.getName();
- String s2 = e2.getName();
- if (s1 == null) {
- if (s2 == null) return 0;
- return -1;
- }
- if (s2 == null) return 1;
- return s1.compareTo(s2);
- }
+ @Override
+ public int compare(Object obj1, Object obj2) {
+ TreeElement e1 = (TreeElement) obj1;
+ TreeElement e2 = (TreeElement) obj2;
+ String s1 = e1.getName();
+ String s2 = e2.getName();
+ if (s1 == null) {
+ if (s2 == null) return 0;
+ return -1;
+ }
+ if (s2 == null) return 1;
+ return s1.compareTo(s2);
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.ISTDataViewersField#getColumnHeaderText()
- */
- @Override
- public String getColumnHeaderText() {
- return Messages.NameProfField_NAME_AND_LOCATION;
- }
+ @Override
+ public String getColumnHeaderText() {
+ return Messages.NameProfField_NAME_AND_LOCATION;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.ISTDataViewersField#getValue(java.lang.Object)
- */
- @Override
- public String getValue(Object obj) {
- if (obj instanceof TreeElement) {
- TreeElement e = (TreeElement) obj;
- return e.getName();
- }
- return ""; //$NON-NLS-1$
- }
+ @Override
+ public String getValue(Object obj) {
+ if (obj instanceof TreeElement) {
+ TreeElement e = (TreeElement) obj;
+ return e.getName();
+ }
+ return ""; //$NON-NLS-1$
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTDataViewersField#getBackground(java.lang.Object)
- */
- @Override
- public Color getBackground(Object element) {
- return GmonView.getBackground(element);
- }
+ @Override
+ public Color getBackground(Object element) {
+ return GmonView.getBackground(element);
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTDataViewersField#getToolTipText(java.lang.Object)
- */
- @Override
- public String getToolTipText(Object element) {
- TreeElement elem = (TreeElement) element;
- String s = elem.getSourcePath();
- if (s != null && !"??".equals(s)) { //$NON-NLS-1$
- int lineNumber = elem.getSourceLine();
- if (lineNumber > 0) {
- return s + ":" + lineNumber; //$NON-NLS-1$
- }
- return s;
- }
- return null;
- }
+ @Override
+ public String getToolTipText(Object element) {
+ TreeElement elem = (TreeElement) element;
+ String s = elem.getSourcePath();
+ if (s != null && !"??".equals(s)) { //$NON-NLS-1$
+ int lineNumber = elem.getSourceLine();
+ if (lineNumber > 0) {
+ return s + ":" + lineNumber; //$NON-NLS-1$
+ }
+ return s;
+ }
+ return null;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTDataViewersField#getPreferredWidth()
- */
- @Override
- public int getPreferredWidth() {
- return 250;
- }
+ @Override
+ public int getPreferredWidth() {
+ return 250;
+ }
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/RatioProfField.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/RatioProfField.java
index cd40b60..16d7714 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/RatioProfField.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/RatioProfField.java
@@ -26,72 +26,53 @@
* @author Mohamed Korbosli
*/
public class RatioProfField extends AbstractPercentageDrawerField implements IChartField{
-
- /** Format to use to display percentages */
- public final static NumberFormat nf = new DecimalFormat("##0.0#"); //$NON-NLS-1$
-
-
- /**
- * Gets the percentage value to display
- * @param obj
- * @return the percentage value to display, as a float
- */
- @Override
- public float getPercentage(Object obj) {
- TreeElement e = (TreeElement) obj;
- int SamplesSum = e.getRoot().getSamples();
- if (SamplesSum == 0) return 0;
- else return ((100.0f*e.getSamples())/e.getRoot().getSamples());
- }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.ISTDataViewersField#compare(java.lang.Object, java.lang.Object)
- */
- @Override
- public int compare(Object obj1, Object obj2) {
- TreeElement e1 = (TreeElement) obj1;
- TreeElement e2 = (TreeElement) obj2;
- int s1 = e1.getSamples();
- int s2 = e2.getSamples();
- return s1 - s2;
- }
+ /** Format to use to display percentages */
+ public final static NumberFormat nf = new DecimalFormat("##0.0#"); //$NON-NLS-1$
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.ISTDataViewersField#getColumnHeaderText()
- */
- @Override
- public String getColumnHeaderText() {
- return Messages.RatioProfField_TIME_PERCENTAGE;
- }
+ /**
+ * Gets the percentage value to display
+ * @param obj
+ * @return the percentage value to display, as a float
+ */
+ @Override
+ public float getPercentage(Object obj) {
+ TreeElement e = (TreeElement) obj;
+ int SamplesSum = e.getRoot().getSamples();
+ if (SamplesSum == 0) {
+ return 0;
+ }
+ else return ((100.0f*e.getSamples())/e.getRoot().getSamples());
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractPercentageDrawerField#getNumberFormat()
- */
- @Override
- public NumberFormat getNumberFormat() {
- return nf;
- }
+ @Override
+ public int compare(Object obj1, Object obj2) {
+ TreeElement e1 = (TreeElement) obj1;
+ TreeElement e2 = (TreeElement) obj2;
+ int s1 = e1.getSamples();
+ int s2 = e2.getSamples();
+ return s1 - s2;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractPercentageDrawerField#isSettedNumberFormat()
- */
- @Override
- public boolean isSettedNumberFormat() {
- return true;
- }
+ @Override
+ public String getColumnHeaderText() {
+ return Messages.RatioProfField_TIME_PERCENTAGE;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.charts.provider.IChartField#getNumber(java.lang.Object)
- */
- @Override
- public Number getNumber(Object obj) {
- float f = getPercentage(obj);
- return new Float(f);
- }
+ @Override
+ public NumberFormat getNumberFormat() {
+ return nf;
+ }
+
+ @Override
+ public boolean isSettedNumberFormat() {
+ return true;
+ }
+
+ @Override
+ public Number getNumber(Object obj) {
+ float f = getPercentage(obj);
+ return new Float(f);
+ }
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/SamplePerCallField.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/SamplePerCallField.java
index 0d2d5b2..24be130 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/SamplePerCallField.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/SamplePerCallField.java
@@ -24,92 +24,84 @@
*/
public class SamplePerCallField extends SampleProfField {
- /**
- * Constructor
- * @param viewer the gmon viewer
- */
- public SamplePerCallField(AbstractSTTreeViewer viewer) {
- super(viewer);
- }
+ /**
+ * Constructor
+ * @param viewer the gmon viewer
+ */
+ public SamplePerCallField(AbstractSTTreeViewer viewer) {
+ super(viewer);
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.fields.SampleProfField#compare(java.lang.Object, java.lang.Object)
- */
- @Override
- public int compare(Object obj1, Object obj2) {
- TreeElement e1 = (TreeElement) obj1;
- TreeElement e2 = (TreeElement) obj2;
- int c1 = e1.getCalls();
- int c2 = e2.getCalls();
- if ((c1 == 0 || c1 == -1) && (c2 == 0 || c2 == -1)) return 0;
- if (c1 == 0 || c1 == -1) return -1;
- if (c2 == 0 || c2 == -1) return 1;
- float f1 = (float)e1.getSamples()/(float)c1;
- float f2 = (float)e2.getSamples()/(float)c2;
- return Float.compare(f1, f2);
- }
+ @Override
+ public int compare(Object obj1, Object obj2) {
+ TreeElement e1 = (TreeElement) obj1;
+ TreeElement e2 = (TreeElement) obj2;
+ int c1 = e1.getCalls();
+ int c2 = e2.getCalls();
+ if ((c1 == 0 || c1 == -1) && (c2 == 0 || c2 == -1)) {
+ return 0;
+ }
+ if (c1 == 0 || c1 == -1) {
+ return -1;
+ }
+ if (c2 == 0 || c2 == -1) {
+ return 1;
+ }
+ float f1 = (float)e1.getSamples()/(float)c1;
+ float f2 = (float)e2.getSamples()/(float)c2;
+ return Float.compare(f1, f2);
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.fields.SampleProfField#getColumnHeaderText()
- */
- @Override
- public String getColumnHeaderText() {
- return Messages.SamplePerCallField_TIME_CALL;
- }
+ @Override
+ public String getColumnHeaderText() {
+ return Messages.SamplePerCallField_TIME_CALL;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.fields.SampleProfField#getColumnHeaderTooltip()
- */
- @Override
- public String getColumnHeaderTooltip() {
- return Messages.SamplePerCallField_TIME_CALL_TOOLTIP;
- }
+ @Override
+ public String getColumnHeaderTooltip() {
+ return Messages.SamplePerCallField_TIME_CALL_TOOLTIP;
+ }
+ @Override
+ public String getValue(Object obj) {
+ TreeElement e = (TreeElement) obj;
+ int i = e.getSamples();
+ int j = e.getCalls();
+ if (i == -1 || j <= 0) {
+ return ""; //$NON-NLS-1$
+ }
+ float k = (float)i/(float)j;
+ double prof_rate = getProfRate();
+ if(prof_rate != 0){
+ return getValue(k, prof_rate);
+ }else {
+ return ""; //$NON-NLS-1$
+ }
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.fields.SampleProfField#getValue(java.lang.Object)
- */
- @Override
- public String getValue(Object obj) {
- TreeElement e = (TreeElement) obj;
- int i = e.getSamples();
- int j = e.getCalls();
- if (i == -1 || j <= 0) return ""; //$NON-NLS-1$
- float k = (float)i/(float)j;
+ @Override
+ public Color getBackground(Object element) {
+ return GmonView.getBackground(element);
+ }
- double prof_rate = getProfRate();
- if(prof_rate != 0){
- return getValue(k, prof_rate);
- }else return ""; //$NON-NLS-1$
- }
+ @Override
+ public Number getNumber(Object obj) {
+ TreeElement e = (TreeElement) obj;
+ int i = e.getSamples();
+ int j = e.getCalls();
+ if (i == -1 || j <= 0) {
+ return 0L;
+ }
+ float k = (float)i/(float)j;
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.fields.SampleProfField#getBackground(java.lang.Object)
- */
- @Override
- public Color getBackground(Object element) {
- return GmonView.getBackground(element);
- }
+ double prof_rate = getProfRate();
+ if(prof_rate != 0){
+ return k/prof_rate;
+ } else {
+ return 0L;
+ }
+ }
- @Override
- public Number getNumber(Object obj) {
- TreeElement e = (TreeElement) obj;
- int i = e.getSamples();
- int j = e.getCalls();
- if (i == -1 || j <= 0) return 0L;
- float k = (float)i/(float)j;
-
- double prof_rate = getProfRate();
- if(prof_rate != 0){
- return k/prof_rate;
- }else return 0L;
- }
-
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/SampleProfField.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/SampleProfField.java
index 6a28afc..a55472e 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/SampleProfField.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/fields/SampleProfField.java
@@ -35,7 +35,7 @@
private boolean samples = true;
protected final AbstractSTTreeViewer viewer;
protected final static double UNINITIALIZED = 0;
-
+
/**
* Constructor
* @param viewer the gmon viewer
@@ -43,11 +43,7 @@
public SampleProfField(AbstractSTTreeViewer viewer) {
this.viewer = viewer;
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.ISTDataViewersField#compare(java.lang.Object, java.lang.Object)
- */
+
@Override
public int compare(Object obj1, Object obj2) {
TreeElement e1 = (TreeElement) obj1;
@@ -57,20 +53,14 @@
return s1 - s2;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.ISTDataViewersField#getColumnHeaderText()
- */
@Override
public String getColumnHeaderText() {
- if (samples) return Messages.SampleProfField_SAMPLE_HDR;
+ if (samples) {
+ return Messages.SampleProfField_SAMPLE_HDR;
+ }
return Messages.SampleProfField_TIME_HDR;
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTDataViewersField#getColumnHeaderTooltip()
- */
+
@Override
public String getColumnHeaderTooltip() {
return null;
@@ -84,61 +74,75 @@
public String getValue(Object obj) {
TreeElement e = (TreeElement) obj;
int i = e.getSamples();
- if (i == -1) return ""; //$NON-NLS-1$
+ if (i == -1) {
+ return ""; //$NON-NLS-1$
+ }
if (samples) {
return String.valueOf(i);
} else {
double prof_rate = getProfRate();
- if (prof_rate == UNINITIALIZED) return "?"; //$NON-NLS-1$
+ if (prof_rate == UNINITIALIZED) {
+ return "?"; //$NON-NLS-1$
+ }
return getValue(i, prof_rate);
}
}
-
+
/**
* Get the time value with the best unit display
* @param i nbr of samples
- * @param prof_rate profiling frequency
+ * @param profRate profiling frequency
* @return time value with the best adapted time unit
*/
public static String getValue(double i, double prof_rate)
{
long timeInNs = (long) (i/prof_rate);
long ns = timeInNs%1000;
-
+
long timeInUs = timeInNs/1000;
- if (timeInUs == 0) return ns + "ns"; //$NON-NLS-1$
+ if (timeInUs == 0) {
+ return ns + "ns"; //$NON-NLS-1$
+ }
long us = timeInUs%1000;
-
+
long timeInMs = timeInUs/1000;
if (timeInMs == 0) {
String ns_s = "" + ns; //$NON-NLS-1$
- while (ns_s.length() < 3) ns_s = "0" + ns_s; //$NON-NLS-1$
+ while (ns_s.length() < 3) {
+ ns_s = "0" + ns_s; //$NON-NLS-1$
+ }
return us + "." + ns_s + "us"; //$NON-NLS-1$ //$NON-NLS-2$
}
long ms = timeInMs%1000;
-
+
long timeInS = timeInMs/1000;
if (timeInS == 0) {
String us_s = "" + us; //$NON-NLS-1$
- while (us_s.length() < 3) us_s = "0" + us_s; //$NON-NLS-1$
+ while (us_s.length() < 3) {
+ us_s = "0" + us_s; //$NON-NLS-1$
+ }
return ms + "." + us_s + "ms"; //$NON-NLS-1$ //$NON-NLS-2$
}
long s = timeInS%60;
-
+
long timeInMin = timeInS/60;
if (timeInMin == 0) {
String ms_s = "" + ms; //$NON-NLS-1$
- while (ms_s.length() < 3) ms_s = "0" + ms_s; //$NON-NLS-1$
+ while (ms_s.length() < 3) {
+ ms_s = "0" + ms_s; //$NON-NLS-1$
+ }
return s + "." + ms_s + "s"; //$NON-NLS-1$ //$NON-NLS-2$
}
long min = timeInMin%60;
-
+
long timeInHour = timeInMin/60;
- if (timeInHour == 0) return min + "min " + s + "s"; //$NON-NLS-1$ //$NON-NLS-2$
-
+ if (timeInHour == 0) {
+ return min + "min " + s + "s"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
return timeInHour + "h " + min + "min"; //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
protected double getProfRate() {
double prof_rate = UNINITIALIZED;
@@ -146,7 +150,7 @@
if (o instanceof GmonDecoder) {
GmonDecoder decoder = (GmonDecoder) o;
HistogramDecoder histo = decoder.getHistogramDecoder();
- prof_rate = histo.getProf_rate();
+ prof_rate = histo.getProfRate();
char tUnit = histo.getTimeDimension();
switch (tUnit) {
case 's': prof_rate /= 1000000000; break;
@@ -157,19 +161,11 @@
return prof_rate;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTDataViewersField#getBackground(java.lang.Object)
- */
@Override
public Color getBackground(Object element) {
return GmonView.getBackground(element);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTDataViewersField#getToolTipText(java.lang.Object)
- */
@Override
public String getToolTipText(Object element) {
if (element instanceof HistRoot) {
@@ -195,7 +191,9 @@
public Number getNumber(Object obj) {
TreeElement e = (TreeElement) obj;
int i = e.getSamples();
- if (i == -1) return 0L;
+ if (i == -1) {
+ return 0L;
+ }
return i;
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/AbstractTreeElement.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/AbstractTreeElement.java
index f028dea..88148bf 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/AbstractTreeElement.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/AbstractTreeElement.java
@@ -21,8 +21,7 @@
private final TreeElement parent;
protected int samples = -1;
protected int calls = -1;
-
-
+
/**
* Constructor
* @param parent
@@ -49,27 +48,21 @@
public boolean hasChildren() {
return true;
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getCalls()
- */
+
@Override
public int getCalls() {
if (calls == -1) {
calls = 0;
for (TreeElement elem : getChildren()) {
int i = elem.getCalls();
- if (i != -1) calls += elem.getCalls();
+ if (i != -1) {
+ calls += elem.getCalls();
+ }
}
}
return calls;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getSamples()
- */
@Override
public int getSamples() {
if (samples == -1) {
@@ -81,32 +74,25 @@
return samples;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getSourceLine()
- */
@Override
public int getSourceLine() {
return 0;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getSourcePath()
- */
@Override
public String getSourcePath() {
return null;
}
- /*
+ /*
* (non-Javadoc)
* @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getRoot()
*/
@Override
public TreeElement getRoot() {
- if (parent == null) return this;
+ if (parent == null) {
+ return this;
+ }
return parent.getRoot();
}
-
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/CGArc.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/CGArc.java
index d1f6339..cc8273a 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/CGArc.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/CGArc.java
@@ -25,119 +25,91 @@
*/
public class CGArc extends AbstractTreeElement {
- /** The displayed arc - or function call */
- public final CallGraphArc arc;
-
- /**
- * Constructor
- * @param cat the parent category of this tree node
- * @param arc the object to display in the tree
- */
- public CGArc(CGCategory cat, CallGraphArc arc) {
- super(cat);
- this.arc = arc;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getChildren()
- */
- @Override
- public LinkedList<? extends TreeElement> getChildren() {
- return null;
- }
+ /** The displayed arc - or function call */
+ public final CallGraphArc arc;
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#hasChildren()
- */
- @Override
- public boolean hasChildren() {
- return false;
- }
+ /**
+ * Constructor
+ * @param cat the parent category of this tree node
+ * @param arc the object to display in the tree
+ */
+ public CGArc(CGCategory cat, CallGraphArc arc) {
+ super(cat);
+ this.arc = arc;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getCalls()
- */
- @Override
- public int getCalls() {
- return arc.getCount();
- }
+ @Override
+ public LinkedList<? extends TreeElement> getChildren() {
+ return null;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSamples()
- */
- @Override
- public int getSamples() {
- Object o = this.getParent();
- CGCategory category = (CGCategory) o;
- ISymbol symbol;
- if (CGCategory.CHILDREN.equals(category.category)) {
- symbol = arc.child.getSymbol();
- } else {
- symbol = arc.parent.getSymbol();
- }
- return HistFunction.getSamples(symbol);
- }
+ @Override
+ public boolean hasChildren() {
+ return false;
+ }
- public String getFunctionName() {
- Object o = this.getParent();
- CGCategory category = (CGCategory) o;
- ISymbol symbol;
- if (CGCategory.CHILDREN.equals(category.category)) {
- symbol = arc.child.getSymbol();
- } else {
- symbol = arc.parent.getSymbol();
- }
- String functionName = STSymbolManager.sharedInstance.demangle(symbol, arc.getProject());
- return functionName;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getName()
- */
- @Override
- public String getName() {
- String functionName = getFunctionName();
- Path p = new Path(getSourcePath());
- return functionName + " (" + p.lastSegment() + ":" + getSourceLine() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
+ @Override
+ public int getCalls() {
+ return arc.getCount();
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSourceLine()
- */
- @Override
- public int getSourceLine() {
- Object o = this.getParent();
- CGCategory category = (CGCategory) o;
- if (CGCategory.CHILDREN.equals(category.category)) {
- ISymbol symbol = arc.child.getSymbol();
- return STSymbolManager.sharedInstance.getLineNumber(symbol, arc.getProject());
- } else {
- return arc.parentLine;
- }
- }
+ @Override
+ public int getSamples() {
+ Object o = this.getParent();
+ CGCategory category = (CGCategory) o;
+ ISymbol symbol;
+ if (CGCategory.CHILDREN.equals(category.category)) {
+ symbol = arc.child.getSymbol();
+ } else {
+ symbol = arc.parent.getSymbol();
+ }
+ return HistFunction.getSamples(symbol);
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSourcePath()
- */
- @Override
- public String getSourcePath() {
- Object o = this.getParent();
- CGCategory category = (CGCategory) o;
- if (CGCategory.CHILDREN.equals(category.category)) {
- ISymbol symbol = arc.child.getSymbol();
- String fileName = ((HistRoot)getRoot()).decoder.getFileName(symbol);
- return fileName;
- } else {
- if (arc.parentPath == null) return "??"; //$NON-NLS-1$
- return arc.parentPath;
- }
- }
+ public String getFunctionName() {
+ Object o = this.getParent();
+ CGCategory category = (CGCategory) o;
+ ISymbol symbol;
+ if (CGCategory.CHILDREN.equals(category.category)) {
+ symbol = arc.child.getSymbol();
+ } else {
+ symbol = arc.parent.getSymbol();
+ }
+ return STSymbolManager.sharedInstance.demangle(symbol, arc.getProject());
+ }
+
+ @Override
+ public String getName() {
+ String functionName = getFunctionName();
+ Path p = new Path(getSourcePath());
+ return functionName + " (" + p.lastSegment() + ":" + getSourceLine() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ @Override
+ public int getSourceLine() {
+ Object o = this.getParent();
+ CGCategory category = (CGCategory) o;
+ if (CGCategory.CHILDREN.equals(category.category)) {
+ ISymbol symbol = arc.child.getSymbol();
+ return STSymbolManager.sharedInstance.getLineNumber(symbol, arc.getProject());
+ } else {
+ return arc.parentLine;
+ }
+ }
+
+ @Override
+ public String getSourcePath() {
+ Object o = this.getParent();
+ CGCategory category = (CGCategory) o;
+ if (CGCategory.CHILDREN.equals(category.category)) {
+ ISymbol symbol = arc.child.getSymbol();
+ return ((HistRoot)getRoot()).decoder.getFileName(symbol);
+ } else {
+ if (arc.parentPath == null) {
+ return "??"; //$NON-NLS-1$
+ }
+ return arc.parentPath;
+ }
+ }
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/CGCategory.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/CGCategory.java
index d5d4084..13f1205 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/CGCategory.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/CGCategory.java
@@ -45,21 +45,11 @@
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getChildren()
- */
@Override
public LinkedList<? extends TreeElement> getChildren() {
return children;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getName()
- */
@Override
public String getName() {
return category;
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistBucket.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistBucket.java
index 046e257..8094bd1 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistBucket.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistBucket.java
@@ -23,7 +23,7 @@
public class HistBucket extends AbstractTreeElement {
public final Bucket bucket;
-
+
/**
* Constructor
* @param parent the parent of this tree node
@@ -33,45 +33,27 @@
super(parent);
this.bucket = b;
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#hasChildren()
- */
@Override
public boolean hasChildren() {
return false;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getChildren()
- */
@Override
public LinkedList<? extends TreeElement> getChildren() {
return null;
}
-
@Override
public int getCalls() {
return -1;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getName()
- */
@Override
public String getName() {
- return "0x" + Long.toHexString(bucket.start_addr); //$NON-NLS-1$
+ return "0x" + Long.toHexString(bucket.startAddr); //$NON-NLS-1$
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSamples()
- */
@Override
public int getSamples() {
return bucket.time;
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistFile.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistFile.java
index e834dee..0dfb094 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistFile.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistFile.java
@@ -26,91 +26,72 @@
*/
public class HistFile extends AbstractTreeElement {
- /** The source path to display */
- public final String sourcePath;
- private final LinkedList<HistFunction> children = new LinkedList<>();
-
- /**
- * Constructor
- * @param parent
- * @param path
- */
- public HistFile(HistRoot parent, String path) {
- super(parent);
- this.sourcePath = path;
- }
-
- /**
- * Gets the tree item corresponding to the given function.
- * Lazily create it if needed.
- * @param s
- * @return a {@link HistFunction}
- */
- private HistFunction getChild(ISymbol s) {
- for (HistFunction f : this.children) {
- if (f.symbol == s) return f;
- }
- HistFunction f = new HistFunction(this, s);
- this.children.add(f);
- return f;
- }
-
- void addBucket(Bucket b, ISymbol s, IBinaryObject program) {
- HistFunction hf = getChild(s);
- hf.addBucket(b, program);
- }
+ /** The source path to display */
+ public final String sourcePath;
+ private final LinkedList<HistFunction> children = new LinkedList<>();
- void addCallGraphNode(CallGraphNode node) {
- ISymbol s = node.getSymbol();
- HistFunction hf = getChild(s);
- hf.addCallGraphNode(node);
- }
+ /**
+ * Constructor
+ * @param parent
+ * @param path
+ */
+ public HistFile(HistRoot parent, String path) {
+ super(parent);
+ this.sourcePath = path;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getChildren()
- */
- @Override
- public LinkedList<? extends TreeElement> getChildren() {
- return this.children;
- }
+ /**
+ * Gets the tree item corresponding to the given function.
+ * Lazily create it if needed.
+ * @param s
+ * @return a {@link HistFunction}
+ */
+ private HistFunction getChild(ISymbol s) {
+ for (HistFunction f : this.children) {
+ if (f.symbol == s) {
+ return f;
+ }
+ }
+ HistFunction f = new HistFunction(this, s);
+ this.children.add(f);
+ return f;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getName()
- */
- @Override
- public String getName() {
- Path f = new Path(sourcePath);
- return f.lastSegment();
- }
+ void addBucket(Bucket b, ISymbol s, IBinaryObject program) {
+ HistFunction hf = getChild(s);
+ hf.addBucket(b, program);
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSourceLine()
- */
- @Override
- public int getSourceLine() {
- return 0;
- }
+ void addCallGraphNode(CallGraphNode node) {
+ ISymbol s = node.getSymbol();
+ HistFunction hf = getChild(s);
+ hf.addCallGraphNode(node);
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSourcePath()
- */
- @Override
- public String getSourcePath() {
- return this.sourcePath;
- }
-
+ @Override
+ public LinkedList<? extends TreeElement> getChildren() {
+ return this.children;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getCalls()
- */
- @Override
- public int getCalls() {
- return -1;
- }
+ @Override
+ public String getName() {
+ Path f = new Path(sourcePath);
+ return f.lastSegment();
+ }
+
+ @Override
+ public int getSourceLine() {
+ return 0;
+ }
+
+ @Override
+ public String getSourcePath() {
+ return this.sourcePath;
+ }
+
+ @Override
+ public int getCalls() {
+ return -1;
+ }
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistFunction.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistFunction.java
index ceda474..88e5d7a 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistFunction.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistFunction.java
@@ -29,132 +29,116 @@
*/
public class HistFunction extends AbstractTreeElement {
- /** The sympbol to display */
- public final ISymbol symbol;
- private final LinkedList<HistLine> children = new LinkedList<>();
- private CGCategory parentsFunctions;
- private CGCategory childrenFunctions;
-
- private static HashMap<ISymbol, Integer> histSym = new HashMap<>();
-
- /**
- * Constructor
- * @param parent
- * @param s
- */
- public HistFunction(HistFile parent, ISymbol s) {
- super(parent);
- this.symbol = s;
- histSym.put(s, 0);
- }
-
- /**
- * Gets the tree item corresponding to the given line.
- * Lazily create it if needed.
- * @param line
- * @return a {@link HistFunction}
- */
- private HistLine getChild(int line) {
- for (HistLine l : this.children) {
- if (l.line == line) return l;
- }
- HistLine l = new HistLine(this, line);
- this.children.add(l);
- return l;
- }
-
+ /** The sympbol to display */
+ public final ISymbol symbol;
+ private final LinkedList<HistLine> children = new LinkedList<>();
+ private CGCategory parentsFunctions;
+ private CGCategory childrenFunctions;
- void addBucket(Bucket b, IBinaryObject program) {
- int lineNumber = -1;
- IAddress address = program.getAddressFactory().createAddress(String.valueOf(b.start_addr));
- lineNumber = STSymbolManager.sharedInstance.getLineNumber(program, address, getProject());
- HistLine hf = getChild(lineNumber);
- hf.addBucket(b);
- histSym.put(symbol, b.time + histSym.get(symbol));
- }
+ private static HashMap<ISymbol, Integer> histSym = new HashMap<>();
- void addCallGraphNode(CallGraphNode node) {
- LinkedList<CallGraphArc> parents = node.getParents();
- LinkedList<CallGraphArc> children = node.getChildren();
- if (parents.size() != 0) {
- this.parentsFunctions = new CGCategory(this, CGCategory.PARENTS, node.getParents());
- }
- if (children.size() != 0) {
- this.childrenFunctions = new CGCategory(this, CGCategory.CHILDREN, node.getChildren());
- }
- this.calls = node.getCalls();
- }
+ /**
+ * Constructor
+ * @param parent
+ * @param s
+ */
+ public HistFunction(HistFile parent, ISymbol s) {
+ super(parent);
+ this.symbol = s;
+ histSym.put(s, 0);
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getChildren()
- */
- @Override
- public LinkedList<? extends TreeElement> getChildren() {
- return this.children;
- }
+ /**
+ * Gets the tree item corresponding to the given line.
+ * Lazily create it if needed.
+ * @param line
+ * @return a {@link HistFunction}
+ */
+ private HistLine getChild(int line) {
+ for (HistLine l : this.children) {
+ if (l.line == line) {
+ return l;
+ }
+ }
+ HistLine l = new HistLine(this, line);
+ this.children.add(l);
+ return l;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getCalls()
- */
- @Override
- public int getCalls() {
- return this.calls;
- }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getName()
- */
- @Override
- public String getName() {
- return STSymbolManager.sharedInstance.demangle(this.symbol, getProject());
- }
+ void addBucket(Bucket b, IBinaryObject program) {
+ int lineNumber = -1;
+ IAddress address = program.getAddressFactory().createAddress(String.valueOf(b.startAddr));
+ lineNumber = STSymbolManager.sharedInstance.getLineNumber(program, address, getProject());
+ HistLine hf = getChild(lineNumber);
+ hf.addBucket(b);
+ histSym.put(symbol, b.time + histSym.get(symbol));
+ }
- /**
- * @return the parentsFunctions
- */
- public CGCategory getParentsFunctions() {
- return parentsFunctions;
- }
+ void addCallGraphNode(CallGraphNode node) {
+ LinkedList<CallGraphArc> parents = node.getParents();
+ LinkedList<CallGraphArc> children = node.getChildren();
+ if (parents.size() != 0) {
+ this.parentsFunctions = new CGCategory(this, CGCategory.PARENTS, node.getParents());
+ }
+ if (children.size() != 0) {
+ this.childrenFunctions = new CGCategory(this, CGCategory.CHILDREN, node.getChildren());
+ }
+ this.calls = node.getCalls();
+ }
- /**
- * @return the childrenFunctions
- */
- public CGCategory getChildrenFunctions() {
- return childrenFunctions;
- }
+ @Override
+ public LinkedList<? extends TreeElement> getChildren() {
+ return this.children;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSourceLine()
- */
- @Override
- public int getSourceLine() {
- return STSymbolManager.sharedInstance.getLineNumber(symbol, getProject());
- }
+ @Override
+ public int getCalls() {
+ return this.calls;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSourcePath()
- */
- @Override
- public String getSourcePath() {
- return ((HistRoot)getRoot()).decoder.getFileName(symbol);
- }
-
- /**
- * @return the function samples
- */
- public static int getSamples(ISymbol sym){
- if (histSym.containsKey(sym))
- return histSym.get(sym);
- else return 0;
- }
+ @Override
+ public String getName() {
+ return STSymbolManager.sharedInstance.demangle(this.symbol, getProject());
+ }
- private IProject getProject() {
- return ((HistRoot)getParent().getParent()).getProject();
- }
+ /**
+ * @return the parentsFunctions
+ */
+ public CGCategory getParentsFunctions() {
+ return parentsFunctions;
+ }
+
+ /**
+ * @return the childrenFunctions
+ */
+ public CGCategory getChildrenFunctions() {
+ return childrenFunctions;
+ }
+
+ @Override
+ public int getSourceLine() {
+ return STSymbolManager.sharedInstance.getLineNumber(symbol, getProject());
+ }
+
+ @Override
+ public String getSourcePath() {
+ return ((HistRoot)getRoot()).decoder.getFileName(symbol);
+ }
+
+ /**
+ * @return the function samples
+ */
+ public static int getSamples(ISymbol sym){
+ if (histSym.containsKey(sym)) {
+ return histSym.get(sym);
+ } else {
+ return 0;
+ }
+ }
+
+ private IProject getProject() {
+ return ((HistRoot)getParent().getParent()).getProject();
+ }
}
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistLine.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistLine.java
index a050ace..6dd2b14 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistLine.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistLine.java
@@ -22,12 +22,11 @@
*/
public class HistLine extends AbstractTreeElement {
-
public final int line;
private final LinkedList<HistBucket> children = new LinkedList<>();
/**
- * Constructor
+ * Constructor
* @param parent
* @param lineNumber
*/
@@ -40,38 +39,22 @@
this.children.add(new HistBucket(this,b));
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getChildren()
- */
@Override
public LinkedList<? extends TreeElement> getChildren() {
return this.children;
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getCalls()
- */
+
@Override
public int getCalls() {
return -1;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getName()
- */
@Override
public String getName() {
String functionName = getParent().getName();
return functionName + " (" + getParent().getParent().getName() + ":" + this.line + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSamples()
- */
@Override
public int getSamples() {
int ret = 0;
@@ -80,21 +63,12 @@
}
return ret;
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSourceLine()
- */
@Override
public int getSourceLine() {
return this.line;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getSourcePath()
- */
@Override
public String getSourcePath() {
return getParent().getParent().getSourcePath();
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistRoot.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistRoot.java
index e63ef4f..ae1e680 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistRoot.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/HistRoot.java
@@ -28,30 +28,34 @@
public class HistRoot extends AbstractTreeElement {
private final LinkedList<HistFile> children = new LinkedList<>();
-
+
/** The decoded gmon to display */
public final GmonDecoder decoder;
-
+
/**
* Constructor
- * @param decoder
+ * @param decoder
*/
public HistRoot(GmonDecoder decoder) {
super(null);
this.decoder = decoder;
}
-
+
private HistFile getChild(String p) {
for (HistFile f : this.children) {
if (p != null) {
- if (p.equals(f.sourcePath)) return f;
- } else if (f.sourcePath == null) return f;
+ if (p.equals(f.sourcePath)) {
+ return f;
+ }
+ } else if (f.sourcePath == null) {
+ return f;
+ }
}
HistFile f = new HistFile(this, p);
this.children.add(f);
return f;
}
-
+
/**
* Add a bucket to the tree representation of the gmon file
* @param b a bucket
@@ -63,7 +67,7 @@
HistFile hf = getChild(path);
hf.addBucket(b, s, program);
}
-
+
/**
* Add a callgraph node to the tree representation of the gmon file
* @param node
@@ -75,28 +79,16 @@
hf.addCallGraphNode(node);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getChildren()
- */
@Override
public LinkedList<? extends TreeElement> getChildren() {
return this.children;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.TreeElement#getName()
- */
@Override
public String getName() {
return Messages.HistRoot_Summary;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.gprof.view.histogram.AbstractTreeElement#getCalls()
- */
@Override
public int getCalls() {
return -1;
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/TreeElement.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/TreeElement.java
index 34e5a1a..66818a6 100644
--- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/TreeElement.java
+++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/internal/gprof/view/histogram/TreeElement.java
@@ -25,33 +25,33 @@
* @return a tree node
*/
TreeElement getParent();
-
+
/**
* Gets the children of this tree node
* @return an array of tree nodes
*/
LinkedList<? extends TreeElement> getChildren();
-
+
/**
* Checks whether this tree node has children
* @return <code>true</code> if this tree node has children,
* <code>false</code> otherwise.
*/
boolean hasChildren();
-
-
+
+
String getName();
-
+
int getSamples();
-
+
int getCalls();
-
+
String getSourcePath();
-
- int getSourceLine();
-
+
+ int getSourceLine();
+
TreeElement getRoot();
-
-
-
+
+
+
}