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$
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.widgets.Display;\r
import org.eclipse.swt.widgets.Shell;\r
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;\r
import org.tizen.dynamicanalyzer.common.AnalyzerManager;\r
import org.tizen.dynamicanalyzer.common.CommonConstants;\r
import org.tizen.dynamicanalyzer.communicator.DACommunicator;\r
import org.tizen.dynamicanalyzer.project.Project;\r
import org.tizen.dynamicanalyzer.resources.ImageResources;\r
import org.tizen.dynamicanalyzer.sql.SqlManager;\r
-import org.tizen.dynamicanalyzer.swap.model.DATime;\r
import org.tizen.dynamicanalyzer.swap.model.control.TargetInfo;\r
import org.tizen.dynamicanalyzer.swap.model.data.ApiNameManager;\r
import org.tizen.dynamicanalyzer.swap.model.data.DataChannelConstants;\r
import org.tizen.dynamicanalyzer.swap.model.data.LibraryObject;\r
import org.tizen.dynamicanalyzer.swap.model.data.ProcessInfo;\r
-import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2;\r
-import org.tizen.dynamicanalyzer.swap.model.probe2.LeakData2;\r
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;\r
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;\r
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;\r
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;\r
import org.tizen.dynamicanalyzer.ui.range.RangePage;\r
import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;\r
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;\r
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakData;\r
import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;\r
import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;\r
import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;\r
public class OpenTraceHandler extends AbstractHandler {\r
\r
public static final String ID = OpenTraceHandler.class.getName();\r
- Project p = null;\r
+ Project project = null;\r
\r
@Override\r
public Object execute(ExecutionEvent event) throws ExecutionException {\r
\r
- p = AnalyzerManager.getProject();\r
+ project = AnalyzerManager.getProject();\r
\r
List<String> pInfo = SqlManager.getInstance().getDetailsInfo(\r
- p.getSavePath());\r
+ project.getSavePath());\r
\r
if (null == pInfo || pInfo.isEmpty()) {\r
System.out.println("The trace file is invalid."); //$NON-NLS-1$\r
AnalyzerUtil.executeCommand(ClearHandler.ID);\r
return null;\r
}\r
+ project.loadSaveFormat(pInfo);\r
+\r
OpenTraceProgressManager.getInstance().openTracePrgressStart(\r
AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING);\r
- int size = pInfo.size();\r
- // List<String> logCenterNames = new ArrayList<String>();\r
- for (int i = 0; i < size; i++) {\r
- if (i == AnalyzerConstants.PROJECT_VERSION_INDEX) {\r
- if (!AnalyzerConstants.SAVE_DATA_VERSION.equals(pInfo\r
- .get(AnalyzerConstants.PROJECT_VERSION_INDEX))) {\r
- System.out.println("The trace file version is invalid."); //$NON-NLS-1$\r
- OpenTraceProgressManager\r
- .getInstance()\r
- .closeOpenTraceDialog(\r
- AnalyzerLabels.OPEN_TRACE_PROGRESS_VERSION_INVALID);\r
- createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_VERSION_INVALID_REMOVE);\r
- return null;\r
- }\r
- p.setVersion(AnalyzerConstants.SAVE_DATA_VERSION);\r
- } else if (i == AnalyzerConstants.PROJECT_CREATE_TIME_INDEX) {\r
- p.setCreateTime(pInfo.get(i));\r
- } else if (i == AnalyzerConstants.PROJECT_APPNAME_INDEX) {\r
- p.setAppName(pInfo.get(i));\r
- } else if (i == AnalyzerConstants.PROJECT_PACKAGE_ID_INDEX) {\r
- p.setPkgId(pInfo.get(i));\r
- } else if (i == AnalyzerConstants.PROJECT_STOP_TIME_INDEX) {\r
- try {\r
- long stopTime = Long.parseLong(pInfo.get(i));\r
- p.setStopTime(stopTime);\r
- } catch (NumberFormatException e) {\r
- invalidProgress();\r
- return null;\r
- }\r
- } else if (i == AnalyzerConstants.PROJECT_DEVICE_INDEX) {\r
- p.setDevice(pInfo.get(i));\r
- } else if (i == AnalyzerConstants.PROJECT_LAST_DATA_INDEX) {\r
- String lastNum = pInfo.get(i);\r
- String[] splitLastNum = lastNum\r
- .split(CommonConstants.CMD_SPLIT_READ);\r
- try {\r
- p.setLastLogNum(Long.parseLong(splitLastNum[0]),\r
- DataChannelConstants.MSG_PROBE_FILE);\r
- p.setLastLogNum(Long.parseLong(splitLastNum[1]),\r
- DataChannelConstants.MSG_DATA_SYSTEM);\r
- p.setLastLogNum(Long.parseLong(splitLastNum[2]),\r
- DataChannelConstants.MSG_DATA_SAMPLE);\r
- } catch (NumberFormatException e) {\r
- invalidProgress();\r
- return null;\r
- } catch (ArrayIndexOutOfBoundsException e) {\r
- invalidProgress();\r
- return null;\r
- }\r
- } else if (i == AnalyzerConstants.PROJECT_LAST_TIME_INDEX) {\r
- try {\r
- long lastTime = Long.parseLong(pInfo.get(i));\r
- p.setLastTime(lastTime);\r
- } catch (NumberFormatException e) {\r
- invalidProgress();\r
- return null;\r
- }\r
- }\r
- }\r
\r
if (!DACommunicator.isDeviceConnected()) {\r
Display.getDefault().syncExec(new Runnable() {\r
}\r
\r
int percent = OpenTraceProgressManager.getInstance().getPercent();\r
- if (loadInfos() && loadCallStackData() && loadCallStackApis()\r
- && loadProfilingData() && loadProfilingChildData()\r
+ if (loadInfos()\r
+// && loadCallStackData() && loadCallStackApis()\r
+// && loadProfilingData() && loadProfilingChildData()\r
&& loadLeakData() && loadFailedData() && loadImageSet()) {\r
\r
OpenTraceProgressManager.getInstance().setProgressPercent(\r
return null;\r
}\r
\r
- ToolbarArea.getInstance().setTime(p.getLastTime());\r
- ToolbarArea.getInstance().setDeviceComboText(p.getDevice());\r
- ToolbarArea.getInstance().setAppComboText(p.getAppName());\r
+ ToolbarArea.getInstance().setTime(project.getLastTime());\r
+ ToolbarArea.getInstance().setDeviceComboText(project.getDevice());\r
+ ToolbarArea.getInstance().setAppComboText(project.getAppName());\r
ToolbarArea.getInstance().checkStartButtonAndAppListEnablement();\r
ToolbarArea.getInstance().setRepalyButtonEnable(true);\r
if (AnalyzerManager.getProject().getProcessInfoHash().isEmpty()) {\r
isSuccess = false;\r
} else {\r
List<String> info = dbInfo.get(0);\r
- TargetInfo target = new TargetInfo();\r
- target.setSystemMemorySize(Long.parseLong(info.get(0)));\r
- target.setStorageSize(Long.parseLong(info.get(1)));\r
- target.setBluetoothSupport(Integer.parseInt(info.get(2)));\r
- target.setGpsSupport(Integer.parseInt(info.get(3)));\r
- target.setWifiSupport(Integer.parseInt(info.get(4)));\r
- target.setCameraCount(Integer.parseInt(info.get(5)));\r
- target.setNetworkType(info.get(6));\r
- target.setMaxBrightness(Integer.parseInt(info.get(7)));\r
- target.setCpuCount(Integer.parseInt(info.get(8)));\r
- AnalyzerManager.getProject().setTargetInfo(target);\r
+ TargetInfo targetInfo = new TargetInfo();\r
+ targetInfo.loadSaveFormat(info);\r
+ AnalyzerManager.getProject().setTargetInfo(targetInfo);\r
}\r
\r
- dbInfo.clear();\r
dbInfo = SqlManager.getInstance().loadProcessInfo();\r
- HashMap<Integer, ProcessInfo> processMap = AnalyzerManager\r
- .getProject().getProcessInfoHash();\r
+ HashMap<Integer, ProcessInfo> processMap = AnalyzerManager.getProject()\r
+ .getProcessInfoHash();\r
if (null == dbInfo) {\r
System.out.println("failed - load Process Info");\r
isSuccess = false;\r
for (int i = 0; i < dbInfo.size(); i++) {\r
List<String> info = dbInfo.get(i);\r
ProcessInfo process = new ProcessInfo();\r
- process.setPid(Integer.parseInt(info.get(0)));\r
- DATime startTime = new DATime();\r
- startTime.setSec(Integer.parseInt(info.get(1)));\r
- startTime.setNano(Integer.parseInt(info.get(2)));\r
- process.setStartTime(startTime);\r
- process.setLowestAddress(Long.parseLong(info.get(3)));\r
- process.setHighestAddress(Long.parseLong(info.get(4)));\r
- process.setBinaryPath(info.get(7));\r
- process.setDepLibCount(Integer.parseInt(info.get(8)));\r
+ process.loadSaveFormat(info.get(i));\r
processMap.put(process.getPid(), process);\r
- }\r
- }\r
\r
- dbInfo.clear();\r
- dbInfo = SqlManager.getInstance().loadLibObj();\r
- if (null == dbInfo) {\r
- System.out.println("failed - load Lib Object");\r
- isSuccess = false;\r
- } else {\r
- for (List<String> info : dbInfo) {\r
- LibraryObject libObj = new LibraryObject();\r
- libObj.setLowestAddress(Long.parseLong(info.get(0)));\r
- libObj.setHighestAddress(Long.parseLong(info.get(1)));\r
- libObj.setLibPath(info.get(2));\r
- int pid = Integer.parseInt(info.get(3));\r
- libObj.setPid(pid);\r
- processMap.get(pid).getLibObjs().add(libObj);\r
+ String option = "where pid = " + process.getPid();\r
+ List<List<String>> objInfo = SqlManager.getInstance().loadLibObj(option);\r
+ if (null == objInfo) {\r
+ System.out.println("failed - load Lib Object");\r
+ isSuccess = false;\r
+ } else {\r
+ for (List<String> libInfo : objInfo) {\r
+ LibraryObject libObj = new LibraryObject();\r
+ libObj.setPid(Integer.parseInt(libInfo.get(0)));\r
+ libObj.setLowestAddress(Long.parseLong(libInfo.get(1)));\r
+ libObj.setHighestAddress(Long.parseLong(libInfo.get(2)));\r
+ libObj.setLibPath(libInfo.get(3));\r
+ process.getLibObjs().add(libObj);\r
+ process.getLibObjHash()\r
+ .put(libObj.getLibPath(), libObj);\r
+ }\r
+ }\r
}\r
}\r
\r
- dbInfo.clear();\r
dbInfo = SqlManager.getInstance().loadApiNames();\r
if (null == dbInfo) {\r
System.out.println("failed - load Api names");\r
boolean isSuccess = true;\r
List<List<String>> dbInfo = SqlManager.getInstance().setloadLeakData();\r
if (null == dbInfo) {\r
- System.out.println("failed - loadLeakData");\r
+ System.out.println("leak data loading failed..");\r
isSuccess = false;\r
} else {\r
LeakDetector leakDectector = AnalyzerManager.getLeakDetector();\r
for (int i = 0; i < dbInfo.size(); i++) {\r
- List<String> pInfo = dbInfo.get(i);\r
- LeakData2 leakData = new LeakData2(pInfo);\r
+ List<String> info = dbInfo.get(i);\r
+ LeakData leakData = new LeakData(info);\r
if (-1 != leakData.getParentKey()) {\r
- LeakData2 parent = leakDectector.getLeakHash().get(\r
+ LeakData parent = leakDectector.getLeakHash().get(\r
leakData.getParentKey());\r
if (null == parent) {\r
continue;\r
continue;\r
}\r
}\r
- FailedData2 failedData = new FailedData2(pInfo);\r
+ FailedData failedData = new FailedData(pInfo);\r
failedChecker.getFailedList().add(failedData);\r
}\r
}\r
} 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
DACommunicator.addDeviceListener();
DACommunicator.loadDevices();
DACommunicator.updateToolbarDevice();
- DACommunicator.setSelectedApp(DACommunicator.getSelectedApp());
+// DACommunicator.setSelectedApp(DACommunicator.getSelectedApp());
init = true;
}
}
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;
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<Integer, ProcessInfo> processInfoHash = new HashMap<Integer, ProcessInfo>();
public TargetInfo getTargetInfo() {
return getTargetInfo().getMaxBrightness();
}
- public DATime getStartTime() {
+ public DATime getProfileStartTime() {
return profilingStartTime;
}
- public void setStartTime(DATime time) {
+ public void setProfileStartTime(DATime time) {
profilingStartTime = time;
}
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
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) {
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<String> 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));
}
}
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();
+ }
}
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$
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<DBTableInfo> 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$
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";
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,
// 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,
// "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);
// "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);
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);
// 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);
// 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,
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;
*/
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;
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;
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;
try {
semaphore.acquire();
} catch (InterruptedException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
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();
}
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<String> insetRowData = new ArrayList<String>();
- 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<List<String>> insetData = new ArrayList<List<String>>();
insetData.add(insetRowData);
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<String> insetRowData = new ArrayList<String>();
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<List<String>> insetData = new ArrayList<List<String>>();
insetData.add(insetRowData);
public void insertProcessInfo() {
DBTableInfo info = DBTableManager.getInstance().getTableInfo(
DBTableManager.TABLE_INDEX_PROCESS_INFO);
- String insertQuery = "insert into " + info.getTableName() + " values ( ?, ?, ?, ?, ?, ?, ?, ? );"; //$NON-NLS-1$
-
- HashMap<Integer, ProcessInfo> processMap = AnalyzerManager.getProject()
- .getProcessInfoHash();
- Set<Integer> keysSet = AnalyzerManager.getProject()
- .getProcessInfoHash().keySet();
- List<Integer> keys = new ArrayList<Integer>();
- keys.addAll(keysSet);
- for (int i = 0; i < keys.size(); i++) {
- ProcessInfo pInfo = processMap.get(keys.get(i));
- List<String> insetRowData = new ArrayList<String>();
- 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<ProcessInfo> processInfoList = new ArrayList<ProcessInfo>();
+ 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<String> insetRowData = new ArrayList<String>();
+ insetRowData.add(pInfo.getSaveFormat());
List<List<String>> insetData = new ArrayList<List<String>>();
insetData.add(insetRowData);
insertQuery(insertQuery, insetData);
- insertLibObj(pInfo.getLibObjs());
+ insertLibObj(pInfo);
}
}
- private void insertLibObj(List<LibraryObject> libs) {
+ private void insertLibObj(ProcessInfo pInfo) {
+ List<LibraryObject> 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<List<String>> insetData = new ArrayList<List<String>>();
for (LibraryObject lib : libs) {
List<String> insetRowData = new ArrayList<String>();
+ insetRowData.add(pid);
insetRowData.add(Long.toString(lib.getLowestAddress()));
insetRowData.add(Long.toString(lib.getHighestAddress()));
insetRowData.add(lib.getLibPath());
DBTableInfo leakTableInfo = DBTableManager.getInstance().getTableInfo(
DBTableManager.TABLE_INDEX_LEAK_DATA);
String insertQuery = leakTableInfo.insertQuery();
- List<LeakData2> leakList = leakDectector.getLeakDataList();
- List<LeakData2> insertData = new ArrayList<LeakData2>();
- for (LeakData2 leakData : leakList) {
+ List<LeakData> leakList = leakDectector.getLeakDataList();
+ List<LeakData> insertData = new ArrayList<LeakData>();
+ for (LeakData leakData : leakList) {
insertData.add(leakData);
if (!leakData.getChildren().isEmpty()) {
- List<LeakData2> children = leakData.getChildren();
- for (LeakData2 child : children) {
+ List<LeakData> children = leakData.getChildren();
+ for (LeakData child : children) {
insertData.add(child);
}
}
insertLeakQuery(insertQuery, insertData);
}
- private boolean insertLeakQuery(String query, List<LeakData2> input) {
+ private boolean insertLeakQuery(String query, List<LeakData> 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);
public void saveFailedData() {
FailedChecker failedChecker = AnalyzerManager.getFailedChecker();
- List<FailedData2> failedList = failedChecker.getFailedList();
+ List<FailedData> failedList = failedChecker.getFailedList();
DBTableInfo failedTableInfo = DBTableManager.getInstance()
.getTableInfo(DBTableManager.TABLE_INDEX_FAILED_DATA);
String insertQuery = failedTableInfo.insertQuery();
insertApiNameQuery(insertQuery, apiNames);
}
- private boolean insertFailedQuery(String query, List<FailedData2> input) {
+ private boolean insertFailedQuery(String query, List<FailedData> input) {
PreparedStatement prep = null;
try {
Connection conn = getConnection();
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());
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);
.getTableName(), null);
}
- public List<List<String>> loadLibObj() {
+ public List<List<String>> 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<List<String>> loadApiNames() {
}
public List<String> getDetailsInfo(String path) {
- List<List<String>> 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<List<String>> dbInfo = selectQuery(path, columnNames,
+ projectInfo.getTableName(), null);
if (dbInfo == null || dbInfo.isEmpty()) {
return null;
}
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;
@Override
public HostResult init(DeviceInfo devInfo) {
// daemon start
- // List<DeviceInfo> 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());
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);
if (null == pInfo) {
pInfo = new ProcessInfo();
if (processMap.isEmpty()) {
- AnalyzerManager.getProject().setMainProcessInfo(pInfo);
+ AnalyzerManager.getProject().setMainPid(pid);
}
processMap.put(pid, pInfo);
}
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;
}
}
// LOG!
-// System.out.println("header log");
-// ByteUtils.printByteArrayForStart(header);
+ // System.out.println("header log");
+ // ByteUtils.printByteArrayForStart(header);
int id = ByteUtils.toInt(header, 0);
}
});
endingSteps();
- }
+ }
}
private void endingSteps() {
setFuncName(pData);
apiName = pData.getApiName();
if (apiName.equals("<unknown function>")) {
-
continue;
}
}
*/
package org.tizen.dynamicanalyzer.swap.model;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+
public class DATime {
private int sec = 0;
private int nano = 0;
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]);
+ }
}
*/
package org.tizen.dynamicanalyzer.swap.model.control;
+import java.util.List;
+
public class TargetInfo {
private long systemMemorySize = 0;
private long storageSize = 0;
public void setDevices(String devices) {
this.devices = devices;
}
+
+ public void loadSaveFormat(List<String> 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);
+ }
}
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;
}
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;
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]);
+ }
}
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;
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;
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;
private boolean isClosedFile = true;
private boolean isFailedAPI = false;
// for Detail View Data
- private List<FailedData2> failedData = null;
+ private List<FailedData> failedData = null;
private long fileSize = 0;
private long readSize = 0;
private long writeSize = 0;
}
}
- public List<FailedData2> getFailedData() {
+ public List<FailedData> getFailedData() {
if (null == failedData) {
- failedData = new ArrayList<FailedData2>();
+ failedData = new ArrayList<FailedData>();
}
return failedData;
}
List<Integer> output = new ArrayList<Integer>();
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);
}
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;
return this.writeSize;
}
- public void setFailedData(FailedData2 data) {
+ public void setFailedData(FailedData data) {
failedData = data;
}
- public FailedData2 getFailedData() {
+ public FailedData getFailedData() {
return failedData;
}
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;
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;
// 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();
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;
private boolean isClosedSocket = true;
private boolean isFailedAPI = false;
// for Detail View Data
- private List<FailedData2> failedData = null;
+ private List<FailedData> failedData = null;
private long messageSize = 0;
private long sendSize = 0;
private long recvSize = 0;
}
}
- public List<FailedData2> getFailedData() {
+ public List<FailedData> getFailedData() {
if (null == failedData) {
- failedData = new ArrayList<FailedData2>();
+ failedData = new ArrayList<FailedData>();
}
return failedData;
}
List<String> output = new ArrayList<String>();
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);
}
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;
return this.recvSize;
}
- public void setFailedData(FailedData2 data) {
+ public void setFailedData(FailedData data) {
failedData = data;
}
- public FailedData2 getFailedData() {
+ public FailedData getFailedData() {
return failedData;
}
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;
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;
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);
}
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;
}
protected List<TableInput> makeTableInput() {
- List<FailedData2> failedList = null;
+ List<FailedData> failedList = null;
if (isRange) {
failedList = RangeDataManager.getInstance().getFailedChecker()
.getFailedList();
List<String> text = new ArrayList<String>();
List<String> data = new ArrayList<String>();
- FailedData2 failedData = failedList.get(i);
+ FailedData failedData = failedList.get(i);
text.add(Integer.toString(failedData.getSeq()));
data.add(Integer.toString(failedData.getSeq()));
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;
public class FailedChecker {
- List<FailedData2> failedList;
+ List<FailedData> failedList;
public void check(LogData log, BaseCallstackManager cm) {
if (log instanceof MemoryData) {
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<FailedData2> getFailedList() {
+ public List<FailedData> getFailedList() {
if (null == failedList) {
- failedList = new ArrayList<FailedData2>();
+ failedList = new ArrayList<FailedData>();
}
return failedList;
}
*
*/
-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;
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;
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();
err = plog.getErrno();
callerPc = plog.getCallerPcAddr();
data = log;
+ pid = log.getPid();
+ // TODO:
+ libName = null;
}
- public FailedData2(List<String> input) {
+ public FailedData(List<String> input) {
if (null != input && !input.isEmpty()) {
id = Integer.parseInt(input.get(ID_INDEX));
seq = Integer.parseInt(input.get(SEQ_INDEX));
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);
}
}
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;
+ }
+
}
* - 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<LeakData2> children;
+ private List<LeakData> children;
- public LeakData2(LogData log, LeakDetector leakDetector) {
+ public LeakData(LogData log, LeakDetector leakDetector) {
leakSeq = leakDetector.getLeakSeq();
leakDetector.increaseLeakSeq();
this.key = log.getKey();
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<String> 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<String> 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() {
}
public String getName() {
- return name;
+ return apiName;
}
public void setName(String name) {
- this.name = name;
+ this.apiName = name;
}
public String getParam() {
}
public long getRet() {
- return ret;
+ return retValue;
}
public void setRet(long ret) {
- this.ret = ret;
+ this.retValue = ret;
}
public int getLeakSeq() {
}
public long getCallerPc() {
- return callerPc;
+ return callerPcAddr;
}
public void setCallerPc(long callerPc) {
- this.callerPc = callerPc;
+ this.callerPcAddr = callerPc;
}
- public List<LeakData2> getChildren() {
+ public List<LeakData> getChildren() {
if (null == children) {
- children = new ArrayList<LeakData2>();
+ children = new ArrayList<LeakData>();
}
return children;
}
- public void setChildren(List<LeakData2> children) {
+ public void setChildren(List<LeakData> children) {
this.children = children;
}
- public void addChild(LeakData2 child) {
+ public void addChild(LeakData child) {
getChildren().add(child);
}
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;
+ }
+
}
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;
public final static int API_TYPE_CLOSE = 1;
public final static int API_TYPE_REALLOC = 2;
- HashMap<Integer, LeakData2> leakHash;
- HashMap<Integer, LeakData2> childHash;
+ HashMap<Integer, LeakData> leakHash;
+ HashMap<Integer, LeakData> childHash;
private int leakSeq = 0;
public LeakDetector() {
}
- public List<LeakData2> getLeakDataList() {
- List<LeakData2> leakList = new ArrayList<LeakData2>();
+ public List<LeakData> getLeakDataList() {
+ List<LeakData> leakList = new ArrayList<LeakData>();
leakList.addAll(getLeakHash().values());
return leakList;
}
- public HashMap<Integer, LeakData2> getLeakHash() {
+ public HashMap<Integer, LeakData> getLeakHash() {
if (null == leakHash) {
- leakHash = new HashMap<Integer, LeakData2>();
+ leakHash = new HashMap<Integer, LeakData>();
}
return leakHash;
}
- public HashMap<Integer, LeakData2> getChildHash() {
+ public HashMap<Integer, LeakData> getChildHash() {
if (null == childHash) {
- childHash = new HashMap<Integer, LeakData2>();
+ childHash = new HashMap<Integer, LeakData>();
}
return childHash;
}
{
// System.out.println("file arrived");
}
- HashMap<Integer, LeakData2> leaks = getLeakHash();
+ HashMap<Integer, LeakData> 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()) {
// 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));
}
}
}
// user call
if (AnalyzerManager.getCallstackManager().isUserCall(
callerFunc.getFunctionName())) {
- HashMap<Integer, LeakData2> leaks = getLeakHash();
- LeakData2 newLeak = new LeakData2(log, this);
+ HashMap<Integer, LeakData> leaks = getLeakHash();
+ LeakData newLeak = new LeakData(log, this);
leaks.put(newLeak.getKey(), newLeak);
}
// for internal leak
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;
}
// !! recursive!!
- public void makeChildTree(List<LeakData2> children, TreeInput parent,
+ public void makeChildTree(List<LeakData> 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);
@Override
public List<TreeInput> makeTreeInput() {
List<TreeInput> output = new ArrayList<TreeInput>();
- HashMap<Integer, LeakData2> leaks = null;
+ HashMap<Integer, LeakData> leaks = null;
if (isRange) {
leaks = RangeDataManager.getInstance().getLeakDetector()
.getLeakHash();
} else {
leaks = AnalyzerManager.getLeakDetector().getLeakHash();
}
- ArrayList<LeakData2> leakList = new ArrayList<LeakData2>();
+ ArrayList<LeakData> leakList = new ArrayList<LeakData>();
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()));
return output;
}
- private TreeInput makeInput(LeakData2 leakData) {
+ private TreeInput makeInput(LeakData leakData) {
DATableDataFormat tableData = new DATableDataFormat(
leakData.getLeakSeq());
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++;
this.key = key;
callerPc = ((ProbeCommonData) data).getCallerPcAddr();
logData = data;
+ pid = data.getPid();
+ // TODO:
+ libName = null;
}
public List<String> getData() {
public static void resetSeq() {
uNum = 1;
}
-
+
public long getCallerPc() {
return callerPc;
}
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;
+ }
+
}
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;
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,
private void createMainThreadItem() {
isStart = true;
Project project = AnalyzerManager.getProject();
- int tid = project.getMainProcessInfo().getPid();
+ int tid = project.getMainPid();
if (0 == tid) {
isStart = false;
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() {
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;
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,
createTime = CommonConstants.EMPTY;
device = CommonConstants.EMPTY;
application = CommonConstants.EMPTY;
- elapsedTime = CommonConstants.ZERO;
+ elapsedTime = 0;
}
detail.redraw();
}
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;
}
}
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$
}
private void createPackage(long last, int type) {
- // List<LogCenter> logCenters = AnalyzerManager.getLogCenters();
List<LogData> input = null;
LogPackage logPackage = new LogPackage();
long from = 0;
logs.setLogs(input);
logPackage.setLogs(type, logs);
} else {
- // int size = logCenters.size();
List<Integer> ids = LogDataFactory.getLogList();
int size = ids.size();
for (int i = 0; i < size; i++) {
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();
}
}