import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
-import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.control.IProgress;
import org.tizen.dynamicanalyzer.protocol.DebugLog;
subCommunicator = new Communicator40(this);
break;
case VERSION_42:
- if(Global.getCurrentDeviceInfo() != null) {
- Global.getCurrentDeviceInfo().setMempAvailable(true);
- }
- case VERSION_41:
+ case VERSION_41:
subCommunicator = new Communicator41(this);
break;
default: // unknown version
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.handlers.UIAction;
+import org.tizen.dynamicanalyzer.protocol.Protocol;
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.sdblib.IDevice;
// set availability of root
devInfo.setAvailabilityOfRoot(CommunicatorUtils.enableRoot(device));
-
// connect with swap of device
DAResult result = devInfo.getCommunicator().connect();
if (result.isSuccess()) {
+ String devProtocol = devInfo.getCommunicator().getProtocolVersion();
+ if (devProtocol != null) {
+ try {
+ double versionNum = Double.parseDouble(devProtocol);
+
+ if (versionNum >= Protocol.VERSION_42.getVersionNum()) {
+ Logger.debug("set Memps Available");
+ devInfo.setMempAvailable(true);
+ }
+ } catch (Exception ex) {
+ Logger.debug("protocol version - " + devProtocol);
+ }
+ }
+
devices.add(devInfo);
bAdded = true;
}
case SEND_STARTMSG:
try {
DACommunicator.stopTrace();
- } catch (InterruptedException e) {
+ } catch (Exception e) {
// never happened currently
Logger.error("Interrupted during stop trace");
}
import org.tizen.dynamicanalyzer.setting.Feature;
public enum Protocol {
- VERSION_UNKNOWN(CommonConstants.EMPTY),
- VERSION_30("3.0"),
- VERSION_30A("3.0 a"),
- VERSION_30_UIHV("3.0_UIHV"),
- VERSION_40("4.0"),
- VERSION_41("4.1"),
- VERSION_42("4.2");
+ VERSION_UNKNOWN(CommonConstants.EMPTY, 0.0),
+ VERSION_30("3.0", 3.1),
+ VERSION_30A("3.0 a", 3.01),
+ VERSION_30_UIHV("3.0_UIHV", 3.02),
+ VERSION_40("4.0", 4.0),
+ VERSION_41("4.1", 4.1),
+ VERSION_42("4.2", 4.2);
private String versionName;
+ private double versionNum;
// data channel message name map for printing debug info
private static final Map<Integer, String> dataMsgNameMap;
dataMsgNameMap = Collections.unmodifiableMap(tempMap);
}
- private Protocol(String versionName) {
+ private Protocol(String versionName, double version) {
this.versionName = versionName;
+ this.versionNum = version;
}
@Override
return versionName;
}
+ public double getVersionNum() {
+ return versionNum;
+ }
+
public static Protocol getVersion(String versionString) {
Protocol[] versions = Protocol.values();
for (Protocol ver : versions) {
Map<FlatPreferences, ProtocolConfig40[]> tempMap = new EnumMap<FlatPreferences, ProtocolConfig40[]>(
FlatPreferences.class);
tempMap.put(FlatPreferences.RECORDING, new ProtocolConfig40[] { RECORDING });
- tempMap.put(FlatPreferences.FUNCTION_PROFILING, new ProtocolConfig40[] { FUNCTION_PROFILING });
- tempMap.put(FlatPreferences.APP_STARTUP, new ProtocolConfig40[] { APP_STARTUP });
- tempMap.put(FlatPreferences.WEB_FUNCTION_PROFILING, new ProtocolConfig40[] { WEB_FUNCTION_PROFILING });
- tempMap.put(FlatPreferences.WEBAPP_STARTUP, new ProtocolConfig40[] { WEBAPP_STARTUP });
+ tempMap.put(FlatPreferences.FUNCTION_PROFILING, new ProtocolConfig40[] { FUNCTION_PROFILING,
+ WEB_FUNCTION_PROFILING});
+ tempMap.put(FlatPreferences.APP_STARTUP, new ProtocolConfig40[] { APP_STARTUP,
+ WEBAPP_STARTUP});
tempMap.put(FlatPreferences.SYSTEM_ALL_PROCESSES, new ProtocolConfig40[] { SYSTEM_PROCESSES_LOAD });
tempMap.put(FlatPreferences.PROCESS_MEMORY, new ProtocolConfig40[] { SYSTEM_PROCESS });
Map<FlatPreferences, ProtocolConfig41[]> tempMap = new EnumMap<FlatPreferences, ProtocolConfig41[]>(
FlatPreferences.class);
tempMap.put(FlatPreferences.RECORDING, new ProtocolConfig41[] { RECORDING });
- tempMap.put(FlatPreferences.FUNCTION_PROFILING, new ProtocolConfig41[] { FUNCTION_PROFILING });
- tempMap.put(FlatPreferences.APP_STARTUP, new ProtocolConfig41[] { APP_STARTUP });
- tempMap.put(FlatPreferences.WEB_FUNCTION_PROFILING, new ProtocolConfig41[] { WEB_FUNCTION_PROFILING });
- tempMap.put(FlatPreferences.WEBAPP_STARTUP, new ProtocolConfig41[] { WEBAPP_STARTUP });
+ tempMap.put(FlatPreferences.FUNCTION_PROFILING, new ProtocolConfig41[] { FUNCTION_PROFILING,
+ WEB_FUNCTION_PROFILING});
+ tempMap.put(FlatPreferences.APP_STARTUP, new ProtocolConfig41[] { APP_STARTUP,
+ WEBAPP_STARTUP});
tempMap.put(FlatPreferences.SYSTEM_ALL_PROCESSES, new ProtocolConfig41[] { SYSTEM_PROCESSES_LOAD });
tempMap.put(FlatPreferences.PROCESS_MEMORY, new ProtocolConfig41[] { SYSTEM_PROCESS });
public static byte[] getFlatFeatureFlagValue(Set<FlatFeature> flatFeatures, Set<FlatPreferences> selectedPreferences) {
long lowValue = 0;
long highValue = 0;
+
if (flatFeatures != null) {
- Logger.debug(flatFeatures);
for (FlatFeature flatFeature : flatFeatures) {
ProtocolConfig41[] configs = flatFeatureProtocolMap.get(flatFeature);
if (configs != null) {
+ Logger.debug(flatFeature);
for (int i = 0; i < configs.length; i++) {
int bitshift = configs[i].getShift();
if (bitshift >= 64) { // high 8byte bit
}
}
}
-
if (selectedPreferences != null) {
- Logger.debug(selectedPreferences);
for (FlatPreferences feature : selectedPreferences) {
ProtocolConfig41[] configs = preferencesProtocolMap.get(feature);
if (configs != null) {
+ Logger.debug(feature);
for (int i = 0; i < configs.length; i++) {
int bitshift = configs[i].getShift();
if (bitshift >= 64) { // high 8byte bit
if (!isOptionsSelectedPrefereces(FlatPreferences.APP_STARTUP)) {
selectedFeatures.add(FlatPreferences.APP_STARTUP);
}
- if (!isOptionsSelectedPrefereces(FlatPreferences.WEB_FUNCTION_PROFILING)) {
- selectedFeatures.add(FlatPreferences.WEB_FUNCTION_PROFILING);
- }
- if (!isOptionsSelectedPrefereces(FlatPreferences.WEBAPP_STARTUP)) {
- selectedFeatures.add(FlatPreferences.WEBAPP_STARTUP);
- }
if (!isOptionsSelectedPrefereces(FlatPreferences.SYSTEM_ALL_PROCESSES)) {
selectedFeatures.add(FlatPreferences.SYSTEM_ALL_PROCESSES);
}
bottomLeftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- DataManagerRegistry.registerPageDataManager(MemoryDataManager.getInstance());
+ //DataManagerRegistry.registerPageDataManager(MemoryDataManager.getInstance());
DataManagerRegistry.registerPageDataManager(HeapDataManager.getInstance());
}
import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
import org.tizen.dynamicanalyzer.ui.info.screenshot.ScreenshotDataManager;
import org.tizen.dynamicanalyzer.ui.interactive.data.InteractiveDataManager;
+import org.tizen.dynamicanalyzer.ui.memory.data.MemoryDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.calltrace.CallTraceDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.calltrace.CallTraceView;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartManager;
DataManagerRegistry.registerPageDataManager(CallTraceDataManager.getInstance());
DataManagerRegistry.registerPageDataManager(InteractiveDataManager.getInstance());
DataManagerRegistry.registerPageDataManager(ScreenshotDataManager.getInstance());
+ DataManagerRegistry.registerPageDataManager(MemoryDataManager.getInstance());
}
@Override
import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;
import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;
import org.tizen.dynamicanalyzer.ui.info.screenshot.ScreenshotDataManager;
+import org.tizen.dynamicanalyzer.ui.memory.data.MemoryDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.CustomDataDBTable;
import org.tizen.dynamicanalyzer.ui.timeline.LifeCycleDBTable;
import org.tizen.dynamicanalyzer.ui.timeline.SystemDataDBTable;
if (Toolbar.INSTANCE != null) {
selectedPID = Toolbar.INSTANCE.getSelectedPid();
}
- Map<Integer, List<List<Object>>> targetProcessDBData = getTargetProcessDataFromDB(
- startTime, endTime, selectedPID);
+
+ Map<Integer, List<List<Object>>> targetProcessDBData = getTargetProcessDataFromDB(startTime, endTime, selectedPID);
/*
* 2. Make series of chart
continue;
}
- if (chart.getProbeType() == ProtocolConstants.MSG_DATA_SYSTEM) {
+ if (chart.getChartType() == TimelineConstants.CHART_TYPE_PROCESS_MEMORY) {
+ List<Object> dataList = new ArrayList<Object>();
+ targetProcessDBData = MemoryDataManager.getInstance()
+ .getTargetProcessDataMapFromDB(startTime, endTime, selectedPID);
+
+ dataList.add(systemDBData);
+ dataList.add(targetProcessDBData);
+ chart.inputChartSeries(dataList);
+ } else if (chart.getProbeType() == ProtocolConstants.MSG_DATA_SYSTEM) {
List<Object> dataList = new ArrayList<Object>();
dataList.add(systemDBData);
dataList.add(targetProcessDBData);