}\r
\r
int percent = OpenTraceProgressManager.getInstance().getPercent();\r
- if (loadInfos()\r
- // && loadCallStackData() && loadCallStackApis()\r
- // && loadProfilingData() && loadProfilingChildData()\r
+ if (loadInfos() && loadCallStackData() && loadCallStackApis()\r
+ && loadProfilingData() && loadProfilingChildData()\r
&& loadLeakData() && loadFailedData() && loadImageSet()) {\r
\r
OpenTraceProgressManager.getInstance().setProgressPercent(\r
for (int i = 0; i < dbInfo.size(); i++) {\r
List<String> info = dbInfo.get(i);\r
ProcessInfo process = new ProcessInfo();\r
- process.loadSaveFormat(info.get(i));\r
+ process.loadSaveFormat(info.get(1));\r
pInfos.add(process);\r
if (i == 0) {\r
pip.setPid(process.getPid());\r
pip.setPpid(process.getPpid());\r
- pip.setTargetBinaryPath(process.getMainTargetBinaryPath());\r
+ pip.setTargetBinaryPath(process\r
+ .getMainTargetBinaryPath());\r
}\r
String subOption = "where pid = " + process.getPid()\r
- + " and time = "\r
- + process.getStartTime().getSaveFormat();\r
+ + " and time = \'"\r
+ + process.getStartTime().getSaveFormat() + "\'";\r
List<List<String>> objInfo = SqlManager.getInstance()\r
.loadLibObj(subOption);\r
if (null == objInfo) {\r
// process info
{
- String[] names = { PROCESS_INFO };
- String[] options = { EMPTY };
- String[] types = { TEXT };
+ String[] names = {COMMON_COLUMN_PID, PROCESS_INFO };
+ String[] options = { EMPTY, EMPTY };
+ String[] types = { TEXT, TEXT };
DBTableInfo processInfoTableInfo = new DBTableInfo(
TABLE_NAME_PROCESS_INFO, names, options, types);
tableInfos.set(TABLE_INDEX_PROCESS_INFO, processInfoTableInfo);
for (int i = 0; i < processInfoList.size(); i++) {
ProcessInfo pInfo = processInfoList.get(i);
- List<String> insetRowData = new ArrayList<String>();
- insetRowData.add(pInfo.getSaveFormat());
+ List<String> insertRowData = new ArrayList<String>();
+ insertRowData.add(Integer.toString(pInfo.getPid()));
+ insertRowData.add(pInfo.getSaveFormat());
List<List<String>> insetData = new ArrayList<List<String>>();
- insetData.add(insetRowData);
+ insetData.add(insertRowData);
insertQuery(insertQuery, insetData);
insertLibObj(pInfo);
public final static int MSG_PROBE_SYNC = 0x0110;
public final static int MSG_PROBE_NETWORK = 0x0111;
public final static int MSG_PROBE_GLES20 = 0x0112;
+
+ public final static int DB_TYPE_PROFILE = 0x0001;
+ public final static int DB_TYPE_CONTEXTSWITCH = 0x0002;
+ public final static int DB_TYPE_PROBE = 0x0004;
+ public final static int DB_TYPE_SYSTEM = 0x0008;
}
}
public String getSaveFormat() {
- return Integer.toString(sec) + CommonConstants.COMMA
+ return Integer.toString(sec) + CommonConstants.DASH
+ Integer.toString(nano);
}
public void loadSaveFormat(String saveData) {
- String[] splitData = saveData.split(CommonConstants.COMMA);
+ String[] splitData = saveData.split(CommonConstants.DASH);
sec = Integer.parseInt(splitData[0]);
nano = Integer.parseInt(splitData[1]);
}
prep.setInt(index++, pid);
prep.setInt(index++, tid);
prep.setInt(index++, cpuNum);
- prep.setLong(index++, ret);
prep.setString(index++, args);
+ prep.setLong(index++, ret);
prep.setString(index++, apiName);
+ prep.setString(index++, libName);
prep.setString(index++, callstack);
}
pid = rs.getInt(index++);
tid = rs.getInt(index++);
cpuNum = rs.getInt(index++);
- ret = rs.getLong(index++);
args = rs.getString(index++);
+ ret = rs.getLong(index++);
apiName = rs.getString(index++);
libName = rs.getString(index++);
callstack = rs.getString(index++);
dbColumnNames = HeaderColumns.getDBColumnNames();
dbColumnNames.addAll(Arrays.asList(dcn));
- Integer[] dct = { L, L, I, I, I, I, I, T, L, T, T, T };
+ Integer[] dct = { L, L, I, I, I, I, I, T, T, T, T, T };
dbColumnTypes = HeaderColumns.getDBColumntypes();
dbColumnTypes.addAll(Arrays.asList(dct));
tableColumnNames = HeaderColumns.getTableColumnNames();
tableColumnNames.addAll(Arrays.asList(tcn));
- Integer[] types = { L, L, I, I, I, I, I, S, L, S, S, S };
+ Integer[] types = { L, L, I, I, I, I, I, S, S, S, S, S };
logColumnTypes = HeaderColumns.getLogColumnTypes();
logColumnTypes.addAll(Arrays.asList(types));
}
AnalyzerManager.setLogParsingComplete(false);
Project p = AnalyzerManager.getProject();
long last = p.getLogCount();
- createPackage(last, DataChannelConstants.MSG_PROBE_FILE);
-
last = p.getDeviceLogCount();
- createPackage(last, DataChannelConstants.MSG_DATA_SYSTEM);
+ createPackage(last, DataChannelConstants.DB_TYPE_SYSTEM);
last = p.getProfileLogCount();
- createPackage(last, DataChannelConstants.MSG_DATA_SAMPLE);
+ createPackage(last, DataChannelConstants.DB_TYPE_PROFILE);
+
+ createPackage(last, DataChannelConstants.DB_TYPE_PROBE);
+ // TODO : context switch data
+ // last = p.getProfileLogCount();
+ // createPackage(last, DataChannelConstants.MSG_DATA_SAMPLE);
System.out.println("input reader complete"); //$NON-NLS-1$
AnalyzerManager.setLogParsingComplete(true);
private void createPackage(long last, int type) {
List<LogData> input = null;
- LogPackage logPackage = new LogPackage();
long from = 0;
long to = AnalyzerConstants.DATABASE_READ_SIZE;
while (!Thread.interrupted()) {
if (to >= last) {
to = last;
}
- if (type == DataChannelConstants.MSG_DATA_SAMPLE
- || type == DataChannelConstants.MSG_DATA_SYSTEM) {
- input = SqlManager.getInstance().selectArea(type, from, to);
- Logs logs = new Logs(type);
- logs.setLogs(input);
- logPackage.setLogs(type, logs);
- } else {
+
+ LogPackage logPackage = new LogPackage();
+ switch (type) {
+ case DataChannelConstants.DB_TYPE_PROFILE:
+ input = SqlManager.getInstance().selectArea(
+ DataChannelConstants.MSG_FUNCTION_ENTRY, from, to);
+ if (null != input && !input.isEmpty()) {
+ for (int i = 0; i < input.size(); i++) {
+ int id = input.get(i).getId();
+ logPackage.setLogs(id, input.get(i));
+ }
+ }
+ break;
+ case DataChannelConstants.DB_TYPE_PROBE:
List<Integer> ids = LogDataFactory.getLogList();
int size = ids.size();
for (int i = 0; i < size; i++) {
int id = ids.get(i);
- if (id == DataChannelConstants.MSG_DATA_SAMPLE
- || id == DataChannelConstants.MSG_DATA_SYSTEM) {
+ if (id == DataChannelConstants.MSG_CONTEXT_SWITCH_ENTRY
+ || id == DataChannelConstants.MSG_CONTEXT_SWITCH_EXIT
+ || id == DataChannelConstants.MSG_FUNCTION_ENTRY
+ || id == DataChannelConstants.MSG_FUNCTION_EXIT
+ || id == DataChannelConstants.MSG_DATA_SAMPLE
+ || id == DataChannelConstants.MSG_DATA_SYSTEM
+ || id == DataChannelConstants.MSG_DATA_RECORD) {
continue;
}
Logs logs = new Logs(id);
input = SqlManager.getInstance().selectArea(id, from, to);
- logs.setLogs(input);
- logPackage.setLogs(id, logs);
+ if (null != input && !input.isEmpty()) {
+ logs.setLogs(input);
+ logPackage.setLogs(id, logs);
+ }
} // for
+ break;
+ case DataChannelConstants.DB_TYPE_SYSTEM:
+ input = SqlManager.getInstance().selectArea(
+ DataChannelConstants.MSG_DATA_SYSTEM, from, to);
+ Logs logs = new Logs(DataChannelConstants.MSG_DATA_SYSTEM);
+ if (null != input && !input.isEmpty()) {
+ logs.setLogs(input);
+ logPackage.setLogs(DataChannelConstants.MSG_DATA_SYSTEM,
+ logs);
+ }
+ break;
+ case DataChannelConstants.DB_TYPE_CONTEXTSWITCH:
+ // TODO:
+ break;
+ default:
+ break;
}
- updateLog(logPackage);
+ if (!logPackage.isEmpty()) {
+ updateLog(logPackage);
+ }
if (to == last) {
break;
}