diff options
author | Daniel Henrique Debonzi | 2011-07-08 15:22:25 +0000 |
---|---|---|
committer | Andrew Overholt | 2011-07-08 19:10:51 +0000 |
commit | 61eb4c0d54fa650b825debf07f75429637782827 (patch) | |
tree | 0a08a1d806578fbd0b87b83adf12c761f8c7a290 | |
parent | ba34c1cbd8fb91f59dd1e45928043bfa4138132c (diff) | |
download | org.eclipse.linuxtools-61eb4c0d54fa650b825debf07f75429637782827.tar.gz org.eclipse.linuxtools-61eb4c0d54fa650b825debf07f75429637782827.tar.xz org.eclipse.linuxtools-61eb4c0d54fa650b825debf07f75429637782827.zip |
Valgrind 3.6 massif new options included.
5 files changed, 100 insertions, 4 deletions
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifCommandConstants.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifCommandConstants.java index 7b44dd5f9d..d7629992c1 100644 --- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifCommandConstants.java +++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifCommandConstants.java @@ -16,8 +16,10 @@ public final class MassifCommandConstants { public static final String OPT_HEAP = "--heap"; //$NON-NLS-1$ public static final String OPT_HEAPADMIN = "--heap-admin"; //$NON-NLS-1$ public static final String OPT_STACKS = "--stacks"; //$NON-NLS-1$ + public static final String OPT_PAGESASHEAP = "--pages-as-heap"; //no|yes $NON-NLS-1$ public static final String OPT_DEPTH = "--depth"; //$NON-NLS-1$ public static final String OPT_ALLOCFN = "--alloc-fn"; //$NON-NLS-1$ + public static final String OPT_IGNOREFN = "--ignore-fn"; //<name> $NON-NLS-1$ public static final String OPT_THRESHOLD = "--threshold"; //$NON-NLS-1$ public static final String OPT_PEAKINACCURACY = "--peak-inaccuracy"; //$NON-NLS-1$ public static final String OPT_TIMEUNIT = "--time-unit"; //$NON-NLS-1$ diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchConstants.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchConstants.java index 4172a0c85f..35fc6eecb8 100644 --- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchConstants.java +++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchConstants.java @@ -19,8 +19,10 @@ public final class MassifLaunchConstants { public static final String ATTR_MASSIF_HEAP = MassifPlugin.PLUGIN_ID + ".MASSIF_HEAP"; //$NON-NLS-1$ public static final String ATTR_MASSIF_HEAPADMIN = MassifPlugin.PLUGIN_ID + ".MASSIF_HEAPADMIN"; //$NON-NLS-1$ public static final String ATTR_MASSIF_STACKS = MassifPlugin.PLUGIN_ID + ".MASSIF_STACKS"; //$NON-NLS-1$ + public static final String ATTR_MASSIF_PAGESASHEAP = MassifPlugin.PLUGIN_ID + ".MASSIF_PAGEASHEAP"; //$NON-NLS-1$ public static final String ATTR_MASSIF_DEPTH = MassifPlugin.PLUGIN_ID + ".MASSIF_DEPTH"; //$NON-NLS-1$ public static final String ATTR_MASSIF_ALLOCFN = MassifPlugin.PLUGIN_ID + ".MASSIF_ALLOCFN"; //$NON-NLS-1$ + public static final String ATTR_MASSIF_IGNOREFN = MassifPlugin.PLUGIN_ID + ".MASSIF_IGNOREFN"; //$NON-NLS-1$ public static final String ATTR_MASSIF_THRESHOLD = MassifPlugin.PLUGIN_ID + ".MASSIF_THRESHOLD"; //$NON-NLS-1$ public static final String ATTR_MASSIF_PEAKINACCURACY = MassifPlugin.PLUGIN_ID + ".MASSIF_PEAKINACCURACY"; //$NON-NLS-1$ public static final String ATTR_MASSIF_TIMEUNIT = MassifPlugin.PLUGIN_ID + ".MASSIF_TIMEUNIT"; //$NON-NLS-1$ @@ -36,8 +38,10 @@ public final class MassifLaunchConstants { public static final boolean DEFAULT_MASSIF_HEAP = true; public static final int DEFAULT_MASSIF_HEAPADMIN = 8; public static final boolean DEFAULT_MASSIF_STACKS = false; + public static final boolean DEFAULT_MASSIF_PAGESASHEAP = false; public static final int DEFAULT_MASSIF_DEPTH = 30; public static final List<?> DEFAULT_MASSIF_ALLOCFN = Collections.EMPTY_LIST; + public static final List<?> DEFAULT_MASSIF_IGNOREFN = Collections.EMPTY_LIST; public static final int DEFAULT_MASSIF_THRESHOLD = 10; public static final int DEFAULT_MASSIF_PEAKINACCURACY = 10; public static final String DEFAULT_MASSIF_TIMEUNIT = TIME_I; diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchDelegate.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchDelegate.java index fcf6cc2f50..a0399c07c6 100644 --- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchDelegate.java +++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchDelegate.java @@ -83,11 +83,16 @@ public class MassifLaunchDelegate implements IValgrindLaunchDelegate { opts.add(MassifCommandConstants.OPT_HEAP + EQUALS + (config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAP, MassifLaunchConstants.DEFAULT_MASSIF_HEAP) ? YES : NO)); opts.add(MassifCommandConstants.OPT_HEAPADMIN + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAPADMIN, MassifLaunchConstants.DEFAULT_MASSIF_HEAPADMIN)); opts.add(MassifCommandConstants.OPT_STACKS + EQUALS + (config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_STACKS, MassifLaunchConstants.DEFAULT_MASSIF_STACKS) ? YES : NO)); + opts.add(MassifCommandConstants.OPT_PAGESASHEAP + EQUALS + (config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_PAGESASHEAP, MassifLaunchConstants.DEFAULT_MASSIF_PAGESASHEAP) ? YES : NO)); opts.add(MassifCommandConstants.OPT_DEPTH + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_DEPTH, MassifLaunchConstants.DEFAULT_MASSIF_DEPTH)); List<String> allocFns = config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_ALLOCFN, MassifLaunchConstants.DEFAULT_MASSIF_ALLOCFN); for (String func : allocFns) { opts.add(MassifCommandConstants.OPT_ALLOCFN + EQUALS + func); } + List<String> ignoreFns = config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_IGNOREFN, MassifLaunchConstants.DEFAULT_MASSIF_IGNOREFN); + for (String func : ignoreFns) { + opts.add(MassifCommandConstants.OPT_IGNOREFN + EQUALS + func); + } opts.add(MassifCommandConstants.OPT_THRESHOLD + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_THRESHOLD, MassifLaunchConstants.DEFAULT_MASSIF_THRESHOLD) / 10.0); opts.add(MassifCommandConstants.OPT_PEAKINACCURACY + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_PEAKINACCURACY, MassifLaunchConstants.DEFAULT_MASSIF_PEAKINACCURACY) / 10.0); opts.add(MassifCommandConstants.OPT_TIMEUNIT + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_TIMEUNIT, MassifLaunchConstants.DEFAULT_MASSIF_TIMEUNIT)); diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifToolPage.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifToolPage.java index 489d78b83e..a0d55863e0 100644 --- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifToolPage.java +++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifToolPage.java @@ -47,10 +47,12 @@ public class MassifToolPage extends AbstractLaunchConfigurationTab // Massif controls protected Button heapButton; + protected Button pagesasheapButton; protected Spinner heapAdminSpinner; protected Button stacksButton; protected Spinner depthSpinner; protected List allocFnList; + protected List ignoreFnList; protected Spinner thresholdSpinner; protected Spinner peakInaccuracySpinner; protected Combo timeUnitCombo; @@ -102,7 +104,14 @@ public class MassifToolPage extends AbstractLaunchConfigurationTab stacksButton = new Button(stacksTop, SWT.CHECK); stacksButton.setText(Messages.getString("MassifToolPage.profile_stack")); //$NON-NLS-1$ stacksButton.addSelectionListener(selectListener); + + Composite pagesasheapTop = new Composite(top, SWT.NONE); + pagesasheapTop.setLayout(new GridLayout(2, false)); + pagesasheapButton = new Button(pagesasheapTop, SWT.CHECK); + pagesasheapButton.setText(Messages.getString("MassifToolPage.profile_pagesasheap")); //$NON-NLS-1$ + pagesasheapButton.addSelectionListener(selectListener); + Composite depthTop = new Composite(top, SWT.NONE); depthTop.setLayout(new GridLayout(2, false)); @@ -199,6 +208,18 @@ public class MassifToolPage extends AbstractLaunchConfigurationTab allocFnLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false)); createAllocFnControls(allocFnTop); + + Composite ignoreFnTop = new Composite(top, SWT.NONE); + ignoreFnTop.setLayout(new GridLayout(3, false)); + ignoreFnTop.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1)); + + Label ignoreFnLabel = new Label(ignoreFnTop, SWT.NONE); + ignoreFnLabel.setText(Messages.getString("MassifToolPage.ignore_functions")); //$NON-NLS-1$ + ignoreFnLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false)); + + createIgnoreFnControls(ignoreFnTop); + + } private void checkAlignmentEnablement() { @@ -222,7 +243,7 @@ public class MassifToolPage extends AbstractLaunchConfigurationTab newButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); newButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { - handleNewButtonPressed(); + handleAllocNewButtonPressed(); updateLaunchConfigurationDialog(); } }); @@ -232,13 +253,46 @@ public class MassifToolPage extends AbstractLaunchConfigurationTab removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); removeButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { - handleRemoveButtonPressed(); + handleAllocRemoveButtonPressed(); + updateLaunchConfigurationDialog(); + } + }); + } + + private void createIgnoreFnControls(Composite top) { + + ignoreFnList = new List(top, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + FontMetrics fm = MassifPlugin.getFontMetrics(ignoreFnList); + ignoreFnList.setLayoutData(new GridData(Dialog.convertWidthInCharsToPixels(fm, 50), Dialog.convertHeightInCharsToPixels(fm, 5))); + + Composite ignoreButtons = new Composite(top, SWT.NONE); + GridLayout ignoreButtonsLayout = new GridLayout(); + ignoreButtonsLayout.marginWidth = ignoreButtonsLayout.marginHeight = 0; + ignoreButtons.setLayout(ignoreButtonsLayout); + ignoreButtons.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false)); + + Button newButton = new Button(ignoreButtons, SWT.PUSH); + newButton.setText(Messages.getString("MassifToolPage.New")); //$NON-NLS-1$ + newButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + newButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleIgnoreNewButtonPressed(); + updateLaunchConfigurationDialog(); + } + }); + + Button removeButton = new Button(ignoreButtons, SWT.PUSH); + removeButton.setText(Messages.getString("MassifToolPage.Remove")); //$NON-NLS-1$ + removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + removeButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleIgnoreRemoveButtonPressed(); updateLaunchConfigurationDialog(); } }); } - protected void handleNewButtonPressed() { + protected void handleAllocNewButtonPressed() { InputDialog dialog = new InputDialog(getShell(), Messages.getString("MassifToolPage.New_Allocation_Function"), Messages.getString("MassifToolPage.Function_name"), "", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (dialog.open() == Window.OK) { String function = dialog.getValue(); @@ -248,11 +302,26 @@ public class MassifToolPage extends AbstractLaunchConfigurationTab } } - protected void handleRemoveButtonPressed() { + protected void handleAllocRemoveButtonPressed() { int[] selections = allocFnList.getSelectionIndices(); allocFnList.remove(selections); } + protected void handleIgnoreNewButtonPressed() { + InputDialog dialog = new InputDialog(getShell(), Messages.getString("MassifToolPage.New_Ignore_Function"), Messages.getString("MassifToolPage.Function_name"), "", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + if (dialog.open() == Window.OK) { + String function = dialog.getValue(); + if (!function.equals("")) { //$NON-NLS-1$ + ignoreFnList.add(function); + } + } + } + + protected void handleIgnoreRemoveButtonPressed() { + int[] selections = ignoreFnList.getSelectionIndices(); + ignoreFnList.remove(selections); + } + public String getName() { return Messages.getString("MassifToolPage.Massif_Options"); //$NON-NLS-1$ } @@ -264,9 +333,12 @@ public class MassifToolPage extends AbstractLaunchConfigurationTab heapButton.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAP, MassifLaunchConstants.DEFAULT_MASSIF_HEAP)); heapAdminSpinner.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAPADMIN, MassifLaunchConstants.DEFAULT_MASSIF_HEAPADMIN)); stacksButton.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_STACKS, MassifLaunchConstants.DEFAULT_MASSIF_STACKS)); + pagesasheapButton.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_PAGESASHEAP, MassifLaunchConstants.DEFAULT_MASSIF_PAGESASHEAP)); depthSpinner.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_DEPTH, MassifLaunchConstants.DEFAULT_MASSIF_DEPTH)); java.util.List<String> allocFns = configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_ALLOCFN, MassifLaunchConstants.DEFAULT_MASSIF_ALLOCFN); allocFnList.setItems(allocFns.toArray(new String[allocFns.size()])); + java.util.List<String> ignoreFns = configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_IGNOREFN, MassifLaunchConstants.DEFAULT_MASSIF_IGNOREFN); + ignoreFnList.setItems(ignoreFns.toArray(new String[ignoreFns.size()])); thresholdSpinner.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_THRESHOLD, MassifLaunchConstants.DEFAULT_MASSIF_THRESHOLD)); peakInaccuracySpinner.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_PEAKINACCURACY, MassifLaunchConstants.DEFAULT_MASSIF_PEAKINACCURACY)); String timeUnit = configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_TIMEUNIT, MassifLaunchConstants.DEFAULT_MASSIF_TIMEUNIT); @@ -295,8 +367,10 @@ public class MassifToolPage extends AbstractLaunchConfigurationTab configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAP, heapButton.getSelection()); configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAPADMIN, heapAdminSpinner.getSelection()); configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_STACKS, stacksButton.getSelection()); + configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_PAGESASHEAP, pagesasheapButton.getSelection()); configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DEPTH, depthSpinner.getSelection()); configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_ALLOCFN, Arrays.asList(allocFnList.getItems())); + configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_IGNOREFN, Arrays.asList(ignoreFnList.getItems())); configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_THRESHOLD, thresholdSpinner.getSelection()); configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_PEAKINACCURACY, peakInaccuracySpinner.getSelection()); int ix = timeUnitCombo.getSelectionIndex(); @@ -379,6 +453,10 @@ public class MassifToolPage extends AbstractLaunchConfigurationTab public Button getStacksButton() { return stacksButton; } + + public Button getPageasheapButton() { + return pagesasheapButton; + } public Spinner getDepthSpinner() { return depthSpinner; @@ -388,6 +466,10 @@ public class MassifToolPage extends AbstractLaunchConfigurationTab return allocFnList; } + public List getIgnoreFnList() { + return ignoreFnList; + } + public Spinner getThresholdSpinner() { return thresholdSpinner; } diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/messages.properties b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/messages.properties index 9c26c84f3d..f30d18e1c6 100644 --- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/messages.properties +++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/messages.properties @@ -8,6 +8,7 @@ MassifPidMenuAction.Select_Process_ID=Select Process ID MassifToolPage.administrative_bytes=administrative bytes per block: MassifToolPage.Alignment_must_be_power_2=Alignment must be a power of 2 between 8 and 4096 inclusive MassifToolPage.allocation_functions=allocation functions: +MassifToolPage.ignore_functions=ignore functions: MassifToolPage.allocation_peak_inaccuracy=allocation peak inaccuracy: MassifToolPage.allocation_tree_depth=allocation tree depth: MassifToolPage.bytes=bytes @@ -22,7 +23,9 @@ MassifToolPage.milliseconds=milliseconds MassifToolPage.minimum_heap_block=minimum heap block alignment: MassifToolPage.New=N&ew MassifToolPage.New_Allocation_Function=New Allocation Function +MassifToolPage.New_Ignore_Function=New Ignore Function MassifToolPage.profile_heap=profile heap +MassifToolPage.profile_pagesasheap=profile memory at page level MassifToolPage.profile_stack=profile stack MassifToolPage.Remove=Rem&ove MassifToolPage.time_unit=time unit: |