import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.nl.GLPageLabels;
-import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
-import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
import org.tizen.dynamicanalyzer.resources.ImageResources;
+/*
+ * Enumeration describing features for tracing with their resources
+ */
public enum FlatFeature {
// Group100 CPU
- CPU_USAGE(101, ConfigureLabels.FEATURE_NAME_CPU_USAGE,
- ConfigureLabels.FEATURE_DESCRIPTION_CPU_USAGE, // TODO: Check to use TimelineChartLables description
- ConfigureLabels.FEATURE_PAGE_CPU_USAGE,
- TimelineChartLabels.CPU_CHART_TITLE), // TODO: Change symbol, text as new feature list
+ CPU_USAGE(PrimitiveFeature.CPU_USAGE), // TODO: Change symbol, text as new feature list
- CPU_USAGE_PER_CORE(102, ConfigureLabels.FEATURE_NAME_CPU_USAGE_PER_CORE,
- ConfigureLabels.FEATURE_DESCRIPTION_CPU_USAGE_PER_CORE,
- ConfigureLabels.FEATURE_PAGE_CPU_USAGE_PER_CORE,
- TimelineChartLabels.CPU_CORE_CHART_TITLE),
+ CPU_USAGE_PER_CORE(PrimitiveFeature.CPU_USAGE_PER_CORE),
- CPU_FREQ_PER_CORE(103, ConfigureLabels.FEATURE_NAME_CPU_FREQ_PER_CORE,
- ConfigureLabels.FEATURE_DESCRIPTION_CPU_FREQ_PER_CORE,
- ConfigureLabels.FEATURE_PAGE_CPU_FREQ_PER_CORE,
- TimelineChartLabels.CPU_FREQUENCY_CHART_TITLE),
+ CPU_FREQ_PER_CORE(PrimitiveFeature.CPU_FREQ_PER_CORE),
// Group200 Memory
- SYSTEM_MEMORY(201, ConfigureLabels.FEATURE_NAME_FLAT_SYSTEM_MEMORY,
- ConfigureLabels.FEATURE_DESCRIPTION_FLAT_SYSTEM_MEMORY,
- ConfigureLabels.FEATURE_PAGE_FLAT_SYSTEM_MEMORY,
- TimelineChartLabels.SYSTEM_MEMORY_CHART_TITLE),
+ SYSTEM_MEMORY(PrimitiveFeature.SYSTEM_MEMORY),
- PROCESS_MEMORY(202, ConfigureLabels.FEATURE_NAME_PROCESS_MEMORY,
- ConfigureLabels.FEATURE_DESCRIPTION_PROCESS_MEMORY,
- ConfigureLabels.FEATURE_PAGE_PROCESS_MEMORY,
- TimelineChartLabels.PROCESS_MEMORY_CHART_TITLE),
+ PROCESS_MEMORY(PrimitiveFeature.PROCESS_MEMORY),
- MEMORY_ALLOC(203, ConfigureLabels.FEATURE_NAME_MEMORY_ALLOC,
- ConfigureLabels.FEATURE_DESCRIPTION_MEMORY_ALLOC,
- ConfigureLabels.FEATURE_PAGE_MEMORY_ALLOC,
- TimelineChartLabels.HEAP_CHART_TITLE),
+ MEMORY_ALLOC(PrimitiveFeature.MEMORY_ALLOC),
// Group300 File system
- DISK_IO(301, ConfigureLabels.FEATURE_NAME_DISK_IO,
- ConfigureLabels.FEATURE_DESCRIPTION_DISK_IO,
- ConfigureLabels.FEATURE_PAGE_DISK_IO,
- TimelineChartLabels.DISK_IO_CHART_TITLE),
+ DISK_IO(PrimitiveFeature.DISK_IO),
- FILE_ANALYSIS(302, ConfigureLabels.FEATURE_NAME_FILE,
- ConfigureLabels.FEATURE_DESCRIPTION_FILE,
- ConfigureLabels.FEATURE_PAGE_FILE,
- TimelineChartLabels.FILE_CHART_TITLE),
+ FILE_ANALYSIS(PrimitiveFeature.FILE_ANALYSIS),
// Group400 Graphics
- OPENGLES_ANALYSIS(401, ConfigureLabels.FEATURE_NAME_OPENGLES,
- ConfigureLabels.FEATURE_DESCRIPTION_OPENGLES,
- ConfigureLabels.FEATURE_PAGE_OPENGLES,
- GLPageLabels.GL_CHART_TITLE_FRAME_RATE),
+ OPENGLES_ANALYSIS(PrimitiveFeature.OPENGLES_ANALYSIS),
// Group500 Network
- NETWORK_IO(501, ConfigureLabels.FEATURE_NAME_NETWORK_IO,
- ConfigureLabels.FEATURE_DESCRIPTION_NETWORK_IO,
- ConfigureLabels.FEATURE_PAGE_NETWORK_IO,
- TimelineChartLabels.NETWORK_IO_CHART_TITLE),
+ NETWORK_IO(PrimitiveFeature.NETWORK_IO),
- NETWORK_ANALYSIS(502, ConfigureLabels.FEATURE_NAME_NETWORK,
- ConfigureLabels.FEATURE_DESCRIPTION_NETWORK,
- ConfigureLabels.FEATURE_PAGE_NETWORK,
- TimelineChartLabels.NETWORK_IO_CHART_TITLE),
+ NETWORK_ANALYSIS(PrimitiveFeature.NETWORK_ANALYSIS),
// Group600 UI
- UI_EVENT(601, ConfigureLabels.FEATURE_NAME_UI_EVENT,
- ConfigureLabels.FEATURE_DESCRIPTION_UI_EVENT,
- ConfigureLabels.FEATURE_PAGE_UI_EVENT,
- TimelineChartLabels.UI_EVENT_CHART_TITLE),
+ UI_EVENT(PrimitiveFeature.UI_EVENT),
- SCREENSHOT(602, ConfigureLabels.FEATURE_NAME_SCREENSHOT,
- ConfigureLabels.FEATURE_DESCRIPTION_SCREENSHOT,
- ConfigureLabels.FEATURE_PAGE_SCREENSHOT,
- TimelineChartLabels.SCREENSHOT_CHART_TITLE),
+ SCREENSHOT(PrimitiveFeature.SCREENSHOT),
- UI_HIERARCHY_ANALYSIS(603, ConfigureLabels.FEATURE_NAME_UI_HIERARCHY,
- ConfigureLabels.FEATURE_DESCRIPTION_UI_HIERARCHY,
- ConfigureLabels.FEATURE_PAGE_UI_HIERARCHY,
- "UI Hierarchy"), // TODO: Replace constant
+ UI_HIERARCHY_ANALYSIS(PrimitiveFeature.UI_HIERARCHY_ANALYSIS), // TODO: Replace constant
// Group700 Synchronization
- THREAD_ANALYSIS(701, ConfigureLabels.FEATURE_NAME_THREAD,
- ConfigureLabels.FEATURE_DESCRIPTION_THREAD,
- ConfigureLabels.FEATURE_PAGE_THREAD,
- ThreadPageLabels.THREAD_CHART_THREAD),
+ THREAD_ANALYSIS(PrimitiveFeature.THREAD_ANALYSIS),
- SYNC_ANALYSIS(702, ConfigureLabels.FEATURE_NAME_SYNC,
- ConfigureLabels.FEATURE_DESCRIPTION_SYNC,
- ConfigureLabels.FEATURE_PAGE_SYNC,
- ThreadPageLabels.THREAD_CHART_SYNC),
+ SYNC_ANALYSIS(PrimitiveFeature.SYNC_ANALYSIS),
// Group800 Energy
- PERIPHERAL_STATUS(801, ConfigureLabels.FEATURE_NAME_PERIPHERAL_STATUS,
- ConfigureLabels.FEATURE_DESCRIPTION_PERIPHERAL_STATUS,
- ConfigureLabels.FEATURE_PAGE_PERIPHERAL_STATUS,
- TimelineChartLabels.DEVICE_CHART_TITLE),
- POWER_ESTIMATION(802, ConfigureLabels.FEATURE_NAME_POWER_ESTIMATION,
- ConfigureLabels.FEATURE_DESCRIPTION_POWER_ESTIMATION,
- ConfigureLabels.FEATURE_PAGE_POWER_ESTIMATION,
- TimelineChartLabels.ENERGY_CHART_TITLE);
+ PERIPHERAL_STATUS(PrimitiveFeature.PERIPHERAL_STATUS),
+
+ POWER_ESTIMATION(PrimitiveFeature.POWER_ESTIMATION);
private static final Map<Integer, FlatFeature> featureByIndex = new HashMap<Integer, FlatFeature>();
private static final Map<String, FlatFeature> featureByName = new HashMap<String, FlatFeature>();
- private int index = 0;
- private String name = null;
- private String description = null;
- private String page = null;
- private String chart = null;
+ private PrimitiveFeature primitive;
private Image focusImg = null;
private Image normalImg = null;
private Image dimImg = null;
private Image smallImg = null;
private int overheadRanking = 0;
+ private FlatFeature(PrimitiveFeature primitive) {
+ this.primitive= primitive;
+ }
+
static {
setResources();
ImageResources.FEATURE_CURRENT_SMALL_SEL);
}
- private FlatFeature(int index, String name, String description, String page, String chart) {
- this.index = index;
- this.name = name;
- this.description = description;
- this.page = page;
- this.chart = chart;
- }
-
private void setResources(Image focusImg, Image normalImg, Image dimImg, Image overImg, Image smallImg) {
this.focusImg = focusImg;
this.normalImg = normalImg;
}
public int getIndex() {
- return index;
+ return primitive.getIndex();
}
public String getName() {
- return name;
+ return primitive.getName();
}
public String getDescription() {
- return description;
+ return primitive.getDescription();
}
public String getPage() {
- return page;
+ return primitive.getPage();
}
public String getChart() {
- return chart;
+ return primitive.getChart();
}
public boolean equals(FlatFeature op) {
- return (this.index == op.index);
+ return (this.primitive.getIndex() == op.primitive.getIndex());
}
public static FlatFeature getFlatFeature(String name) {
--- /dev/null
+/**
+ *
+ */
+package org.tizen.dynamicanalyzer.setting;
+
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.nl.GLPageLabels;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+
+/**
+ * Enumeration describing primitive features for tracing
+ */
+public enum PrimitiveFeature {
+ // Group100 CPU
+ CPU_USAGE(101, ConfigureLabels.FEATURE_NAME_CPU_USAGE,
+ ConfigureLabels.FEATURE_DESCRIPTION_CPU_USAGE, // TODO: Check to use TimelineChartLables description
+ ConfigureLabels.FEATURE_PAGE_CPU_USAGE,
+ TimelineChartLabels.CPU_CHART_TITLE), // TODO: Change symbol, text as new feature list
+
+ CPU_USAGE_PER_CORE(102, ConfigureLabels.FEATURE_NAME_CPU_USAGE_PER_CORE,
+ ConfigureLabels.FEATURE_DESCRIPTION_CPU_USAGE_PER_CORE,
+ ConfigureLabels.FEATURE_PAGE_CPU_USAGE_PER_CORE,
+ TimelineChartLabels.CPU_CORE_CHART_TITLE),
+
+ CPU_FREQ_PER_CORE(103, ConfigureLabels.FEATURE_NAME_CPU_FREQ_PER_CORE,
+ ConfigureLabels.FEATURE_DESCRIPTION_CPU_FREQ_PER_CORE,
+ ConfigureLabels.FEATURE_PAGE_CPU_FREQ_PER_CORE,
+ TimelineChartLabels.CPU_FREQUENCY_CHART_TITLE),
+
+ // Group200 Memory
+ SYSTEM_MEMORY(201, ConfigureLabels.FEATURE_NAME_FLAT_SYSTEM_MEMORY,
+ ConfigureLabels.FEATURE_DESCRIPTION_FLAT_SYSTEM_MEMORY,
+ ConfigureLabels.FEATURE_PAGE_FLAT_SYSTEM_MEMORY,
+ TimelineChartLabels.SYSTEM_MEMORY_CHART_TITLE),
+
+ PROCESS_MEMORY(202, ConfigureLabels.FEATURE_NAME_PROCESS_MEMORY,
+ ConfigureLabels.FEATURE_DESCRIPTION_PROCESS_MEMORY,
+ ConfigureLabels.FEATURE_PAGE_PROCESS_MEMORY,
+ TimelineChartLabels.PROCESS_MEMORY_CHART_TITLE),
+
+ MEMORY_ALLOC(203, ConfigureLabels.FEATURE_NAME_MEMORY_ALLOC,
+ ConfigureLabels.FEATURE_DESCRIPTION_MEMORY_ALLOC,
+ ConfigureLabels.FEATURE_PAGE_MEMORY_ALLOC,
+ TimelineChartLabels.HEAP_CHART_TITLE),
+
+ // Group300 File system
+ DISK_IO(301, ConfigureLabels.FEATURE_NAME_DISK_IO,
+ ConfigureLabels.FEATURE_DESCRIPTION_DISK_IO,
+ ConfigureLabels.FEATURE_PAGE_DISK_IO,
+ TimelineChartLabels.DISK_IO_CHART_TITLE),
+
+ FILE_ANALYSIS(302, ConfigureLabels.FEATURE_NAME_FILE,
+ ConfigureLabels.FEATURE_DESCRIPTION_FILE,
+ ConfigureLabels.FEATURE_PAGE_FILE,
+ TimelineChartLabels.FILE_CHART_TITLE),
+
+ // Group400 Graphics
+ OPENGLES_ANALYSIS(401, ConfigureLabels.FEATURE_NAME_OPENGLES,
+ ConfigureLabels.FEATURE_DESCRIPTION_OPENGLES,
+ ConfigureLabels.FEATURE_PAGE_OPENGLES,
+ GLPageLabels.GL_CHART_TITLE_FRAME_RATE),
+
+ // Group500 Network
+ NETWORK_IO(501, ConfigureLabels.FEATURE_NAME_NETWORK_IO,
+ ConfigureLabels.FEATURE_DESCRIPTION_NETWORK_IO,
+ ConfigureLabels.FEATURE_PAGE_NETWORK_IO,
+ TimelineChartLabels.NETWORK_IO_CHART_TITLE),
+
+ NETWORK_ANALYSIS(502, ConfigureLabels.FEATURE_NAME_NETWORK,
+ ConfigureLabels.FEATURE_DESCRIPTION_NETWORK,
+ ConfigureLabels.FEATURE_PAGE_NETWORK,
+ TimelineChartLabels.NETWORK_IO_CHART_TITLE),
+
+ // Group600 UI
+ UI_EVENT(601, ConfigureLabels.FEATURE_NAME_UI_EVENT,
+ ConfigureLabels.FEATURE_DESCRIPTION_UI_EVENT,
+ ConfigureLabels.FEATURE_PAGE_UI_EVENT,
+ TimelineChartLabels.UI_EVENT_CHART_TITLE),
+
+ SCREENSHOT(602, ConfigureLabels.FEATURE_NAME_SCREENSHOT,
+ ConfigureLabels.FEATURE_DESCRIPTION_SCREENSHOT,
+ ConfigureLabels.FEATURE_PAGE_SCREENSHOT,
+ TimelineChartLabels.SCREENSHOT_CHART_TITLE),
+
+ UI_HIERARCHY_ANALYSIS(603, ConfigureLabels.FEATURE_NAME_UI_HIERARCHY,
+ ConfigureLabels.FEATURE_DESCRIPTION_UI_HIERARCHY,
+ ConfigureLabels.FEATURE_PAGE_UI_HIERARCHY,
+ "UI Hierarchy"), // TODO: Replace constant
+
+ // Group700 Synchronization
+ THREAD_ANALYSIS(701, ConfigureLabels.FEATURE_NAME_THREAD,
+ ConfigureLabels.FEATURE_DESCRIPTION_THREAD,
+ ConfigureLabels.FEATURE_PAGE_THREAD,
+ ThreadPageLabels.THREAD_CHART_THREAD),
+
+ SYNC_ANALYSIS(702, ConfigureLabels.FEATURE_NAME_SYNC,
+ ConfigureLabels.FEATURE_DESCRIPTION_SYNC,
+ ConfigureLabels.FEATURE_PAGE_SYNC,
+ ThreadPageLabels.THREAD_CHART_SYNC),
+
+ // Group800 Energy
+ PERIPHERAL_STATUS(801, ConfigureLabels.FEATURE_NAME_PERIPHERAL_STATUS,
+ ConfigureLabels.FEATURE_DESCRIPTION_PERIPHERAL_STATUS,
+ ConfigureLabels.FEATURE_PAGE_PERIPHERAL_STATUS,
+ TimelineChartLabels.DEVICE_CHART_TITLE),
+ POWER_ESTIMATION(802, ConfigureLabels.FEATURE_NAME_POWER_ESTIMATION,
+ ConfigureLabels.FEATURE_DESCRIPTION_POWER_ESTIMATION,
+ ConfigureLabels.FEATURE_PAGE_POWER_ESTIMATION,
+ TimelineChartLabels.ENERGY_CHART_TITLE);
+
+ private int index = 0;
+ private String name = null;
+ private String description = null;
+ private String page = null;
+ private String chart = null;
+
+ private PrimitiveFeature(int index, String name, String description, String page, String chart) {
+ this.index = index;
+ this.name = name;
+ this.description = description;
+ this.page = page;
+ this.chart = chart;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getPage() {
+ return page;
+ }
+
+ public String getChart() {
+ return chart;
+ }
+}