From ceab688900aae1884d5d7b1cf84e67c6eb925d22 Mon Sep 17 00:00:00 2001 From: jooyoul_lee Date: Fri, 25 Oct 2013 11:06:05 +0900 Subject: [PATCH] [Title] BUG fixed [Desc.] runtime configuration bug fixed, start trace config bug fixed [Issue] TIDS-7381 --- .../dynamicanalyzer/common/CommonConstants.java | 1 + .../dynamicanalyzer/handlers/OpenTraceHandler.java | 157 ++++----------- .../handlers/ReplayTraceHandler.java | 2 +- .../listeners/AnalyzerPerspectiveListener.java | 2 +- .../org/tizen/dynamicanalyzer/project/Project.java | 109 +++++++---- .../org/tizen/dynamicanalyzer/sql/DBTableInfo.java | 11 ++ .../tizen/dynamicanalyzer/sql/DBTableManager.java | 106 +++++----- .../org/tizen/dynamicanalyzer/sql/SqlManager.java | 218 ++++++++++----------- .../swap/communicator/Communicator30.java | 14 +- .../swap/logparser/MessageParser.java | 16 +- .../swap/logparser/SWAPLogParser.java | 1 - .../tizen/dynamicanalyzer/swap/model/DATime.java | 12 ++ .../swap/model/control/TargetInfo.java | 16 ++ .../swap/model/data/BasicDataMessage.java | 8 +- .../swap/model/data/ProcessInfo.java | 27 ++- .../dynamicanalyzer/swap/model/probe2/LogData.java | 2 +- .../swap/model/probe2/ReplayData.java | 2 +- .../dynamicanalyzer/ui/file/FileChartData.java | 10 +- .../ui/file/FileChartDataEvent.java | 8 +- .../dynamicanalyzer/ui/file/FileDataMaker.java | 4 +- .../ui/network/NetworkChartData.java | 10 +- .../ui/network/NetworkChartDataEvent.java | 8 +- .../ui/network/NetworkDataMaker.java | 4 +- .../ui/summary/failed/FailedApiTable.java | 5 +- .../ui/summary/failed/FailedChecker.java | 9 +- .../summary/failed/FailedData.java} | 37 +++- .../summary/leaks/LeakData.java} | 100 ++++++---- .../ui/summary/leaks/LeakDetector.java | 31 ++- .../ui/summary/leaks/LeakTable.java | 13 +- .../ui/summary/warning/WarningData.java | 25 ++- .../dynamicanalyzer/ui/thread/ThreadPageData.java | 4 +- .../thread/thread/ThreadPageThreadDataManager.java | 2 +- .../toolbar/configuration/ConfigurationDialog.java | 5 +- .../ui/toolbar/opentrace/OpenTraceDialog.java | 16 +- .../ui/toolbar/opentrace/OpenTraceInputReader.java | 8 +- .../ui/toolbar/opentrace/SaveFilesTable.java | 7 +- 36 files changed, 554 insertions(+), 456 deletions(-) rename org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/{swap/model/probe2/FailedData2.java => ui/summary/failed/FailedData.java} (77%) rename org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/{swap/model/probe2/LeakData2.java => ui/summary/leaks/LeakData.java} (61%) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/CommonConstants.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/CommonConstants.java index 273cbaf..180ca13 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/CommonConstants.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/CommonConstants.java @@ -61,6 +61,7 @@ public class CommonConstants { public static final String ON = "on"; //$NON-NLS-1$ public static final String OFF = "off"; //$NON-NLS-1$ public static final String PLUS = "+"; //$NON-NLS-1$ + public static final String QUESION_MARK = "?"; //$NON-NLS-1$ public static final String EOS = "\0";//$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java index d0e5226..4d60ca6 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java @@ -36,7 +36,6 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; -import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.communicator.DACommunicator; @@ -46,20 +45,19 @@ import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; import org.tizen.dynamicanalyzer.project.Project; import org.tizen.dynamicanalyzer.resources.ImageResources; import org.tizen.dynamicanalyzer.sql.SqlManager; -import org.tizen.dynamicanalyzer.swap.model.DATime; import org.tizen.dynamicanalyzer.swap.model.control.TargetInfo; import org.tizen.dynamicanalyzer.swap.model.data.ApiNameManager; import org.tizen.dynamicanalyzer.swap.model.data.DataChannelConstants; import org.tizen.dynamicanalyzer.swap.model.data.LibraryObject; import org.tizen.dynamicanalyzer.swap.model.data.ProcessInfo; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; -import org.tizen.dynamicanalyzer.swap.model.probe2.LeakData2; import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData; import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit; import org.tizen.dynamicanalyzer.ui.page.DAPageComposite; import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; import org.tizen.dynamicanalyzer.ui.range.RangePage; import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker; +import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData; +import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakData; import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector; import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler; import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker; @@ -76,15 +74,15 @@ import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo; public class OpenTraceHandler extends AbstractHandler { public static final String ID = OpenTraceHandler.class.getName(); - Project p = null; + Project project = null; @Override public Object execute(ExecutionEvent event) throws ExecutionException { - p = AnalyzerManager.getProject(); + project = AnalyzerManager.getProject(); List pInfo = SqlManager.getInstance().getDetailsInfo( - p.getSavePath()); + project.getSavePath()); if (null == pInfo || pInfo.isEmpty()) { System.out.println("The trace file is invalid."); //$NON-NLS-1$ @@ -92,67 +90,10 @@ public class OpenTraceHandler extends AbstractHandler { AnalyzerUtil.executeCommand(ClearHandler.ID); return null; } + project.loadSaveFormat(pInfo); + OpenTraceProgressManager.getInstance().openTracePrgressStart( AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING); - int size = pInfo.size(); - // List logCenterNames = new ArrayList(); - for (int i = 0; i < size; i++) { - if (i == AnalyzerConstants.PROJECT_VERSION_INDEX) { - if (!AnalyzerConstants.SAVE_DATA_VERSION.equals(pInfo - .get(AnalyzerConstants.PROJECT_VERSION_INDEX))) { - System.out.println("The trace file version is invalid."); //$NON-NLS-1$ - OpenTraceProgressManager - .getInstance() - .closeOpenTraceDialog( - AnalyzerLabels.OPEN_TRACE_PROGRESS_VERSION_INVALID); - createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_VERSION_INVALID_REMOVE); - return null; - } - p.setVersion(AnalyzerConstants.SAVE_DATA_VERSION); - } else if (i == AnalyzerConstants.PROJECT_CREATE_TIME_INDEX) { - p.setCreateTime(pInfo.get(i)); - } else if (i == AnalyzerConstants.PROJECT_APPNAME_INDEX) { - p.setAppName(pInfo.get(i)); - } else if (i == AnalyzerConstants.PROJECT_PACKAGE_ID_INDEX) { - p.setPkgId(pInfo.get(i)); - } else if (i == AnalyzerConstants.PROJECT_STOP_TIME_INDEX) { - try { - long stopTime = Long.parseLong(pInfo.get(i)); - p.setStopTime(stopTime); - } catch (NumberFormatException e) { - invalidProgress(); - return null; - } - } else if (i == AnalyzerConstants.PROJECT_DEVICE_INDEX) { - p.setDevice(pInfo.get(i)); - } else if (i == AnalyzerConstants.PROJECT_LAST_DATA_INDEX) { - String lastNum = pInfo.get(i); - String[] splitLastNum = lastNum - .split(CommonConstants.CMD_SPLIT_READ); - try { - p.setLastLogNum(Long.parseLong(splitLastNum[0]), - DataChannelConstants.MSG_PROBE_FILE); - p.setLastLogNum(Long.parseLong(splitLastNum[1]), - DataChannelConstants.MSG_DATA_SYSTEM); - p.setLastLogNum(Long.parseLong(splitLastNum[2]), - DataChannelConstants.MSG_DATA_SAMPLE); - } catch (NumberFormatException e) { - invalidProgress(); - return null; - } catch (ArrayIndexOutOfBoundsException e) { - invalidProgress(); - return null; - } - } else if (i == AnalyzerConstants.PROJECT_LAST_TIME_INDEX) { - try { - long lastTime = Long.parseLong(pInfo.get(i)); - p.setLastTime(lastTime); - } catch (NumberFormatException e) { - invalidProgress(); - return null; - } - } - } if (!DACommunicator.isDeviceConnected()) { Display.getDefault().syncExec(new Runnable() { @@ -172,8 +113,9 @@ public class OpenTraceHandler extends AbstractHandler { } int percent = OpenTraceProgressManager.getInstance().getPercent(); - if (loadInfos() && loadCallStackData() && loadCallStackApis() - && loadProfilingData() && loadProfilingChildData() + if (loadInfos() +// && loadCallStackData() && loadCallStackApis() +// && loadProfilingData() && loadProfilingChildData() && loadLeakData() && loadFailedData() && loadImageSet()) { OpenTraceProgressManager.getInstance().setProgressPercent( @@ -187,9 +129,9 @@ public class OpenTraceHandler extends AbstractHandler { return null; } - ToolbarArea.getInstance().setTime(p.getLastTime()); - ToolbarArea.getInstance().setDeviceComboText(p.getDevice()); - ToolbarArea.getInstance().setAppComboText(p.getAppName()); + ToolbarArea.getInstance().setTime(project.getLastTime()); + ToolbarArea.getInstance().setDeviceComboText(project.getDevice()); + ToolbarArea.getInstance().setAppComboText(project.getAppName()); ToolbarArea.getInstance().checkStartButtonAndAppListEnablement(); ToolbarArea.getInstance().setRepalyButtonEnable(true); if (AnalyzerManager.getProject().getProcessInfoHash().isEmpty()) { @@ -296,23 +238,14 @@ public class OpenTraceHandler extends AbstractHandler { isSuccess = false; } else { List info = dbInfo.get(0); - TargetInfo target = new TargetInfo(); - target.setSystemMemorySize(Long.parseLong(info.get(0))); - target.setStorageSize(Long.parseLong(info.get(1))); - target.setBluetoothSupport(Integer.parseInt(info.get(2))); - target.setGpsSupport(Integer.parseInt(info.get(3))); - target.setWifiSupport(Integer.parseInt(info.get(4))); - target.setCameraCount(Integer.parseInt(info.get(5))); - target.setNetworkType(info.get(6)); - target.setMaxBrightness(Integer.parseInt(info.get(7))); - target.setCpuCount(Integer.parseInt(info.get(8))); - AnalyzerManager.getProject().setTargetInfo(target); + TargetInfo targetInfo = new TargetInfo(); + targetInfo.loadSaveFormat(info); + AnalyzerManager.getProject().setTargetInfo(targetInfo); } - dbInfo.clear(); dbInfo = SqlManager.getInstance().loadProcessInfo(); - HashMap processMap = AnalyzerManager - .getProject().getProcessInfoHash(); + HashMap processMap = AnalyzerManager.getProject() + .getProcessInfoHash(); if (null == dbInfo) { System.out.println("failed - load Process Info"); isSuccess = false; @@ -320,37 +253,29 @@ public class OpenTraceHandler extends AbstractHandler { for (int i = 0; i < dbInfo.size(); i++) { List info = dbInfo.get(i); ProcessInfo process = new ProcessInfo(); - process.setPid(Integer.parseInt(info.get(0))); - DATime startTime = new DATime(); - startTime.setSec(Integer.parseInt(info.get(1))); - startTime.setNano(Integer.parseInt(info.get(2))); - process.setStartTime(startTime); - process.setLowestAddress(Long.parseLong(info.get(3))); - process.setHighestAddress(Long.parseLong(info.get(4))); - process.setBinaryPath(info.get(7)); - process.setDepLibCount(Integer.parseInt(info.get(8))); + process.loadSaveFormat(info.get(i)); processMap.put(process.getPid(), process); - } - } - dbInfo.clear(); - dbInfo = SqlManager.getInstance().loadLibObj(); - if (null == dbInfo) { - System.out.println("failed - load Lib Object"); - isSuccess = false; - } else { - for (List info : dbInfo) { - LibraryObject libObj = new LibraryObject(); - libObj.setLowestAddress(Long.parseLong(info.get(0))); - libObj.setHighestAddress(Long.parseLong(info.get(1))); - libObj.setLibPath(info.get(2)); - int pid = Integer.parseInt(info.get(3)); - libObj.setPid(pid); - processMap.get(pid).getLibObjs().add(libObj); + String option = "where pid = " + process.getPid(); + List> objInfo = SqlManager.getInstance().loadLibObj(option); + if (null == objInfo) { + System.out.println("failed - load Lib Object"); + isSuccess = false; + } else { + for (List libInfo : objInfo) { + LibraryObject libObj = new LibraryObject(); + libObj.setPid(Integer.parseInt(libInfo.get(0))); + libObj.setLowestAddress(Long.parseLong(libInfo.get(1))); + libObj.setHighestAddress(Long.parseLong(libInfo.get(2))); + libObj.setLibPath(libInfo.get(3)); + process.getLibObjs().add(libObj); + process.getLibObjHash() + .put(libObj.getLibPath(), libObj); + } + } } } - dbInfo.clear(); dbInfo = SqlManager.getInstance().loadApiNames(); if (null == dbInfo) { System.out.println("failed - load Api names"); @@ -392,15 +317,15 @@ public class OpenTraceHandler extends AbstractHandler { boolean isSuccess = true; List> dbInfo = SqlManager.getInstance().setloadLeakData(); if (null == dbInfo) { - System.out.println("failed - loadLeakData"); + System.out.println("leak data loading failed.."); isSuccess = false; } else { LeakDetector leakDectector = AnalyzerManager.getLeakDetector(); for (int i = 0; i < dbInfo.size(); i++) { - List pInfo = dbInfo.get(i); - LeakData2 leakData = new LeakData2(pInfo); + List info = dbInfo.get(i); + LeakData leakData = new LeakData(info); if (-1 != leakData.getParentKey()) { - LeakData2 parent = leakDectector.getLeakHash().get( + LeakData parent = leakDectector.getLeakHash().get( leakData.getParentKey()); if (null == parent) { continue; @@ -438,7 +363,7 @@ public class OpenTraceHandler extends AbstractHandler { continue; } } - FailedData2 failedData = new FailedData2(pInfo); + FailedData failedData = new FailedData(pInfo); failedChecker.getFailedList().add(failedData); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ReplayTraceHandler.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ReplayTraceHandler.java index 1e2f5fc..e424fcf 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ReplayTraceHandler.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ReplayTraceHandler.java @@ -75,7 +75,7 @@ public class ReplayTraceHandler extends AbstractHandler { } else { isReplay = true; stopTime = AnalyzerManager.getProject().getStopTime(); - startTime = AnalyzerManager.getProject().getStartTime(); + startTime = AnalyzerManager.getProject().getProfileStartTime(); // make replay event // on/off , replay start time, count, event objs diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/AnalyzerPerspectiveListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/AnalyzerPerspectiveListener.java index 671cba2..4386d78 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/AnalyzerPerspectiveListener.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/AnalyzerPerspectiveListener.java @@ -45,7 +45,7 @@ public class AnalyzerPerspectiveListener extends PerspectiveAdapter { DACommunicator.addDeviceListener(); DACommunicator.loadDevices(); DACommunicator.updateToolbarDevice(); - DACommunicator.setSelectedApp(DACommunicator.getSelectedApp()); +// DACommunicator.setSelectedApp(DACommunicator.getSelectedApp()); init = true; } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java index 196d079..8433087 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java @@ -30,6 +30,7 @@ import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Locale; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; @@ -49,39 +50,57 @@ import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler; import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; public class Project { - public static final String TABLE_NAME = "project"; - - public static final String APP_NAME = "AppName"; - public static final String CREATE_TIME = "CreateTime"; - public static final String SAVE_PATH = "SavePath"; - public static final String LOG_NUMS = "LastLogs"; - public static final String SAVE_VERSION = "Version"; - public static final String PACKAGE_ID = "pkgID"; - public static final String DEVICE = "Device"; - public static final String LAST_TIME = "LastTime"; - public static final String STOP_TIME = "StopTime"; + // public static final String TABLE_NAME = "project"; + + private static final int INDEX_VERSION = 0; + private static final int INDEX_DEVICE = 1; + private static final int INDEX_PACKAGE_ID = 2; + private static final int INDEX_APP_NAME = 3; + private static final int INDEX_CREATE_TIME = 4; + private static final int INDEX_LAST_TIME = 5; + private static final int INDEX_STOP_TIME = 6; + private static final int INDEX_PROF_START_TIME = 7; + private static final int INDEX_LOG_COUNT = 8; + private static final int INDEX_SYSTEM_COUNT = 9; + private static final int INDEX_PROFILE_COUNT = 10; + private static final int INDEX_SAVE_PATH = 11; + private static final int INDEX_MAIN_PID = 12; + + // public static final String APP_NAME = "AppName"; + // public static final String CREATE_TIME = "CreateTime"; + // public static final String SAVE_PATH = "SavePath"; + // public static final String LOG_NUMS = "LastLogs"; + // public static final String SAVE_VERSION = "Version"; + // public static final String PACKAGE_ID = "pkgID"; + // public static final String DEVICE = "Device"; + // public static final String LAST_TIME = "LastTime"; + // public static final String STOP_TIME = "StopTime"; // public static final int COLUMN_SIZE = 8; private final static int MAX_FILENAME_LENGTH = 50; - private final String DEFAULT_TIME_FORMAT = "_yyyy-MM-dd-HH-mm-ss";//$NON-NLS-1$ - private String appName = null; - private String pkgId = null; - private String createTime = null; - private String savePath; - private long lastLogNum = 0; - private long lastDeviceLogNum = 0; - private long lastProfileLogNum = 0; + private String version = null; private String device = null; + private String pkgId = null; + private String appName = null; + + private String createTime = null; private long lastTime = 0; private long stopTime = -1; private DATime profilingStartTime = new DATime(); + private long lastLogNum = 0; + private long lastDeviceLogNum = 0; + private long lastProfileLogNum = 0; + + private String savePath; + + private int mainPid = -1; + private byte[] replayEvent = null; - private ProcessInfo mainProcessInfo = new ProcessInfo(); private HashMap processInfoHash = new HashMap(); public TargetInfo getTargetInfo() { @@ -111,11 +130,11 @@ public class Project { return getTargetInfo().getMaxBrightness(); } - public DATime getStartTime() { + public DATime getProfileStartTime() { return profilingStartTime; } - public void setStartTime(DATime time) { + public void setProfileStartTime(DATime time) { profilingStartTime = time; } @@ -147,14 +166,16 @@ public class Project { return version; } - public long getLastLogNum(int type) { - if (type == DataChannelConstants.MSG_DATA_SYSTEM) { - return lastDeviceLogNum; - } else if (type == DataChannelConstants.MSG_DATA_SAMPLE) { - return lastProfileLogNum; - } else { - return lastLogNum; - } + public long getLogCount() { + return lastLogNum; + } + + public long getDeviceLogCount() { + return lastDeviceLogNum; + } + + public long getProfileLogCount() { + return lastProfileLogNum; } // for save @@ -251,10 +272,10 @@ public class Project { AnalyzerManager.setProject(this); // create table - SqlManager.getInstance().createProjectTable(this); + // SqlManager.getInstance().createProjectTable(this); // create save tables - SqlManager.getInstance().createProbeTable(); SqlManager.getInstance().createTables(); + SqlManager.getInstance().createProbeTable(); // create replay data if (ReplayTraceHandler.isReplay) { @@ -324,11 +345,27 @@ public class Project { return processInfoHash; } - public ProcessInfo getMainProcessInfo() { - return mainProcessInfo; + public int getMainPid() { + return mainPid; + } + + public void setMainPid(int mainPid) { + this.mainPid = mainPid; } - public void setMainProcessInfo(ProcessInfo mainProcessInfo) { - this.mainProcessInfo = mainProcessInfo; + public void loadSaveFormat(List data) { + version = data.get(INDEX_VERSION); + device = data.get(INDEX_DEVICE); + pkgId = data.get(INDEX_PACKAGE_ID); + appName = data.get(INDEX_APP_NAME); + createTime = data.get(INDEX_CREATE_TIME); + lastTime = Long.parseLong(data.get(INDEX_LAST_TIME)); + stopTime = Long.parseLong(data.get(INDEX_STOP_TIME)); + profilingStartTime.loadSaveFormat(data.get(INDEX_PROF_START_TIME)); + lastLogNum = Long.parseLong(data.get(INDEX_LOG_COUNT)); + lastDeviceLogNum = Long.parseLong(data.get(INDEX_SYSTEM_COUNT)); + lastProfileLogNum = Long.parseLong(data.get(INDEX_PROFILE_COUNT)); +// savePath = data.get(INDEX_SAVE_PATH); + mainPid = Integer.parseInt(data.get(INDEX_MAIN_PID)); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableInfo.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableInfo.java index 5f3bdfe..541e703 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableInfo.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableInfo.java @@ -161,4 +161,15 @@ public class DBTableInfo { public void setColumnTypes(String[] columnTypes) { this.columnTypes = columnTypes; } + + public String getQuestionMarks() { + StringBuffer questionMarks = new StringBuffer(); + for (int i = 0; i < columnNames.length; i++) { + questionMarks.append(CommonConstants.QUESION_MARK); + if (i + 1 != columnNames.length) { + questionMarks.append(CommonConstants.COMMA); + } + } + return questionMarks.toString(); + } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java index b5fd91f..5b01933 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java @@ -36,12 +36,7 @@ public class DBTableManager { public static DBTableManager instance = null; - public static final String COLUMN_ROWID = "rid"; - public static final String COLUMN_MSGID = "MessageId"; - public static final String COLUMN_SEQUENCE_NUM = "seqNumber"; - public static final String COLUMN_TIME = "time"; - public static final String COLUMN_PAYLOAD = "payload"; - + private static final String TABLE_NAME_PROJECT = "project";//$NON-NLS-1$ private static final String TABLE_NAME_CALLSTACK_UNITS = "CallstackUnits";//$NON-NLS-1$ private static final String TABLE_NAME_CALLSTACK_DATA = "CallstackData";//$NON-NLS-1$ private static final String TABLE_NAME_FAILED_DATA = "FailedData";//$NON-NLS-1$ @@ -53,22 +48,24 @@ public class DBTableManager { private static final String TABLE_NAME_LIB_OBJ = "LibraryObject";//$NON-NLS-1$ private static final String TABLE_NAME_APINAME = "ApiName";//$NON-NLS-1$ private static final String TABLE_NAME_GLES20_CONTEXT_DATA = "Gles20ContextData";//$NON-NLS-1$ -// private static final String TABLE_NAME_GLES20_CAHNGE_INFO = "Gles20ChangeInfo";//$NON-NLS-1$ + // private static final String TABLE_NAME_GLES20_CAHNGE_INFO = "Gles20ChangeInfo";//$NON-NLS-1$ private static List tableInfos; - public static final int TABLE_INDEX_CALLSTACK_UNITS = 0; - public static final int TABLE_INDEX_CALLSTACK_DATA = 1; - public static final int TABLE_INDEX_FAILED_DATA = 2; - public static final int TABLE_INDEX_LEAK_DATA = 3; - public static final int TABLE_INDEX_PROFILING_DATA = 4; - public static final int TABLE_INDEX_PROFILING_CHILD_DATA = 5; - public static final int TABLE_INDEX_TARGET_INFO = 6; - public static final int TABLE_INDEX_PROCESS_INFO = 7; - public static final int TABLE_INDEX_LIB_OBJ = 8; - public static final int TABLE_INDEX_APINAME = 9; - public static final int TABLE_INDEX_GLES20_CONTEXT_DATA = 10; - public static final int TABLE_INDEX_GLES20_CHANGE_INFO = 11; + public static final int TABLE_INDEX_PROJECT = 0; + public static final int TABLE_INDEX_CALLSTACK_UNITS = 1; + public static final int TABLE_INDEX_CALLSTACK_DATA = 2; + public static final int TABLE_INDEX_FAILED_DATA = 3; + public static final int TABLE_INDEX_LEAK_DATA = 4; + public static final int TABLE_INDEX_PROFILING_DATA = 5; + public static final int TABLE_INDEX_PROFILING_CHILD_DATA = 6; + public static final int TABLE_INDEX_TARGET_INFO = 7; + public static final int TABLE_INDEX_PROCESS_INFO = 8; + public static final int TABLE_INDEX_LIB_OBJ = 9; + public static final int TABLE_INDEX_APINAME = 10; + public static final int TABLE_INDEX_GLES20_CONTEXT_DATA = 11; + // public static final int TABLE_INDEX_GLES20_CHANGE_INFO = 12; + public static int TABLE_COUNT = 12; public static final String EMPTY = CommonConstants.EMPTY; public static final String TEXT = "VARCHAR(256)";//$NON-NLS-1$ @@ -119,15 +116,10 @@ public class DBTableManager { public static final String TARGET_INFO_NETWORK = "Network"; public static final String TARGET_INFO_MAX_BRIGHT = "Brightness"; public static final String TARGET_INFO_CPU_CORE_COUNT = "CoreCount"; + public static final String TARGET_INFO_DEVICE_COUNT = "DeviceCount"; + public static final String TARGET_INFO_DEVICES = "Devices"; - public static final String PROCESS_INFO_PID = "pid";//$NON-NLS-1$ - public static final String PROCESS_INFO_PPID = "ppid";//$NON-NLS-1$ - public static final String PROCESS_INFO_START_TIME_SEC = "StartTimeSec"; - public static final String PROCESS_INFO_START_TIME_NANO = "StartTimeNano"; - public static final String PROCESS_INFO_LOW_ADDR = "LowAddr"; - public static final String PROCESS_INFO_HIGH_ADDR = "HighAddr"; - public static final String PROCESS_INFO_BINARY_PATH = "BinaryPath"; - public static final String PROCESS_INFO_DEPLIB_COUNT = "DepLibCount"; + public static final String PROCESS_INFO = "ProcessInfo";//$NON-NLS-1$ public static final String LIBRARY_OBJECT_LOW_ADDR = "LowAddr"; public static final String LIBRARY_OBJECT_HIGH_ADDR = "HighAddr"; @@ -135,8 +127,6 @@ public class DBTableManager { public static final String APINAME_NAME = "name"; - public static int TABLE_COUNT = 11; - public static final String[] commonColumns = { COMMON_COLUMN_RID, COMMON_COLUMN_ID, COMMON_COLUMN_SEQ_NUMBER, COMMON_COLUMN_API_NAME, COMMON_COLUMN_TIME, COMMON_COLUMN_PID, COMMON_COLUMN_TID, @@ -176,6 +166,21 @@ public class DBTableManager { // init tableInfo; getTableInfos(); + // "project" table info block + { + String[] names = { "SaveVersion", "Device", "PackageId", "AppName", + "CreateTime", "LastTime", "StopTime", "ProfileStartTime", + "LogCount", "DeviceLogCount", "ProfileLogCount", + "SavePath", "MainPid" }; + String[] options = { EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, + EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY }; + String[] types = { TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, + TEXT, TEXT, TEXT, TEXT, TEXT }; + DBTableInfo projectInfo = new DBTableInfo(TABLE_NAME_PROJECT, + names, options, types); + tableInfos.set(TABLE_INDEX_PROJECT, projectInfo); + } + // "callstack units" table info block { String[] names = { CUSTOM_COLUMN_ADDR, CUSTOM_COLUMN_API, @@ -202,11 +207,12 @@ public class DBTableManager { // "failed data" table info block { String[] names = { "Rid", "MsgId", "SeqNumber", "Time", "ApiName", - "Parameter", "Return", "ErrorCode", "CallerPc" }; + "Parameter", "Return", "ErrorCode", "CallerPc", "Pid", + "LibName" }; String[] options = { EMPTY, EMPTY, NOT_NULL, EMPTY, EMPTY, EMPTY, - EMPTY, EMPTY, EMPTY }; + EMPTY, EMPTY, EMPTY, EMPTY, EMPTY }; String[] types = { TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, - TEXT }; + TEXT, TEXT, TEXT }; DBTableInfo failedDataTableInfo = new DBTableInfo( TABLE_NAME_FAILED_DATA, names, options, types); tableInfos.set(TABLE_INDEX_FAILED_DATA, failedDataTableInfo); @@ -214,14 +220,14 @@ public class DBTableManager { // "leak data" table info block { - String[] names = { "Rid", "MsgId", "SeqNumber", "Time", "Address", - "ApiName", "Parameter", "Return", "Key", "LeakSeq", - "ParentKey", "CallerPc" }; + String[] names = { "Rid", "LeakSeq", "MsgId", "SeqNumber", "Time", + "ApiName", "Pid", "Address", "CallerPc", "Parameter", + "Return", "LibName", "Key", "ParentKey" }; // commonColumns; - String[] options = { EMPTY, EMPTY, NOT_NULL, EMPTY, EMPTY, EMPTY, - EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY }; + String[] options = { EMPTY, EMPTY, EMPTY, NOT_NULL, EMPTY, EMPTY, + EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY }; String[] types = { TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, - TEXT, TEXT, TEXT, TEXT }; + TEXT, TEXT, TEXT, TEXT, TEXT, TEXT }; DBTableInfo leakDataTableInfo = new DBTableInfo( TABLE_NAME_LEAK_DATA, names, options, types); tableInfos.set(TABLE_INDEX_LEAK_DATA, leakDataTableInfo); @@ -260,11 +266,12 @@ public class DBTableManager { TARGET_INFO_STORAGE_SIZE, TARGET_INFO_BLUETOOTH, TARGET_INFO_GPS, TARGET_INFO_WIFI, TARGET_INFO_CAMERA, TARGET_INFO_NETWORK, TARGET_INFO_MAX_BRIGHT, - TARGET_INFO_CPU_CORE_COUNT }; + TARGET_INFO_CPU_CORE_COUNT, TARGET_INFO_DEVICE_COUNT, + TARGET_INFO_DEVICES }; String[] options = { EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, - EMPTY, EMPTY, EMPTY }; + EMPTY, EMPTY, EMPTY, EMPTY, EMPTY }; String[] types = { TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, - TEXT }; + TEXT, TEXT, TEXT }; DBTableInfo targetInfoTableInfo = new DBTableInfo( TABLE_NAME_TARGET_INFO, names, options, types); tableInfos.set(TABLE_INDEX_TARGET_INFO, targetInfoTableInfo); @@ -272,13 +279,9 @@ public class DBTableManager { // process info { - String[] names = { PROCESS_INFO_PID, PROCESS_INFO_PPID, - PROCESS_INFO_START_TIME_SEC, PROCESS_INFO_START_TIME_NANO, - PROCESS_INFO_LOW_ADDR, PROCESS_INFO_HIGH_ADDR, - PROCESS_INFO_BINARY_PATH, PROCESS_INFO_DEPLIB_COUNT }; - String[] options = { EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, - EMPTY, EMPTY }; - String[] types = { TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT }; + String[] names = { PROCESS_INFO }; + String[] options = { EMPTY }; + String[] types = { TEXT }; DBTableInfo processInfoTableInfo = new DBTableInfo( TABLE_NAME_PROCESS_INFO, names, options, types); tableInfos.set(TABLE_INDEX_PROCESS_INFO, processInfoTableInfo); @@ -286,9 +289,8 @@ public class DBTableManager { // library object { - String[] names = { LIBRARY_OBJECT_LOW_ADDR, - LIBRARY_OBJECT_HIGH_ADDR, LIBRARY_OBJECT_PATH, - COMMON_COLUMN_PID }; + String[] names = { COMMON_COLUMN_PID, LIBRARY_OBJECT_LOW_ADDR, + LIBRARY_OBJECT_HIGH_ADDR, LIBRARY_OBJECT_PATH }; String[] options = { EMPTY, EMPTY, EMPTY, EMPTY }; String[] types = { TEXT, TEXT, TEXT, TEXT }; DBTableInfo libObjTableInfo = new DBTableInfo(TABLE_NAME_LIB_OBJ, @@ -317,7 +319,7 @@ public class DBTableManager { for (int i = 0; i < length; i++) { names[i] = glContextDBEnum[i].getcolumnName(); options[i] = EMPTY; - if(i == GLContextDBEnum.FRAME_INDEX.ordinal()) { + if (i == GLContextDBEnum.FRAME_INDEX.ordinal()) { types[i] = INTEGER; } else { types[i] = TEXT; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java index 457d3b9..b8d06df 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java @@ -27,10 +27,6 @@ */ package org.tizen.dynamicanalyzer.sql; -import static org.tizen.dynamicanalyzer.common.CommonConstants.COMMA; -import static org.tizen.dynamicanalyzer.common.CommonConstants.SPACE; -import static org.tizen.dynamicanalyzer.sql.DBTableManager.TEXT; - import java.io.File; import java.sql.Connection; import java.sql.DriverManager; @@ -44,7 +40,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; -import java.util.Set; import java.util.concurrent.Semaphore; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; @@ -60,14 +55,14 @@ import org.tizen.dynamicanalyzer.swap.model.data.LibraryObject; import org.tizen.dynamicanalyzer.swap.model.data.ProcessInfo; import org.tizen.dynamicanalyzer.swap.model.probe.LogFormat; import org.tizen.dynamicanalyzer.swap.model.probe.ReplayLogFormat; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; -import org.tizen.dynamicanalyzer.swap.model.probe2.LeakData2; import org.tizen.dynamicanalyzer.swap.model.probe2.LogData; import org.tizen.dynamicanalyzer.swap.model.probe2.LogDataFactory; import org.tizen.dynamicanalyzer.swap.model.probe2.ReplayData; import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData; import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit; import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker; +import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData; +import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakData; import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector; import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler; import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker; @@ -145,7 +140,6 @@ public class SqlManager { try { semaphore.acquire(); } catch (InterruptedException e) { - // TODO Auto-generated catch block e.printStackTrace(); } } @@ -267,50 +261,50 @@ public class SqlManager { return query.toString(); } - public void createProjectTable(Project project) { - Statement stat = null; - try { - Connection conn = getConnection(); - if (null == conn) { - return; - } - semaphoreAcquire(); - stat = conn.createStatement(); - stat.executeUpdate(createDropTableQuery(Project.TABLE_NAME)); //$NON-NLS-1$ - - StringBuffer buf = new StringBuffer("create table ").append( - Project.TABLE_NAME).append(" ("); - buf.append(Project.APP_NAME).append(SPACE).append(TEXT) - .append(COMMA); - buf.append(Project.CREATE_TIME).append(SPACE).append(TEXT) - .append(COMMA); - buf.append(Project.SAVE_PATH).append(SPACE).append(TEXT) - .append(COMMA); - buf.append(Project.LOG_NUMS).append(SPACE).append(TEXT) - .append(COMMA); - buf.append(Project.SAVE_VERSION).append(SPACE).append(TEXT) - .append(COMMA); - buf.append(Project.PACKAGE_ID).append(SPACE).append(TEXT) - .append(COMMA); - buf.append(Project.DEVICE).append(SPACE).append(TEXT).append(COMMA); - buf.append(Project.LAST_TIME).append(SPACE).append(TEXT) - .append(COMMA); - buf.append(Project.STOP_TIME).append(SPACE).append(TEXT); - buf.append(CommonConstants.CLOSE_BRACKET).append( - CommonConstants.SEMICOLON); - stat.executeUpdate(buf.toString()); - System.out.println("createProjectTable : " + buf.toString()); - } catch (SQLException e) { - e.printStackTrace(); - } finally { - AnalyzerUtil.tryClose(stat); - semaphoreRelease(); - } - } + // public void createProjectTable(Project project) { + // Statement stat = null; + // try { + // Connection conn = getConnection(); + // if (null == conn) { + // return; + // } + // semaphoreAcquire(); + // stat = conn.createStatement(); + // stat.executeUpdate(createDropTableQuery(Project.TABLE_NAME)); //$NON-NLS-1$ + // + // StringBuffer buf = new StringBuffer("create table ").append( + // Project.TABLE_NAME).append(" ("); + // buf.append(Project.APP_NAME).append(SPACE).append(TEXT) + // .append(COMMA); + // buf.append(Project.CREATE_TIME).append(SPACE).append(TEXT) + // .append(COMMA); + // buf.append(Project.SAVE_PATH).append(SPACE).append(TEXT) + // .append(COMMA); + // buf.append(Project.LOG_NUMS).append(SPACE).append(TEXT) + // .append(COMMA); + // buf.append(Project.SAVE_VERSION).append(SPACE).append(TEXT) + // .append(COMMA); + // buf.append(Project.PACKAGE_ID).append(SPACE).append(TEXT) + // .append(COMMA); + // buf.append(Project.DEVICE).append(SPACE).append(TEXT).append(COMMA); + // buf.append(Project.LAST_TIME).append(SPACE).append(TEXT) + // .append(COMMA); + // buf.append(Project.STOP_TIME).append(SPACE).append(TEXT); + // buf.append(CommonConstants.CLOSE_BRACKET).append( + // CommonConstants.SEMICOLON); + // stat.executeUpdate(buf.toString()); + // System.out.println("createProjectTable : " + buf.toString()); + // } catch (SQLException e) { + // e.printStackTrace(); + // } finally { + // AnalyzerUtil.tryClose(stat); + // semaphoreRelease(); + // } + // } public String createDropTableQuery(String target) { StringBuffer query = new StringBuffer(); - query.append("drop table if exists "); //$NON-NLS-1$ + query.append("drop table if exists "); //$NON-NLS-1$ TODO query.append(target); query.append(CommonConstants.SEMICOLON); return query.toString(); @@ -412,20 +406,26 @@ public class SqlManager { } public void insertProject() { - String insertQuery = "insert into project values ( ?, ?, ?, ?, ?, ?, ?, ?, ? );"; //$NON-NLS-1$ + DBTableInfo info = DBTableManager.getInstance().getTableInfo( + DBTableManager.TABLE_INDEX_PROJECT); + String insertQuery = "insert into " + info.getTableName() + " values ( " + info.getQuestionMarks() + " );"; //$NON-NLS-1$ Project project = AnalyzerManager.getProject(); List insetRowData = new ArrayList(); - insetRowData.add(project.getAppName()); - insetRowData.add(project.getCreateTime()); - insetRowData.add(project.getSavePath()); - insetRowData.add(project.getLastLogNumbers()); insetRowData.add(project.getVersion()); - insetRowData.add(project.getPkgId()); insetRowData.add(project.getDevice()); + insetRowData.add(project.getPkgId()); + insetRowData.add(project.getAppName()); + insetRowData.add(project.getCreateTime()); insetRowData.add(Long.toString(project.getLastTime())); insetRowData.add(Long.toString(project.getStopTime())); + insetRowData.add(project.getProfileStartTime().getSaveFormat()); + insetRowData.add(Long.toString(project.getLogCount())); + insetRowData.add(Long.toString(project.getDeviceLogCount())); + insetRowData.add(Long.toString(project.getProfileLogCount())); + insetRowData.add(project.getSavePath()); + insetRowData.add(Integer.toString(project.getMainPid())); List> insetData = new ArrayList>(); insetData.add(insetRowData); @@ -437,7 +437,7 @@ public class SqlManager { DBTableInfo info = DBTableManager.getInstance().getTableInfo( DBTableManager.TABLE_INDEX_TARGET_INFO); - String insertQuery = "insert into " + info.getTableName() + " values ( ?, ?, ?, ?, ?, ?, ?, ?, ? );"; //$NON-NLS-1$ + String insertQuery = "insert into " + info.getTableName() + " values ( " + info.getQuestionMarks() + " );"; //$NON-NLS-1$ TargetInfo targetInfo = AnalyzerManager.getProject().getTargetInfo(); List insetRowData = new ArrayList(); @@ -451,6 +451,8 @@ public class SqlManager { insetRowData.add(targetInfo.getNetworkType()); insetRowData.add(Integer.toString(targetInfo.getMaxBrightness())); insetRowData.add(Integer.toString(targetInfo.getCpuCount())); + insetRowData.add(Integer.toString(targetInfo.getDeviceCount())); + insetRowData.add(targetInfo.getDevices()); List> insetData = new ArrayList>(); insetData.add(insetRowData); @@ -461,42 +463,34 @@ public class SqlManager { public void insertProcessInfo() { DBTableInfo info = DBTableManager.getInstance().getTableInfo( DBTableManager.TABLE_INDEX_PROCESS_INFO); - String insertQuery = "insert into " + info.getTableName() + " values ( ?, ?, ?, ?, ?, ?, ?, ? );"; //$NON-NLS-1$ - - HashMap processMap = AnalyzerManager.getProject() - .getProcessInfoHash(); - Set keysSet = AnalyzerManager.getProject() - .getProcessInfoHash().keySet(); - List keys = new ArrayList(); - keys.addAll(keysSet); - for (int i = 0; i < keys.size(); i++) { - ProcessInfo pInfo = processMap.get(keys.get(i)); - List insetRowData = new ArrayList(); - insetRowData.add(Integer.toString(pInfo.getPid())); - insetRowData.add(Integer.toString(pInfo.getPpid())); - insetRowData.add(Long.toString(pInfo.getStartTime().getSec())); - insetRowData.add(Long.toString(pInfo.getStartTime().getNano())); - insetRowData.add(Long.toString(pInfo.getLowestAddress())); - insetRowData.add(Long.toString(pInfo.getHighestAddress())); - insetRowData.add(pInfo.getBinaryPath()); - insetRowData.add(Integer.toString(pInfo.getDepLibCount())); + List processInfoList = new ArrayList(); + processInfoList.addAll(AnalyzerManager.getProject() + .getProcessInfoHash().values()); + String insertQuery = "insert into " + info.getTableName() + " values (" + info.getQuestionMarks() + ");"; //$NON-NLS-1$ + + for (int i = 0; i < processInfoList.size(); i++) { + ProcessInfo pInfo = processInfoList.get(i); + List insetRowData = new ArrayList(); + insetRowData.add(pInfo.getSaveFormat()); List> insetData = new ArrayList>(); insetData.add(insetRowData); insertQuery(insertQuery, insetData); - insertLibObj(pInfo.getLibObjs()); + insertLibObj(pInfo); } } - private void insertLibObj(List libs) { + private void insertLibObj(ProcessInfo pInfo) { + List libs = pInfo.getLibObjs(); DBTableInfo info = DBTableManager.getInstance().getTableInfo( DBTableManager.TABLE_INDEX_LIB_OBJ); - String insertQuery = "insert into " + info.getTableName() + " values ( ?, ?, ?, ?);"; //$NON-NLS-1$ - + String insertQuery = "insert into " + info.getTableName() + " values (" + info.getQuestionMarks() + ");"; //$NON-NLS-1$ + String pid = Integer.toString(pInfo.getPid()); List> insetData = new ArrayList>(); for (LibraryObject lib : libs) { List insetRowData = new ArrayList(); + insetRowData.add(pid); insetRowData.add(Long.toString(lib.getLowestAddress())); insetRowData.add(Long.toString(lib.getHighestAddress())); insetRowData.add(lib.getLibPath()); @@ -570,13 +564,13 @@ public class SqlManager { DBTableInfo leakTableInfo = DBTableManager.getInstance().getTableInfo( DBTableManager.TABLE_INDEX_LEAK_DATA); String insertQuery = leakTableInfo.insertQuery(); - List leakList = leakDectector.getLeakDataList(); - List insertData = new ArrayList(); - for (LeakData2 leakData : leakList) { + List leakList = leakDectector.getLeakDataList(); + List insertData = new ArrayList(); + for (LeakData leakData : leakList) { insertData.add(leakData); if (!leakData.getChildren().isEmpty()) { - List children = leakData.getChildren(); - for (LeakData2 child : children) { + List children = leakData.getChildren(); + for (LeakData child : children) { insertData.add(child); } } @@ -584,31 +578,33 @@ public class SqlManager { insertLeakQuery(insertQuery, insertData); } - private boolean insertLeakQuery(String query, List input) { + private boolean insertLeakQuery(String query, List input) { PreparedStatement prep = null; try { Connection conn = getConnection(); if (null == conn || null == query || null == input) { - System.out.println("failed sql inset : " + input); + System.out.println("insert leak data failed.. : " + input); return false; } semaphoreAcquire(); prep = conn.prepareStatement(query); int dataRowSize = input.size(); for (int i = 0; i < dataRowSize; i++) { - LeakData2 data = input.get(i); - prep.setInt(1, LeakData2.getLogNum()); - prep.setInt(2, data.getId()); - prep.setInt(3, data.getSeq()); - prep.setLong(4, data.getTime()); - prep.setLong(5, data.getAddr()); + LeakData data = input.get(i); + prep.setInt(1, LeakData.getLogNum()); + prep.setInt(2, data.getLeakSeq()); + prep.setInt(3, data.getId()); + prep.setInt(4, data.getSeq()); + prep.setLong(5, data.getTime()); prep.setString(6, data.getName()); - prep.setString(7, data.getParam()); - prep.setLong(8, data.getRet()); - prep.setInt(9, data.getKey()); - prep.setInt(10, data.getLeakSeq()); - prep.setInt(11, data.getParentKey()); - prep.setLong(12, data.getCallerPc()); + prep.setInt(7, data.getPid()); + prep.setLong(8, data.getAddr()); + prep.setLong(9, data.getCallerPc()); + prep.setString(10, data.getParam()); + prep.setLong(11, data.getRet()); + prep.setString(12, data.getLibName()); + prep.setInt(13, data.getKey()); + prep.setInt(14, data.getParentKey()); prep.addBatch(); } conn.setAutoCommit(false); @@ -632,7 +628,7 @@ public class SqlManager { public void saveFailedData() { FailedChecker failedChecker = AnalyzerManager.getFailedChecker(); - List failedList = failedChecker.getFailedList(); + List failedList = failedChecker.getFailedList(); DBTableInfo failedTableInfo = DBTableManager.getInstance() .getTableInfo(DBTableManager.TABLE_INDEX_FAILED_DATA); String insertQuery = failedTableInfo.insertQuery(); @@ -648,7 +644,7 @@ public class SqlManager { insertApiNameQuery(insertQuery, apiNames); } - private boolean insertFailedQuery(String query, List input) { + private boolean insertFailedQuery(String query, List input) { PreparedStatement prep = null; try { Connection conn = getConnection(); @@ -660,8 +656,8 @@ public class SqlManager { prep = conn.prepareStatement(query); int dataRowSize = input.size(); for (int i = 0; i < dataRowSize; i++) { - FailedData2 data = input.get(i); - prep.setInt(1, LeakData2.getLogNum()); + FailedData data = input.get(i); + prep.setInt(1, FailedData.getLogNum()); prep.setInt(2, data.getId()); prep.setInt(3, data.getSeq()); prep.setLong(4, data.getTime()); @@ -669,7 +665,9 @@ public class SqlManager { prep.setString(6, data.getArgs()); prep.setLong(7, data.getReturn()); prep.setLong(8, data.getErrorCode()); - prep.setLong(4, data.getCallerPc()); + prep.setLong(9, data.getCallerPc()); + prep.setInt(10, data.getPid()); + prep.setString(11, data.getLibName()); prep.addBatch(); } conn.setAutoCommit(false); @@ -1150,14 +1148,14 @@ public class SqlManager { .getTableName(), null); } - public List> loadLibObj() { + public List> loadLibObj(String option) { return selectQuery( null, DBTableManager.getInstance() .getTableInfo(DBTableManager.TABLE_INDEX_LIB_OBJ) .getColumnNames(), DBTableManager.getInstance() .getTableInfo(DBTableManager.TABLE_INDEX_LIB_OBJ) - .getTableName(), null); + .getTableName(), option); } public List> loadApiNames() { @@ -1219,11 +1217,11 @@ public class SqlManager { } public List getDetailsInfo(String path) { - List> dbInfo = selectQuery(path, new String[] { - Project.APP_NAME, Project.CREATE_TIME, Project.SAVE_PATH, - Project.LOG_NUMS, Project.SAVE_VERSION, Project.PACKAGE_ID, - Project.DEVICE, Project.LAST_TIME, Project.STOP_TIME }, - Project.TABLE_NAME, null); + DBTableInfo projectInfo = DBTableManager.getInstance().getTableInfo( + DBTableManager.TABLE_INDEX_PROJECT); + String[] columnNames = projectInfo.getColumnNames(); + List> dbInfo = selectQuery(path, columnNames, + projectInfo.getTableName(), null); if (dbInfo == null || dbInfo.isEmpty()) { return null; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java index ecd091b..e1dfe75 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java @@ -60,7 +60,6 @@ import org.tizen.dynamicanalyzer.communicator.CommunicatorUtils; import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.model.AddrSymbolPair; import org.tizen.dynamicanalyzer.model.DeviceInfo; -import org.tizen.dynamicanalyzer.nl.ConfigureLabels; import org.tizen.dynamicanalyzer.project.PackageInfo; import org.tizen.dynamicanalyzer.swap.logparser.SWAPLogParser; import org.tizen.dynamicanalyzer.swap.model.ByteUtils; @@ -94,12 +93,9 @@ public class Communicator30 extends BaseCommunicator { @Override public HostResult init(DeviceInfo devInfo) { // daemon start - // List devices = DACommunicator.getDevices(); - // for (DeviceInfo devInfo : devices) { Process ps = CommunicatorUtils.execCommand(devInfo.getIDevice(), AnalyzerShellCommands.DACOMMAND_RUN_MANAGER); System.out.println(ps.toString()); - // } // get port int remotePort = CommunicatorUtils.getRemotePort(devInfo.getIDevice()); @@ -237,11 +233,11 @@ public class Communicator30 extends BaseCommunicator { private UserSpaceInst getUserSpaceInst(ApplicationInfo appInfo) { UserSpaceInst output = new UserSpaceInst(); - if (0 == ConfigureManager.getInstance().getValueInt( - ConfigureLabels.FEATURE_FUNCTION_PROFILING)) { - output.setCount(0); - return output; - } + // if (0 == ConfigureManager.getInstance().getValueInt( + // ConfigureLabels.FEATURE_FUNCTION_PROFILING)) { + // output.setCount(0); + // return output; + // } output.setCount(1); // single processing ApplicationInst appInst = new ApplicationInst(); appInst.setApplicationType(ApplicationInfo.APPTYPE_TIZEN); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java index 4235d92..a1b9dce 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java @@ -161,7 +161,7 @@ public class MessageParser { if (null == pInfo) { pInfo = new ProcessInfo(); if (processMap.isEmpty()) { - AnalyzerManager.getProject().setMainProcessInfo(pInfo); + AnalyzerManager.getProject().setMainPid(pid); } processMap.put(pid, pInfo); } @@ -186,14 +186,14 @@ public class MessageParser { libHash.put(libPath, libObj); } - DATime startTime = AnalyzerManager.getProject().getStartTime(); - int startSec = AnalyzerManager.getProject().getStartTime().getSec(); - int startNano = AnalyzerManager.getProject().getStartTime().getNano(); + DATime startTime = AnalyzerManager.getProject().getProfileStartTime(); + int startSec = AnalyzerManager.getProject().getProfileStartTime().getSec(); + int startNano = AnalyzerManager.getProject().getProfileStartTime().getNano(); if (0 == startSec && 0 == startNano) { startTime.setSec(sec); startTime.setNano(nano); - AnalyzerManager.getProject().setStartTime(startTime); + AnalyzerManager.getProject().setProfileStartTime(startTime); startSec = sec; startNano = nano; } @@ -259,8 +259,8 @@ public class MessageParser { } // LOG! -// System.out.println("header log"); -// ByteUtils.printByteArrayForStart(header); + // System.out.println("header log"); + // ByteUtils.printByteArrayForStart(header); int id = ByteUtils.toInt(header, 0); @@ -332,7 +332,7 @@ public class MessageParser { } }); endingSteps(); - } + } } private void endingSteps() { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java index 7c41739..812837e 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java @@ -177,7 +177,6 @@ public class SWAPLogParser implements Runnable { setFuncName(pData); apiName = pData.getApiName(); if (apiName.equals("")) { - continue; } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/DATime.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/DATime.java index 5713b19..fb2126a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/DATime.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/DATime.java @@ -25,6 +25,8 @@ */ package org.tizen.dynamicanalyzer.swap.model; +import org.tizen.dynamicanalyzer.common.CommonConstants; + public class DATime { private int sec = 0; private int nano = 0; @@ -49,4 +51,14 @@ public class DATime { return ByteUtils.getByte(sec, nano); } + public String getSaveFormat() { + return Integer.toString(sec) + CommonConstants.COMMA + + Integer.toString(nano); + } + + public void loadSaveFormat(String saveData) { + String[] splitData = saveData.split(CommonConstants.COMMA); + sec = Integer.parseInt(splitData[0]); + nano = Integer.parseInt(splitData[1]); + } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/control/TargetInfo.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/control/TargetInfo.java index 2de60dd..825e68e 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/control/TargetInfo.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/control/TargetInfo.java @@ -25,6 +25,8 @@ */ package org.tizen.dynamicanalyzer.swap.model.control; +import java.util.List; + public class TargetInfo { private long systemMemorySize = 0; private long storageSize = 0; @@ -125,4 +127,18 @@ public class TargetInfo { public void setDevices(String devices) { this.devices = devices; } + + public void loadSaveFormat(List info) { + systemMemorySize = Long.parseLong(info.get(0)); + storageSize = Long.parseLong(info.get(1)); + bluetoothSupport = Integer.parseInt(info.get(2)); + gpsSupport = Integer.parseInt(info.get(3)); + wifiSupport = Integer.parseInt(info.get(4)); + cameraCount = Integer.parseInt(info.get(5)); + networkType = info.get(6); + maxBrightness = Integer.parseInt(info.get(7)); + cpuCount = Integer.parseInt(info.get(8)); + deviceCount = Integer.parseInt(info.get(9)); + devices = info.get(10); + } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/BasicDataMessage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/BasicDataMessage.java index 27f08fd..6b53dc0 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/BasicDataMessage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/BasicDataMessage.java @@ -106,14 +106,14 @@ public class BasicDataMessage { int nano = (int)(time % 10000); nano *= 100000; - DATime startTime = AnalyzerManager.getProject().getStartTime(); - int startSec = AnalyzerManager.getProject().getStartTime().getSec(); - int startNano = AnalyzerManager.getProject().getStartTime().getNano(); + DATime startTime = AnalyzerManager.getProject().getProfileStartTime(); + int startSec = AnalyzerManager.getProject().getProfileStartTime().getSec(); + int startNano = AnalyzerManager.getProject().getProfileStartTime().getNano(); if (0 == startSec && 0 == startNano) { startTime.setSec(sec); startTime.setNano(nano); - AnalyzerManager.getProject().setStartTime(startTime); + AnalyzerManager.getProject().setProfileStartTime(startTime); startSec = sec; startNano = nano; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/ProcessInfo.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/ProcessInfo.java index ac043a9..b28548d 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/ProcessInfo.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/ProcessInfo.java @@ -29,10 +29,11 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.swap.model.DATime; public class ProcessInfo { - private int pid = -1; + private int pid = -1; // save key - libOnjects private int ppid = -1; DATime startTime = new DATime(); private long lowestAddress = 0; @@ -106,4 +107,28 @@ public class ProcessInfo { return libObjHash; } + public String getSaveFormat() { + StringBuffer saveFormat = new StringBuffer(); + saveFormat.append(pid).append(CommonConstants.CMD_SPLIT); + saveFormat.append(ppid).append(CommonConstants.CMD_SPLIT); + saveFormat.append(startTime.getSaveFormat()).append( + CommonConstants.CMD_SPLIT); + saveFormat.append(lowestAddress).append(CommonConstants.CMD_SPLIT); + saveFormat.append(highestAddress).append(CommonConstants.CMD_SPLIT); + saveFormat.append(binaryPath).append(CommonConstants.CMD_SPLIT); + saveFormat.append(depLibCount).append(CommonConstants.CMD_SPLIT); + + return saveFormat.toString(); + } + + public void loadSaveFormat(String saveData) { + String[] splitData = saveData.split("\\|"); + pid = Integer.parseInt(splitData[0]); + ppid = Integer.parseInt(splitData[1]); + startTime.loadSaveFormat(new String(splitData[2])); + lowestAddress = Long.parseLong(splitData[3]); + highestAddress = Long.parseLong(splitData[4]); + binaryPath = new String(splitData[5]); + depLibCount = Integer.parseInt(splitData[6]); + } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogData.java index 6c856dd..d4be52b 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogData.java @@ -63,7 +63,7 @@ public abstract class LogData { long nano = ByteUtils.toInt(data, index); index += INT_SIZE; - DATime startTime = AnalyzerManager.getProject().getStartTime(); + DATime startTime = AnalyzerManager.getProject().getProfileStartTime(); long startSec = startTime.getSec(); long startNano = startTime.getNano(); long resultSec = sec - startSec; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/ReplayData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/ReplayData.java index d2cb5ce..bcbaec5 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/ReplayData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/ReplayData.java @@ -62,7 +62,7 @@ public class ReplayData extends LogData { eventTime.setSec(sec); eventTime.setNano(nano); - DATime startTime = AnalyzerManager.getProject().getStartTime(); + DATime startTime = AnalyzerManager.getProject().getProfileStartTime(); long startSec = startTime.getSec(); long startNano = startTime.getNano(); long resultSec = sec - startSec; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartData.java index 9d26df7..d4314d7 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartData.java @@ -36,7 +36,7 @@ import org.tizen.dynamicanalyzer.logparser.LogCenterConstants; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; import org.tizen.dynamicanalyzer.nl.FilePageLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; +import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData; import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; import org.tizen.dynamicanalyzer.widgets.chart.DAChart; import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries; @@ -54,7 +54,7 @@ public class FileChartData { private boolean isClosedFile = true; private boolean isFailedAPI = false; // for Detail View Data - private List failedData = null; + private List failedData = null; private long fileSize = 0; private long readSize = 0; private long writeSize = 0; @@ -109,9 +109,9 @@ public class FileChartData { } } - public List getFailedData() { + public List getFailedData() { if (null == failedData) { - failedData = new ArrayList(); + failedData = new ArrayList(); } return failedData; } @@ -120,7 +120,7 @@ public class FileChartData { List output = new ArrayList(); int size = getFailedData().size(); for (int i = 0; i < size; i++) { - FailedData2 ffd = failedData.get(i); + FailedData ffd = failedData.get(i); int seq = ffd.getSeq(); output.add(seq); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartDataEvent.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartDataEvent.java index 7b2a85c..02b4678 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartDataEvent.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartDataEvent.java @@ -28,14 +28,14 @@ package org.tizen.dynamicanalyzer.ui.file; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; import org.tizen.dynamicanalyzer.swap.model.probe2.FileData; +import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData; import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; public class FileChartDataEvent { private FileData contents; - private FailedData2 failedData = null; + private FailedData failedData = null; private long fd = -1; private String filePath = AnalyzerLabels.EMPTY_STRING; @@ -141,11 +141,11 @@ public class FileChartDataEvent { return this.writeSize; } - public void setFailedData(FailedData2 data) { + public void setFailedData(FailedData data) { failedData = data; } - public FailedData2 getFailedData() { + public FailedData getFailedData() { return failedData; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java index 1c835e1..b4be032 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java @@ -41,7 +41,6 @@ import org.tizen.dynamicanalyzer.nl.TimelineChartLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.resources.FontResources; import org.tizen.dynamicanalyzer.resources.ImageResources; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; import org.tizen.dynamicanalyzer.swap.model.probe2.FileData; import org.tizen.dynamicanalyzer.swap.model.probe2.LogData; import org.tizen.dynamicanalyzer.ui.common.PopupAnalysisMenuItemClickListener; @@ -52,6 +51,7 @@ import org.tizen.dynamicanalyzer.ui.common.PopupStartMenuItemClickListener; import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener; import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter; import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker; +import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData; import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector; import org.tizen.dynamicanalyzer.ui.summary.warning.WarningCase; import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker; @@ -155,7 +155,7 @@ public class FileDataMaker { // error check if (errno != 0) { - FailedData2 ffd = new FailedData2(input); + FailedData ffd = new FailedData(input); event.setFailedData(ffd); this.failedChecker.getFailedList().add(ffd); event.setFailedAPI(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartData.java index e5adbec..325aa86 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartData.java @@ -37,7 +37,7 @@ import org.tizen.dynamicanalyzer.logparser.LogCenterConstants; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; import org.tizen.dynamicanalyzer.nl.NetworkPageLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; +import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData; import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; import org.tizen.dynamicanalyzer.widgets.chart.DAChart; import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries; @@ -61,7 +61,7 @@ public class NetworkChartData { private boolean isClosedSocket = true; private boolean isFailedAPI = false; // for Detail View Data - private List failedData = null; + private List failedData = null; private long messageSize = 0; private long sendSize = 0; private long recvSize = 0; @@ -121,9 +121,9 @@ public class NetworkChartData { } } - public List getFailedData() { + public List getFailedData() { if (null == failedData) { - failedData = new ArrayList(); + failedData = new ArrayList(); } return failedData; } @@ -132,7 +132,7 @@ public class NetworkChartData { List output = new ArrayList(); int size = getFailedData().size(); for (int i = 0; i < size; i++) { - FailedData2 ffd = failedData.get(i); + FailedData ffd = failedData.get(i); String seq = Integer.toString(ffd.getSeq()); output.add(seq); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartDataEvent.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartDataEvent.java index 9380589..ed9e539 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartDataEvent.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartDataEvent.java @@ -29,13 +29,13 @@ package org.tizen.dynamicanalyzer.ui.network; import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; import org.tizen.dynamicanalyzer.swap.model.probe2.NetworkData; +import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData; import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants; public class NetworkChartDataEvent { - private FailedData2 failedData = null; + private FailedData failedData = null; private String FD = AnalyzerLabels.EMPTY_STRING; private String address = AnalyzerLabels.EMPTY_STRING; private String thread = AnalyzerLabels.EMPTY_STRING; @@ -156,11 +156,11 @@ public class NetworkChartDataEvent { return this.recvSize; } - public void setFailedData(FailedData2 data) { + public void setFailedData(FailedData data) { failedData = data; } - public FailedData2 getFailedData() { + public FailedData getFailedData() { return failedData; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java index a1ff4e1..7642dc4 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java @@ -40,7 +40,6 @@ import org.tizen.dynamicanalyzer.nl.TimelineChartLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.resources.FontResources; import org.tizen.dynamicanalyzer.resources.ImageResources; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; import org.tizen.dynamicanalyzer.swap.model.probe2.LogData; import org.tizen.dynamicanalyzer.swap.model.probe2.NetworkData; import org.tizen.dynamicanalyzer.ui.common.PopupAnalysisMenuItemClickListener; @@ -51,6 +50,7 @@ import org.tizen.dynamicanalyzer.ui.common.PopupStartMenuItemClickListener; import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener; import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter; import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker; +import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData; import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector; import org.tizen.dynamicanalyzer.ui.summary.warning.WarningCase; import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker; @@ -124,7 +124,7 @@ public class NetworkDataMaker { NetworkChartDataEvent event = makeEventData(input); if (event.isFailedAPI()) { - FailedData2 ffd = new FailedData2(input); + FailedData ffd = new FailedData(input); event.setFailedData(ffd); this.failedChecker.getFailedList().add(ffd); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedApiTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedApiTable.java index bd6cd7c..fea9957 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedApiTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedApiTable.java @@ -38,7 +38,6 @@ import org.tizen.dynamicanalyzer.common.DASelectionData; import org.tizen.dynamicanalyzer.error.ErrorCodeManager; import org.tizen.dynamicanalyzer.listeners.SummaryMouseDoubleClickListener; import org.tizen.dynamicanalyzer.model.TableInput; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; import org.tizen.dynamicanalyzer.ui.range.RangeFailedApiListView; import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite; @@ -82,7 +81,7 @@ public class FailedApiTable extends DATableComposite { } protected List makeTableInput() { - List failedList = null; + List failedList = null; if (isRange) { failedList = RangeDataManager.getInstance().getFailedChecker() .getFailedList(); @@ -97,7 +96,7 @@ public class FailedApiTable extends DATableComposite { List text = new ArrayList(); List data = new ArrayList(); - FailedData2 failedData = failedList.get(i); + FailedData failedData = failedList.get(i); text.add(Integer.toString(failedData.getSeq())); data.add(Integer.toString(failedData.getSeq())); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedChecker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedChecker.java index 63e9a15..738dbcc 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedChecker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedChecker.java @@ -31,7 +31,6 @@ import java.util.List; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.swap.callstack.BaseCallstackManager; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; import org.tizen.dynamicanalyzer.swap.model.probe2.FileData; import org.tizen.dynamicanalyzer.swap.model.probe2.LogData; import org.tizen.dynamicanalyzer.swap.model.probe2.MemoryData; @@ -41,7 +40,7 @@ import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; public class FailedChecker { - List failedList; + List failedList; public void check(LogData log, BaseCallstackManager cm) { if (log instanceof MemoryData) { @@ -76,14 +75,14 @@ public class FailedChecker { private void checkUserDefinedFunc(LogData log, BaseCallstackManager cm) { if (AnalyzerConstants.USER_CALL == AnalyzerUtil .checkUserCall((ProbeCommonData) log)) { - FailedData2 fd = new FailedData2(log); + FailedData fd = new FailedData(log); getFailedList().add(fd); } } - public List getFailedList() { + public List getFailedList() { if (null == failedList) { - failedList = new ArrayList(); + failedList = new ArrayList(); } return failedList; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/FailedData2.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedData.java similarity index 77% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/FailedData2.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedData.java index d264129..c6b5c14 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/FailedData2.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedData.java @@ -24,11 +24,14 @@ * */ -package org.tizen.dynamicanalyzer.swap.model.probe2; +package org.tizen.dynamicanalyzer.ui.summary.failed; import java.util.List; -public class FailedData2 { +import org.tizen.dynamicanalyzer.swap.model.probe2.LogData; +import org.tizen.dynamicanalyzer.swap.model.probe2.ProbeCommonData; + +public class FailedData { public static final int ID_INDEX = 1; public static final int SEQ_INDEX = 2; public static final int TIME_INDEX = 3; @@ -37,6 +40,8 @@ public class FailedData2 { public static final int RETURN_INDEX = 6; public static final int ERROR_INDEX = 7; public static final int CALLER_INDEX = 8; + public static final int PID_INDEX = 9; + public static final int LIB_NAME_INDEX = 10; private static int LogNum = 0; private LogData data; @@ -49,8 +54,10 @@ public class FailedData2 { private long ret = -1; private long err = -1; private long callerPc = -1; + private int pid = -1; + private String libName = null; - public FailedData2(LogData log) { + public FailedData(LogData log) { id = log.getId(); seq = log.getSeq(); time = log.getTime(); @@ -61,9 +68,12 @@ public class FailedData2 { err = plog.getErrno(); callerPc = plog.getCallerPcAddr(); data = log; + pid = log.getPid(); + // TODO: + libName = null; } - public FailedData2(List input) { + public FailedData(List input) { if (null != input && !input.isEmpty()) { id = Integer.parseInt(input.get(ID_INDEX)); seq = Integer.parseInt(input.get(SEQ_INDEX)); @@ -73,6 +83,8 @@ public class FailedData2 { ret = Long.parseLong(input.get(RETURN_INDEX)); err = Integer.parseInt(input.get(ERROR_INDEX)); callerPc = Long.parseLong(input.get(CALLER_INDEX)); + pid = Integer.parseInt(input.get(PID_INDEX)); + libName = input.get(LIB_NAME_INDEX); } } @@ -119,4 +131,21 @@ public class FailedData2 { public void setData(LogData data) { this.data = data; } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getLibName() { + return libName; + } + + public void setLibName(String libName) { + this.libName = libName; + } + } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LeakData2.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakData.java similarity index 61% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LeakData2.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakData.java index 8724a67..d3083f7 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LeakData2.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakData.java @@ -23,31 +23,34 @@ * - S-Core Co., Ltd * */ -package org.tizen.dynamicanalyzer.swap.model.probe2; +package org.tizen.dynamicanalyzer.ui.summary.leaks; import java.util.ArrayList; import java.util.List; -import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector; +import org.tizen.dynamicanalyzer.swap.model.probe2.LogData; +import org.tizen.dynamicanalyzer.swap.model.probe2.MemoryData; +import org.tizen.dynamicanalyzer.swap.model.probe2.ProbeCommonData; -public class LeakData2 { +public class LeakData { private static int logNum = 0; - private int key = -1; - private long addr = -1; - private int seq = -1; + private int leakSeq = -1; private int id = -1; + private int seq = -1; private long time = -1; - private String name = null; + private String apiName = null; + private int pid = -1; + private long addr = -1; + private long callerPcAddr = -1; private String param = null; - private long ret = -1; - private int leakSeq = -1; - private long callerPc = -1; - + private long retValue = -1; + private String libName = null; + private int key = -1; private int parentKey = -1; - private List children; + private List children; - public LeakData2(LogData log, LeakDetector leakDetector) { + public LeakData(LogData log, LeakDetector leakDetector) { leakSeq = leakDetector.getLeakSeq(); leakDetector.increaseLeakSeq(); this.key = log.getKey(); @@ -56,28 +59,34 @@ public class LeakData2 { this.time = log.getTime(); // TODO : name field ProbeCommonData pcd = (ProbeCommonData) log; - this.name = pcd.getApiName(); + this.apiName = pcd.getApiName(); this.param = pcd.getArgs(); - this.ret = pcd.getReturn(); - this.callerPc = pcd.getCallerPcAddr(); + this.retValue = pcd.getReturn(); + this.callerPcAddr = pcd.getCallerPcAddr(); if (log instanceof MemoryData) { this.addr = ((MemoryData) log).getAddress(); } + pid = log.getPid(); + // TODO: libName + libName = null; } // load data - public LeakData2(List loadData) { - // key = Integer.parseInt(loadData.get(index)) - // data.set(KEY_INDEX, loadData.get(KEY_INDEX)); - // data.set(SEQUENCE_INDEX, loadData.get(SEQUENCE_INDEX)); - // data.set(ID_INDEX, loadData.get(ID_INDEX)); - // data.set(TIME_INDEX, loadData.get(TIME_INDEX)); - // data.set(NAME_INDEX, loadData.get(NAME_INDEX)); - // data.set(PARAM_INDEX, loadData.get(PARAM_INDEX)); - // data.set(RETURN_INDEX, loadData.get(RETURN_INDEX)); - // data.set(LEAK_SEQ_INDEX, loadData.get(LEAK_SEQ_INDEX)); - // data.set(PARENT_KEY_INDEX, loadData.get(PARENT_KEY_INDEX)); + public LeakData(List loadData) { + leakSeq = Integer.parseInt(loadData.get(1)); + id = Integer.parseInt(loadData.get(2)); + seq = Integer.parseInt(loadData.get(3)); + time = Long.parseLong(loadData.get(4)); + apiName = loadData.get(5); + pid = Integer.parseInt(loadData.get(6)); + addr = Long.parseLong(loadData.get(7)); + callerPcAddr = Long.parseLong(loadData.get(8)); + param = loadData.get(9); + retValue = Long.parseLong(loadData.get(10)); + libName = loadData.get(11); + key = Integer.parseInt(loadData.get(12)); + parentKey = Integer.parseInt(loadData.get(13)); } public int getKey() { @@ -121,11 +130,11 @@ public class LeakData2 { } public String getName() { - return name; + return apiName; } public void setName(String name) { - this.name = name; + this.apiName = name; } public String getParam() { @@ -137,11 +146,11 @@ public class LeakData2 { } public long getRet() { - return ret; + return retValue; } public void setRet(long ret) { - this.ret = ret; + this.retValue = ret; } public int getLeakSeq() { @@ -161,25 +170,25 @@ public class LeakData2 { } public long getCallerPc() { - return callerPc; + return callerPcAddr; } public void setCallerPc(long callerPc) { - this.callerPc = callerPc; + this.callerPcAddr = callerPc; } - public List getChildren() { + public List getChildren() { if (null == children) { - children = new ArrayList(); + children = new ArrayList(); } return children; } - public void setChildren(List children) { + public void setChildren(List children) { this.children = children; } - public void addChild(LeakData2 child) { + public void addChild(LeakData child) { getChildren().add(child); } @@ -196,4 +205,21 @@ public class LeakData2 { public static int getLogNum() { return logNum++; } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getLibName() { + return libName; + } + + public void setLibName(String libName) { + this.libName = libName; + } + } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakDetector.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakDetector.java index 17718f2..66bd735 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakDetector.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakDetector.java @@ -31,7 +31,6 @@ import java.util.HashMap; import java.util.List; import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.swap.model.probe2.LeakData2; import org.tizen.dynamicanalyzer.swap.model.probe2.LogData; import org.tizen.dynamicanalyzer.swap.model.probe2.ProbeCommonData; import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData; @@ -42,29 +41,29 @@ public class LeakDetector { public final static int API_TYPE_CLOSE = 1; public final static int API_TYPE_REALLOC = 2; - HashMap leakHash; - HashMap childHash; + HashMap leakHash; + HashMap childHash; private int leakSeq = 0; public LeakDetector() { } - public List getLeakDataList() { - List leakList = new ArrayList(); + public List getLeakDataList() { + List leakList = new ArrayList(); leakList.addAll(getLeakHash().values()); return leakList; } - public HashMap getLeakHash() { + public HashMap getLeakHash() { if (null == leakHash) { - leakHash = new HashMap(); + leakHash = new HashMap(); } return leakHash; } - public HashMap getChildHash() { + public HashMap getChildHash() { if (null == childHash) { - childHash = new HashMap(); + childHash = new HashMap(); } return childHash; } @@ -114,19 +113,19 @@ public class LeakDetector { { // System.out.println("file arrived"); } - HashMap leaks = getLeakHash(); + HashMap leaks = getLeakHash(); if (chk.getApiType() == API_TYPE_OPEN) { // if (chk.isCheckUserCall()) { // checkUserFuncLeakData(logData, chk); // } else { - LeakData2 newLeak = new LeakData2(logData, this); + LeakData newLeak = new LeakData(logData, this); leaks.put(logData.getKey(), newLeak); // } } else if (chk.getApiType() == API_TYPE_CLOSE) { int key = log.getKey(); - LeakData2 freeData = getChildHash().get(key); + LeakData freeData = getChildHash().get(key); if (null != freeData) { - LeakData2 parent = leaks.get(freeData.getParentKey()); + LeakData parent = leaks.get(freeData.getParentKey()); parent.removeChild(key); getChildHash().remove(key); if (parent.getChildren().isEmpty()) { @@ -159,7 +158,7 @@ public class LeakDetector { // String key = input[chk.getKeyIndex()]; // leaks.put(key, new LeakData(key, input, this)); int key = log.getKey(); - leaks.put(key, new LeakData2(log, this)); + leaks.put(key, new LeakData(log, this)); } } } @@ -198,8 +197,8 @@ public class LeakDetector { // user call if (AnalyzerManager.getCallstackManager().isUserCall( callerFunc.getFunctionName())) { - HashMap leaks = getLeakHash(); - LeakData2 newLeak = new LeakData2(log, this); + HashMap leaks = getLeakHash(); + LeakData newLeak = new LeakData(log, this); leaks.put(newLeak.getKey(), newLeak); } // for internal leak diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakTable.java index e472dc4..32f2ce8 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakTable.java @@ -43,7 +43,6 @@ import org.tizen.dynamicanalyzer.listeners.SummaryMouseDoubleClickListener; import org.tizen.dynamicanalyzer.model.TreeInput; import org.tizen.dynamicanalyzer.nl.SummaryLabels; import org.tizen.dynamicanalyzer.swap.model.data.DataChannelConstants; -import org.tizen.dynamicanalyzer.swap.model.probe2.LeakData2; import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; import org.tizen.dynamicanalyzer.ui.range.RangeLeakView; import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; @@ -111,12 +110,12 @@ public class LeakTable extends DATreeComposite { } // !! recursive!! - public void makeChildTree(List children, TreeInput parent, + public void makeChildTree(List children, TreeInput parent, String parentName) { if (!children.isEmpty()) { int size = children.size(); for (int i = 0; i < size; i++) { - LeakData2 data = children.get(i); + LeakData data = children.get(i); TreeInput input = makeInput(data); parent.getChildren().add(input); input.setParent(parentName); @@ -127,19 +126,19 @@ public class LeakTable extends DATreeComposite { @Override public List makeTreeInput() { List output = new ArrayList(); - HashMap leaks = null; + HashMap leaks = null; if (isRange) { leaks = RangeDataManager.getInstance().getLeakDetector() .getLeakHash(); } else { leaks = AnalyzerManager.getLeakDetector().getLeakHash(); } - ArrayList leakList = new ArrayList(); + ArrayList leakList = new ArrayList(); leakList.addAll(leaks.values()); int size = leakList.size(); for (int i = 0; i < size; i++) { - LeakData2 leakData = leakList.get(i); + LeakData leakData = leakList.get(i); TreeInput leakInput = makeInput(leakData); makeChildTree(leakData.getChildren(), leakInput, Integer.toString(leakData.getParentKey())); @@ -148,7 +147,7 @@ public class LeakTable extends DATreeComposite { return output; } - private TreeInput makeInput(LeakData2 leakData) { + private TreeInput makeInput(LeakData leakData) { DATableDataFormat tableData = new DATableDataFormat( leakData.getLeakSeq()); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningData.java index 24bc0aa..f72a01c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningData.java @@ -41,6 +41,9 @@ public class WarningData { private String key = null; private long callerPc = -1; private LogData logData = null; + private int pid = -1; + + private String libName = null; public WarningData(int wCase, LogData data, String key) { seq = uNum++; @@ -49,6 +52,9 @@ public class WarningData { this.key = key; callerPc = ((ProbeCommonData) data).getCallerPcAddr(); logData = data; + pid = data.getPid(); + // TODO: + libName = null; } public List getData() { @@ -77,7 +83,7 @@ public class WarningData { public static void resetSeq() { uNum = 1; } - + public long getCallerPc() { return callerPc; } @@ -89,4 +95,21 @@ public class WarningData { public void setLogData(LogData logData) { this.logData = logData; } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getLibName() { + return libName; + } + + public void setLibName(String libName) { + this.libName = libName; + } + } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPageData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPageData.java index c395fa4..d17138c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPageData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPageData.java @@ -31,7 +31,7 @@ import java.util.List; import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.nl.ThreadPageLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2; +import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData; import org.tizen.dynamicanalyzer.widgets.chart.DAChart; import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem; import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem; @@ -121,7 +121,7 @@ public abstract class ThreadPageData { ThreadPageDataEvent event, long errno) { DAChartSeriesItem apiItem = null; if (0 != errno) { - FailedData2 ffd = new FailedData2(event.getContents()); + FailedData ffd = new FailedData(event.getContents()); AnalyzerManager.getFailedChecker().getFailedList().add(ffd); apiItem = new DAChartSeriesItem(event.getTime(), DAChartSeriesItem.SERIES_STATE_BAR, diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/thread/ThreadPageThreadDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/thread/ThreadPageThreadDataManager.java index 8c5bf48..aae4002 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/thread/ThreadPageThreadDataManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/thread/ThreadPageThreadDataManager.java @@ -302,7 +302,7 @@ public class ThreadPageThreadDataManager { private void createMainThreadItem() { isStart = true; Project project = AnalyzerManager.getProject(); - int tid = project.getMainProcessInfo().getPid(); + int tid = project.getMainPid(); if (0 == tid) { isStart = false; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialog.java index 3037581..10a4769 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialog.java @@ -89,10 +89,7 @@ public class ConfigurationDialog extends DAMessageBox { private void doApply() { ConfigurationDialogValues.getInstance().applySettingValueToConfigFile(); - if (DACommunicator.isRunning()) { - DACommunicator.sendRuntimeMessage(DACommunicator.MSG_TYPE_CONFIG, - null); - } + DACommunicator.sendRuntimeMessage(DACommunicator.MSG_TYPE_CONFIG, null); } private void doBack() { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java index e77d029..aac3f27 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java @@ -56,6 +56,7 @@ import org.tizen.dynamicanalyzer.common.AnalyzerPaths; import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.common.DesignConstants; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; +import org.tizen.dynamicanalyzer.project.Project; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.resources.FontResources; import org.tizen.dynamicanalyzer.shortcut.ShortCutManager; @@ -93,7 +94,7 @@ public class OpenTraceDialog extends DAMessageBox { private String createTime = CommonConstants.EMPTY; private String device = CommonConstants.EMPTY; private String application = CommonConstants.EMPTY; - private String elapsedTime = CommonConstants.ZERO; + private long elapsedTime = 0; private String[] columnNames = { AnalyzerLabels.OPEN_TRACE_DLG_TRACE_FILE_NAME, @@ -498,7 +499,7 @@ public class OpenTraceDialog extends DAMessageBox { createTime = CommonConstants.EMPTY; device = CommonConstants.EMPTY; application = CommonConstants.EMPTY; - elapsedTime = CommonConstants.ZERO; + elapsedTime = 0; } detail.redraw(); } @@ -509,10 +510,13 @@ public class OpenTraceDialog extends DAMessageBox { if (null == pInfo || pInfo.isEmpty() || pInfo.size() < 8) { return false; } - createTime = pInfo.get(AnalyzerConstants.PROJECT_CREATE_TIME_INDEX); - device = pInfo.get(AnalyzerConstants.PROJECT_DEVICE_INDEX); - application = pInfo.get(AnalyzerConstants.PROJECT_APPNAME_INDEX); - elapsedTime = pInfo.get(AnalyzerConstants.PROJECT_LAST_TIME_INDEX); + Project project = new Project(); + project.loadSaveFormat(pInfo); + + createTime = project.getCreateTime(); + device = project.getDevice(); + application = project.getAppName(); + elapsedTime = project.getLastTime(); return isSuccess; } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceInputReader.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceInputReader.java index 8ad0923..71bb30a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceInputReader.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceInputReader.java @@ -78,13 +78,13 @@ public class OpenTraceInputReader implements Runnable { public void run() { AnalyzerManager.setLogParsingComplete(false); Project p = AnalyzerManager.getProject(); - long last = p.getLastLogNum(DataChannelConstants.MSG_PROBE_FILE); + long last = p.getLogCount(); createPackage(last, DataChannelConstants.MSG_PROBE_FILE); - last = p.getLastLogNum(DataChannelConstants.MSG_DATA_SYSTEM); + last = p.getDeviceLogCount(); createPackage(last, DataChannelConstants.MSG_DATA_SYSTEM); - last = p.getLastLogNum(DataChannelConstants.MSG_DATA_SAMPLE); + last = p.getProfileLogCount(); createPackage(last, DataChannelConstants.MSG_DATA_SAMPLE); System.out.println("input reader complete"); //$NON-NLS-1$ @@ -93,7 +93,6 @@ public class OpenTraceInputReader implements Runnable { } private void createPackage(long last, int type) { - // List logCenters = AnalyzerManager.getLogCenters(); List input = null; LogPackage logPackage = new LogPackage(); long from = 0; @@ -109,7 +108,6 @@ public class OpenTraceInputReader implements Runnable { logs.setLogs(input); logPackage.setLogs(type, logs); } else { - // int size = logCenters.size(); List ids = LogDataFactory.getLogList(); int size = ids.size(); for (int i = 0; i < size; i++) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/SaveFilesTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/SaveFilesTable.java index 1bd7415..e2e3831 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/SaveFilesTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/SaveFilesTable.java @@ -162,13 +162,16 @@ public class SaveFilesTable extends DATableComposite { isVaildVersion = false; return null; } - String version = pInfo.get(AnalyzerConstants.PROJECT_VERSION_INDEX); + Project project = new Project(); + project.loadSaveFormat(pInfo); + + String version = project.getVersion(); if (version.isEmpty() || !version.equals(AnalyzerConstants.SAVE_DATA_VERSION)) { isVaildVersion = false; } else { isVaildVersion = true; } - return pInfo.get(AnalyzerConstants.PROJECT_CREATE_TIME_INDEX); + return project.getCreateTime(); } } -- 2.7.4