sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemoryProcess.java
author Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
Wed, 23 Jun 2010 15:05:09 +0300
changeset 12 ae255c9aa552
permissions -rw-r--r--
Performance Investigator Carbide extension 2.4.0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
     1
/*
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
     2
 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
     3
 * All rights reserved.
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
     8
 *
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
     9
 * Initial Contributors:
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    11
 *
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    12
 * Contributors:
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    13
 *
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    14
 * Description: 
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    15
 *
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    16
 */
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    17
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    18
package com.nokia.carbide.cpp.pi.graphicsmemory;
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    19
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    20
import com.nokia.carbide.cpp.internal.pi.model.GenericThread;
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    21
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    22
public class GraphicsMemoryProcess extends GenericThread {
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    23
	private static final long serialVersionUID = -3170239590768930245L;
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    24
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    25
	// name to be shown for the process
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    26
	transient public String fullName;
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    27
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    28
	// maximum memory usage of process within the current time interval
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    29
	transient public MaxGraphicsMemoryItem maxMemoryItem;
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    30
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    31
	// remember whether the process is enabled for the given graph
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    32
	transient public boolean[] enabled;
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    33
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    34
	public GraphicsMemoryProcess(Integer processId, String processName) {
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    35
		this.processId = processId;
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    36
		this.processName = processName;
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    37
	}
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    38
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    39
	// get whether the process is enabled for the given graph
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    40
	public boolean isEnabled(int graphIndex) {
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    41
		return this.enabled[graphIndex];
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    42
	}
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    43
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    44
	// set whether the process is enabled for the given graph
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    45
	public void setEnabled(int graphIndex, boolean enabled) {
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    46
		this.enabled[graphIndex] = enabled;
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    47
	}
ae255c9aa552 Performance Investigator Carbide extension 2.4.0
Toni Pulkkinen <ext-toni.p.pulkkinen@nokia.com>
parents:
diff changeset
    48
}