Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 167995 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/platform/jvmti/client/internal/ITILaunchConfigurationConstants.java (+6 lines)
Lines 40-45 Link Here
40
	 */
40
	 */
41
	public static final String ATTR_EXEC_CPU_TIME = TIPlugin.getId() + ".ATTR_EXEC_CPU_TIME";
41
	public static final String ATTR_EXEC_CPU_TIME = TIPlugin.getId() + ".ATTR_EXEC_CPU_TIME";
42
42
43
	/**
44
	 * A <code>boolean</code> indicating whether Object allocation informaton
45
	 * should be included or not. Object allocation informaton is included if
46
	 * the flag is set; otherwise it will not be included.
47
	 */
48
	public static final String ATTR_EXEC_OBJ_ALLOC_SITE = TIPlugin.getId() + ".ATTR_EXEC_OBJ_ALLOC_SITE";
43
	
49
	
44
	/**
50
	/**
45
	 * A <code>boolean</code> indicating whether execution flow or execution statistics should
51
	 * A <code>boolean</code> indicating whether execution flow or execution statistics should
(-)src/org/eclipse/tptp/platform/jvmti/client/internal/TIPlugin.java (+20 lines)
Lines 10-16 Link Here
10
 **********************************************************************/
10
 **********************************************************************/
11
package org.eclipse.tptp.platform.jvmti.client.internal;
11
package org.eclipse.tptp.platform.jvmti.client.internal;
12
12
13
import java.util.ResourceBundle;
14
13
import org.eclipse.ui.plugin.*;
15
import org.eclipse.ui.plugin.*;
16
import org.eclipse.core.runtime.Platform;
14
import org.eclipse.jface.resource.ImageDescriptor;
17
import org.eclipse.jface.resource.ImageDescriptor;
15
import org.osgi.framework.BundleContext;
18
import org.osgi.framework.BundleContext;
16
19
Lines 76-79 Link Here
76
	{
79
	{
77
		return ID;
80
		return ID;
78
	}
81
	}
82
83
	/**
84
	 * Returns the resource string for the given key
85
	 * 
86
	 * @param key 
87
	 *                String, the key
88
	 * @return String, the resource String
89
	 */
90
	public static String getResourceString(String key) {
91
	try {
92
	    ResourceBundle resourceBundle = Platform.getResourceBundle(Platform
93
		    .getBundle(ID));
94
	    return resourceBundle.getString(key);
95
	} catch (Exception e) {
96
	    return key;
97
	}
98
    }
79
}
99
}
(-)src/org/eclipse/tptp/platform/jvmti/client/internal/messages.properties (+3 lines)
Lines 43-47 Link Here
43
EXEC_LEVEL_OF_DETAIL				= Level of detail
43
EXEC_LEVEL_OF_DETAIL				= Level of detail
44
EXEC_TYPE_OF_DATA					= Type of data
44
EXEC_TYPE_OF_DATA					= Type of data
45
EXEC_COLLECT_CPU_TIME				= Collect method CPU time information 
45
EXEC_COLLECT_CPU_TIME				= Collect method CPU time information 
46
EXEC_HEAPUI_TITLE					= Memory analysis 
47
EXEC_HEAPUI_DESC					= Analyze the application memory usage by monitoring object allocations
48
EXEC_COLLECT_OBJECT_ALLOCATION		= Track object allocation sites 
46
EXEC_COLLECT_STATISTICS				= Show execution statistics (compressed)
49
EXEC_COLLECT_STATISTICS				= Show execution statistics (compressed)
47
EXEC_COLLECT_FLOW					= Show execution flow graphical details
50
EXEC_COLLECT_FLOW					= Show execution flow graphical details
(-)src/org/eclipse/tptp/platform/jvmti/client/internal/TIMessages.java (+1 lines)
Lines 50-55 Link Here
50
	public static String EXEC_LEVEL_OF_DETAIL;
50
	public static String EXEC_LEVEL_OF_DETAIL;
51
	public static String EXEC_TYPE_OF_DATA;
51
	public static String EXEC_TYPE_OF_DATA;
52
	public static String EXEC_COLLECT_CPU_TIME;
52
	public static String EXEC_COLLECT_CPU_TIME;
53
	public static String EXEC_COLLECT_OBJECT_ALLOCATION;
53
	public static String EXEC_COLLECT_STATISTICS;
54
	public static String EXEC_COLLECT_STATISTICS;
54
	public static String EXEC_COLLECT_FLOW;
55
	public static String EXEC_COLLECT_FLOW;
55
		
56
		
(-)plugin.properties (+1 lines)
Lines 26-31 Link Here
26
26
27
JVMTI_ANALYSIS_TYPE_HEAP_NAME			= Memory Analysis
27
JVMTI_ANALYSIS_TYPE_HEAP_NAME			= Memory Analysis
28
JVMTI_ANALYSIS_TYPE_HEAP_DESC			= Analyze the Memory usage of your application
28
JVMTI_ANALYSIS_TYPE_HEAP_DESC			= Analyze the Memory usage of your application
29
JVMTI_ANALYSIS_TYPE_HEAP_OBJ_ALLOC_DESC	= Analyze the application memory usage by monitoring object allocations
29
30
30
JVMTI_ANALYSIS_TYPE_THRD_NAME			= Thread Analysis
31
JVMTI_ANALYSIS_TYPE_THRD_NAME			= Thread Analysis
31
JVMTI_ANALYSIS_TYPE_THRD_DESC			= Analyze the execution of your application threads
32
JVMTI_ANALYSIS_TYPE_THRD_DESC			= Analyze the execution of your application threads
(-)plugin.xml (-1 / +1 lines)
Lines 102-108 Link Here
102
        dialogTitle="%JVMTI_DATA_COLLECTOR_CONF_TITILE"
102
        dialogTitle="%JVMTI_DATA_COLLECTOR_CONF_TITILE"
103
        id="org.eclipse.tptp.trace.jvmti.heapConfiguration"/>
103
        id="org.eclipse.tptp.trace.jvmti.heapConfiguration"/>
104
  <configuration
104
  <configuration
105
        class="org.eclipse.tptp.platform.jvmti.client.internal.analysistypes.TIHeapAnalysisConfig"
105
        class="org.eclipse.tptp.platform.jvmti.client.internal.analysistypes.TIThreadAnalysisConfig"
106
        dialogTitle="%JVMTI_DATA_COLLECTOR_CONF_TITILE"
106
        dialogTitle="%JVMTI_DATA_COLLECTOR_CONF_TITILE"
107
        id="org.eclipse.tptp.trace.jvmti.threadConfiguration"/> 
107
        id="org.eclipse.tptp.trace.jvmti.threadConfiguration"/> 
108
	</extension>	
108
	</extension>	
(-)src/org/eclipse/tptp/platform/jvmti/client/internal/analysistypes/TIHeapAnalysisConfig.java (+115 lines)
Added Link Here
1
/*****************************************************************************
2
 * Copyright (c) 2007, Intel Corporation.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    Intel Corporation - Initial API and implementation
10
 *    Vitaly A. Provodin, Intel - Initial API and implementation
11
 *
12
 * $Id:
13
 *****************************************************************************/
14
package org.eclipse.tptp.platform.jvmti.client.internal.analysistypes;
15
16
import java.util.Vector;
17
18
import org.eclipse.core.runtime.CoreException;
19
import org.eclipse.debug.core.ILaunchConfiguration;
20
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
21
import org.eclipse.hyades.internal.execution.local.common.Options;
22
import org.eclipse.swt.widgets.Composite;
23
import org.eclipse.tptp.platform.jvmti.client.internal.ITILaunchConfigurationConstants;
24
import org.eclipse.tptp.platform.jvmti.client.internal.TIMessages;
25
import org.eclipse.tptp.platform.jvmti.client.internal.TIPlugin;
26
import org.eclipse.tptp.trace.ui.internal.launcher.application.AbstractConfiguration;
27
import org.eclipse.tptp.trace.ui.internal.launcher.application.PIMemoryAnalysisConf.MemoryConfigurationPage;
28
import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherMessages;
29
import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility;
30
import org.eclipse.tptp.trace.ui.provisional.launcher.DataCollectionEngineAttribute;
31
32
public class TIHeapAnalysisConfig extends AbstractConfiguration {
33
34
    public TIHeapAnalysisConfig() {
35
	super(new Class[] { TIHeapAnalysisOpt.class });
36
    }
37
38
    /**
39
     * The heap analysis options are displayed in this configuration page.
40
     */
41
    public static class TIHeapAnalysisOpt extends MemoryConfigurationPage {
42
43
	/** The heap analysis UI */
44
	private TIHeapAnalysisUI execHeapAnalysisUI;
45
46
	/**
47
	 * Indicates whether object allocation site information should be
48
	 * collected
49
	 */
50
	private boolean collectObjectAllocationSite;
51
52
	public TIHeapAnalysisOpt() {
53
	    execHeapAnalysisUI = new TIHeapAnalysisUI();
54
	}
55
56
	public void reset(ILaunchConfiguration launchConfiguration) {
57
	    try {
58
		collectObjectAllocationSite = launchConfiguration
59
			.getAttribute(
60
				ITILaunchConfigurationConstants.ATTR_EXEC_OBJ_ALLOC_SITE,
61
				false);
62
	    } catch (CoreException e) {
63
		LauncherUtility.openErrorWithDetail(
64
			LauncherMessages.LAUNCHER_COMMON_ERROR_TITLE,
65
			TIMessages.ERROR_TI_CONFIGURATION_RESET, e);
66
	    }
67
	}
68
69
	public Vector getAttributes() {
70
	    Vector options = null;
71
	    options = new Vector();
72
	    options.add(new DataCollectionEngineAttribute(
73
		    ITILaunchConfigurationConstants.ATTR_EXEC_OBJ_ALLOC_SITE,
74
		    Options.OPTION_VALUE_TRUE));
75
	    return options;
76
	}
77
78
	public boolean storeAttributes(
79
		ILaunchConfigurationWorkingCopy configurationWC) {
80
	    configurationWC.setAttribute(
81
		    ITILaunchConfigurationConstants.ATTR_EXEC_OBJ_ALLOC_SITE,
82
		    execHeapAnalysisUI.isCollectObjectAllocationSiteSelected());
83
	    return true;
84
85
	}
86
87
	public void createControl(Composite parent) {
88
	    execHeapAnalysisUI.createControl(parent);
89
	    execHeapAnalysisUI
90
		    .setCollectObjectAllocationSite(collectObjectAllocationSite);
91
	}
92
93
	/*
94
	 * (non-Javadoc)
95
	 * 
96
	 * @see org.eclipse.tptp.trace.ui.internal.launcher.application.PIMemoryAnalysisConf.MemoryConfigurationPage#getDescription()
97
	 */
98
	public String getDescription() {
99
	    String desc = TIPlugin
100
		    .getResourceString("JVMTI_ANALYSIS_TYPE_HEAP_OBJ_ALLOC_DESC");
101
	    return desc;
102
	}
103
104
	/*
105
	 * (non-Javadoc)
106
	 * 
107
	 * @see org.eclipse.tptp.trace.ui.internal.launcher.application.PIMemoryAnalysisConf.MemoryConfigurationPage#getTitle()
108
	 */
109
	public String getTitle() {
110
	    String title = TIPlugin
111
		    .getResourceString("JVMTI_ANALYSIS_TYPE_HEAP_NAME");
112
	    return title;
113
	}
114
    }
115
}
(-)src/org/eclipse/tptp/platform/jvmti/client/internal/analysistypes/TIHeapAnalysisUI.java (+78 lines)
Added Link Here
1
/*****************************************************************************
2
 * Copyright (c) 2007, Intel Corporation.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    Intel Corporation - Initial API and implementation
10
 *    Vitaly A. Provodin, Intel - Initial API and implementation
11
 *
12
 * $Id:
13
 *****************************************************************************/
14
package org.eclipse.tptp.platform.jvmti.client.internal.analysistypes;
15
16
import org.eclipse.swt.SWT;
17
import org.eclipse.swt.layout.GridData;
18
import org.eclipse.swt.layout.GridLayout;
19
import org.eclipse.swt.widgets.Button;
20
import org.eclipse.swt.widgets.Composite;
21
import org.eclipse.swt.widgets.Group;
22
import org.eclipse.tptp.platform.jvmti.client.internal.TIMessages;
23
24
public class TIHeapAnalysisUI {
25
26
    /** Object allocation site option */
27
    private Button collectObjectAllocationSite;
28
29
    public void createControl(Composite parent) {
30
	/* Create the level of detail group */
31
	createLevelOfDetailGroup(parent);
32
    }
33
34
    private void createLevelOfDetailGroup(Composite parent) {
35
	Group grp = createGroup(parent, TIMessages.EXEC_LEVEL_OF_DETAIL);
36
	collectObjectAllocationSite = createButton(grp,
37
		TIMessages.EXEC_COLLECT_OBJECT_ALLOCATION, SWT.CHECK);
38
39
	Composite gap = new Composite(grp, SWT.NONE);
40
	GridLayout gl = new GridLayout();
41
	gl.marginBottom = 5;
42
	gap.setLayout(gl);
43
    }
44
45
    private Group createGroup(Composite parent, String name) {
46
	Group grp = new Group(parent, SWT.NONE);
47
	grp.setLayout(new GridLayout());
48
	grp.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, true));
49
	grp.setText(name);
50
51
	return grp;
52
    }
53
54
    private Button createButton(Composite parent, String name, int style) {
55
	Button button = new Button(parent, style);
56
	button.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false));
57
	button.setText(name);
58
59
	return button;
60
    }
61
62
    /**
63
     * @return the collectCPUTime
64
     */
65
    public boolean isCollectObjectAllocationSiteSelected() {
66
	return collectObjectAllocationSite == null
67
		|| collectObjectAllocationSite.isDisposed() ? false
68
		: collectObjectAllocationSite.getSelection();
69
    }
70
71
    /**
72
     * @param collectCPUTime
73
     *                the collectCPUTime to set
74
     */
75
    public void setCollectObjectAllocationSite(boolean collectObjectAllocation) {
76
	this.collectObjectAllocationSite.setSelection(collectObjectAllocation);
77
    }
78
}

Return to bug 167995