public static final String CMD_IS_ARM_ARCH = "uname -m"; //$NON-NLS-1$
public static final String CMD_CAT_PORT_FILE = "cat /tmp/port.da"; //$NON-NLS-1$
-
- public static final String CMD_MD_5_SUM = "/usr/bin/md5sum "; //$NON-NLS-1$
+
+ public static final String CMD_DA_MD_5_SUM = "da md5sum "; //$NON-NLS-1$
+ public static final String CMD_MD_5_SUM = "/usr/bin/md5sum"; //$NON-NLS-1$
}
public static final String EXTENSION_JPG_IMAGE = ".jpg"; //$NON-NLS-1$
public static final String EXTENSION_PNG_IMAGE = ".png"; //$NON-NLS-1$
public static final String EXTENSION_GIF_IMAGE = ".gif"; //$NON-NLS-1$
+ public static final String EXTENSION_EXEC_FILE = ".exe"; //$NON-NLS-1$
/* Arch */
public static final String ARM_ARCH = "arm"; //$NON-NLS-1$
}
long addr = symbol.st_value.getValue().longValue();
String symbolStr = symbol.toString();
+ symbolStr = SymbolManager.demanglingFunctionName(symbolStr);
symbolMap.put(addr, symbolStr);
addrSymbolPairs.add(new AddrSymbolPair(addr, symbolStr));
}
return ret;
}
- public HashMap<Long, String> symbolMap() {
+ public HashMap<Long, String> getSymbolMap() {
return symbolMap;
}
sourcePath = null;
if (null != symbolMap) {
symbolMap.clear();
- symbolMap = null;
}
if (null != addrSymbolPairs) {
addrSymbolPairs.clear();
- addrSymbolPairs = null;
}
}
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.common.SymbolManager;
import org.tizen.dynamicanalyzer.communicator.CommunicatorUtils;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.model.ImageInfo;
import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
import org.tizen.dynamicanalyzer.project.Project;
boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
String baseAddr = Long.toString(AnalyzerManager.getProject()
.getBaseAddress());
- String path = AnalyzerManager.getProject().getBinaryPath();
+// String path = AnalyzerManager.getProject().getBinaryPath();
+ String path = DACommunicator.getSelectedApp().getBinInfo().getPath();
String pcAddr = Long.toString(input.getPcAddr());
String functionName = SymbolManager.addr2func(path, pcAddr, isPieBuild,
baseAddr);
private BinaryInfo binInfo = null;
private String installTime = null;
+ private String execFileName = null;
private ElfSymbolExtracter symbolExtractor = new ElfSymbolExtracter();
symbolExtractor.makeSymbol(binInfo.getPath());
return symbolExtractor.getAddrSymbolPairs();
}
+
+ public String getExecFileName() {
+ if (null == execFileName) {
+ String execPath = appInfo.get(EXEC_INDEX);
+ String[] splitPath = execPath.split(CommonConstants.SLASH);
+ execFileName = splitPath[splitPath.length - 1]
+ + CommonConstants.EXTENSION_EXEC_FILE;
+ }
+ return execFileName;
+ }
}
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.model.LogCenter;
import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.control.TargetInfo;
import org.tizen.dynamicanalyzer.swap.model.data.ApiNameManager;
import org.tizen.dynamicanalyzer.swap.model.data.BasicDataMessage;
public boolean insertLogQuery(int id, String query,
List<BasicDataMessage> input) {
PreparedStatement prep = null;
+ BasicDataMessage msg = null;
try {
Connection conn = getConnection();
if (null == conn || null == query || null == input) {
prep = conn.prepareStatement(query);
int dataRowSize = input.size();
for (int i = 0; i < dataRowSize; i++) {
- BasicDataMessage msg = input.get(i);
+ msg = input.get(i);
int logNum = LogDataFactory.getLogCountById(id);
+ if (id == 0x2007) {
+ System.out.println("[!!!]insert to system : " + msg.getId()
+ + " " + msg.getSeq() + " " + msg.getTime()
+ + " size :" + msg.getPayload().length);
+ ByteUtils.printByteArray(msg.getPayload());
+ }
prep.setInt(1, logNum);
prep.setInt(2, msg.getId());
prep.setInt(3, msg.getSeq());
prep.executeBatch();
conn.setAutoCommit(true);
} catch (SQLException e) {
+ System.out.println("[Error insert] id = " + msg.getId()
+ + " seq : " + msg.getSeq());
e.printStackTrace();
} finally {
if (null != prep) {
String tableName = LogDataFactory.getTableNamebyId(logId);
String insertQuery = "insert into " + tableName
+ " values( ?, ?, ?, ?, ?);";
-// System.out.println("inser query : " + insertQuery);
+ // System.out.println("inser query : " + insertQuery);
insertLogQuery(logId, insertQuery, input);
}
bdm.setPayload(rs.getBytes(5));
LogData log = LogDataFactory.createInstance(bdm);
logs.add(log);
+ if (bdm.getId() == 0x2007) {
+ System.out.println("read system data seq = "
+ + bdm.getSeq());
+ ByteUtils.printByteArray(bdm.getPayload());
+ }
}
} catch (SQLException e) {
System.out.println("SQLException - selecte : " + query);
appInfo.setAppType(ApplicationInfo.APPTYPE_COMMON_EXEC);
}
appInfo.setAppId(selectedApp.getInfo(AppInfo.APPID_INDEX));
- appInfo.setExecPath(selectedApp.getInfo(AppInfo.EXEC_INDEX));
+ appInfo.setExecPath(selectedApp.getInfo(AppInfo.EXEC_INDEX) + ".exe");
RunTimeConfiguration rt = new RunTimeConfiguration();
rt.setFeatures(ConfigureManager.getInstance().getConfiguration());
}
// TODO: app inst , replay info added!!
- byte[] rear = ByteUtils.getByte(appInfo.getByteValue(),
- rt.getByteValue(), getUserSpaceInst().getByteValue(),
- replayEvent);
// byte[] rear = ByteUtils.getByte(appInfo.getByteValue(),
- // rt.getByteValue(), 0,0);
+ // rt.getByteValue(), getUserSpaceInst().getByteValue(),
+ // replayEvent);
+ byte[] rear = ByteUtils.getByte(appInfo.getByteValue(),
+ rt.getByteValue(), 0, 0);
int length = rear.length;
byte[] ret = ByteUtils.getByte(AnalyzerConstants.MSG_START_SWAP,
FunctionInst functionInst = new FunctionInst();
functionInst.setAddr(addrSymbol.getAddr());
functionInst.setArgs(getFunctionArgs(addrSymbol.getSymbol()));
+ System.out.println("DEBUG : addr " + addrSymbol.getAddr()
+ + " symbol " + addrSymbol.getSymbol() + " args ");
+ ByteUtils.printByteArray(functionInst.getArgs());
functionInstList.add(functionInst);
}
int binaryType = ByteUtils.toInt(payload, 0);
String targetPath = selectedApp.getInfo(AppInfo.EXEC_INDEX);
- String binaryPath = ByteUtils.getString(payload, INT_SIZE);
- if (null == binaryPath) {
+ String binaryDir = ByteUtils.getString(payload, INT_SIZE).trim();
+ String binaryPath = null;
+ if (null == binaryDir) {
// return HostResult.ERR_BIN_INFO_GET_FAIL;
binaryPath = CommonConstants.EMPTY;
}
+
+ StringBuffer strBuf = new StringBuffer();
+ strBuf.append(binaryDir).append(File.separator)
+ .append(selectedApp.getExecFileName());
+ binaryPath = strBuf.toString();
binInfo.setType(binaryType);
// host has no binary file - pull binary file from target
}
// host has binary then compare binary hash target and local
- String command = AnalyzerShellCommands.CMD_MD_5_SUM + targetPath;
- CommunicatorUtils.execShellCommand(command, new MultiLineReceiver() {
+ String command = AnalyzerShellCommands.CMD_DA_MD_5_SUM + targetPath;
+ // + CommonConstants.EXTENSION_EXEC_FILE;
+ CommunicatorUtils.execHostCommand(command, new MultiLineReceiver() {
@Override
public void processNewLines(String[] appLines) {
binaryHashMultiLines.clear();
.split(CommonConstants.SPACE);
String targetHashCode = new String(splitResult[0]);
String localHashCode = null;
- command = AnalyzerShellCommands.CMD_MD_5_SUM + binaryPath;
+ // command = AnalyzerShellCommands.CMD_MD_5_SUM + "\"" + binaryPath +
+ // "\"";
try {
- Process process = Runtime.getRuntime().exec(command);
+ Runtime rt = Runtime.getRuntime();
+ // Process process = rt.exec(command);
+ Process process = rt.exec(new String[] {
+ AnalyzerShellCommands.CMD_MD_5_SUM, binaryPath });
+ process.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(
process.getInputStream()));
+ BufferedReader error = new BufferedReader(new InputStreamReader(
+ process.getErrorStream()));
String line = reader.readLine();
+ String errorStr = error.readLine();
+ if (null == line) {
+ System.out.println("host md5sum get failed : " + errorStr);
+ return HostResult.ERR_BIN_INFO_GET_FAIL;
+ }
splitResult = line.trim().split(CommonConstants.SPACE);
localHashCode = new String(splitResult[0]);
} catch (IOException e) {
e.printStackTrace();
return HostResult.ERR_BIN_INFO_GET_FAIL;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
}
// hash code is not same - get binary from target
// change binary file path of host
- if (!targetHashCode.equals(localHashCode)) {
- SyncResult res = CommunicatorUtils.pull(targetPath,
- AnalyzerPaths.TEMP_FOLDER_PATH);
- if (null != res && res.isOk()) {
- System.out.println("binary copy success!!");//$NON-NLS-1$
- } else {
- System.out.println("Failed to get " + targetPath + " step 2"); //$NON-NLS-1$
- return HostResult.ERR_BIN_INFO_GET_FAIL;
- }
- String[] splitName = binaryPath.split(CommonConstants.SLASH);
- binaryPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator
- + new String(splitName[splitName.length - 1]);
- binInfo.setPath(binaryPath);
- // selectedApp.setBinInfo(binInfo);
- }
+
+ // FIXME: permission denied problem
+
+ // if (!targetHashCode.equals(localHashCode)) {
+ // String name = selectedApp.getInfo(AppInfo.LABEL_INDEX);
+ // String destFilePath = AnalyzerPaths.TEMP_FOLDER_PATH
+ // + File.separator + name
+ // + CommonConstants.EXTENSION_EXEC_FILE;
+ // SyncResult res = CommunicatorUtils.pull(targetPath,
+ // destFilePath);
+ // if (null != res && res.isOk()) {
+ // System.out.println("binary copy success!!");//$NON-NLS-1$
+ // } else {
+ // System.out.println("Failed to get " + targetPath + " step 2"); //$NON-NLS-1$
+ // return HostResult.ERR_BIN_INFO_GET_FAIL;
+ // }
+ // String[] splitName = binaryPath.split(CommonConstants.SLASH);
+ // binaryPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator
+ // + new String(splitName[splitName.length - 1]);
+ // binInfo.setPath(binaryPath);
+ // // selectedApp.setBinInfo(binInfo);
+ // }
binInfo.setPath(binaryPath);
// selectedApp.setBinInfo(binInfo);
dataSock.setSoTimeout(AnalyzerConstants.SOCKET_TIMEOUT);
dataSock.setReuseAddress(true);
dataSock.setTcpNoDelay(true);
-
-// byte[] testBuffer = new byte[1024];
-// dataSock.getInputStream().read(testBuffer);
-// ByteUtils.printByteArray(testBuffer);
+
+ // byte[] testBuffer = new byte[1024];
+ // dataSock.getInputStream().read(testBuffer);
+ // ByteUtils.printByteArray(testBuffer);
} catch (UnknownHostException e) {
result = HostResult.ERR_EXCEPTION_OCCURRED;
result.setMessage(e.getMessage());
int start = symbol.indexOf(CommonConstants.OPEN_BRACKET);
int end = symbol.indexOf(CommonConstants.CLOSE_BRACKET);
- String argStr = symbol.substring(start, end).trim();
+ byte[] emptyRet = new byte[1];
+ emptyRet[0] = 0;
+ if (start < 0 || end < 0) {
+ return emptyRet;
+ }
+ String argStr = symbol.substring(start + 1, end).trim();
if (argStr.isEmpty()) {
- return new byte[0];
+ return emptyRet;
}
String[] args = argStr.split(CommonConstants.COMMA);
- byte[] ret = new byte[args.length];
+ byte[] ret = new byte[args.length + 1];
+ ret[args.length] = 0;
for (int i = 0; i < args.length; i++) {
String arg = args[i];
int index = arg.indexOf(CommonConstants.SPACE);
- arg = arg.substring(0, index - 1);
+ if (index > 0) {
+ arg = arg.substring(0, index - 1);
+ }
ret[i] = (byte) getArgType(arg);
}
final int MSG_SPLIT_SIZE = 3;
/* Message Buffer max length */
- final int MSG_BUFFER_MAX = 100;
+ final int MSG_BUFFER_MAX = 1000;
final int MSG_BUFFER_TIMER_DELAY = 5;
final int MSG_BUFFER_TIMER_PERIOD = 1000; // 1 second
final int WAITING_TIME = 100;
byte[] payload = null;
while (true) {
-// int available = inputStream.available();
-// if (available < 20) {
-// System.out.println("not available : " + available);
-// continue;
-// }
-// System.out.println(" Available size : " + available);
+ // int available = inputStream.available();
+ // if (available < 20) {
+ // System.out.println("not available : " + available);
+ // continue;
+ // }
+ // System.out.println(" Available size : " + available);
int readSize = inputStream.read(header);
if (!DACommunicator.isRunning() && readSize == -1) {
// manager socket closed!!
if (readSize <= 0) {
continue;
} else {
-// ByteUtils.printByteArray(header);
+ ByteUtils.printByteArray(header);
+
+ // for (int i = 0; i < 100; i++) {
+ // System.out.print(" ");
+ // }
+ // System.out.println();
+
int id = ByteUtils.toInt(header, 0);
int seq = ByteUtils.toInt(header, 4);
break;
}
- if (MSG_BUFFER_MAX < messageCount) {
+ if (MSG_BUFFER_MAX <= messageCount) {
addBufferToList();
messageCount = 0;
}
AnalyzerManager.getProject().setLastLogNum(seqNum, id);
}
- System.out.println("update logs");
+// System.out.println("update logs");
updateLog(logPack);
}
}
private void setFuncName(ProfileData input) {
- boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
+// boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
+ boolean isPieBuild = (DACommunicator.getSelectedApp().getBinInfo().getType() == 1)?true:false;
String baseAddr = Long.toString(AnalyzerManager.getProject()
.getBaseAddress());
- String path = AnalyzerManager.getProject().getBinaryPath();
+// String path = AnalyzerManager.getProject().getBinaryPath();
+ String path = DACommunicator.getSelectedApp().getBinInfo().getPath();
// String path = DACommunicator.getSelectedApp().getBinInfo().getPath();
String pcAddr = Long.toString(input.getPcAddr());
String functionName = SymbolManager.addr2func(path, pcAddr, isPieBuild,
public static final int HEADER_SIZE = ID_SIZE + SEQ_SIZE + TIME_SIZE
+ PAYLOAD_LENGTH_SIZE;
- private boolean PRINT_DATA = true;
+ private boolean PRINT_DATA = false;
protected int id = -1;
protected int seq = -1;
protected boolean complete = false;
protected String callstackLog = null;
- private int reqSize = 0;
- private byte[] headerBuffer = new byte[HEADER_SIZE];
- private byte[] emptyHeaderBuffer = new byte[HEADER_SIZE];
-
- // private byte[] emptyBuffer = null;
- private int bufferStart = 0;
-
-// public byte[] makeData(byte[] input) {
-
-// if (null == input || input.length <= 0) {
-// return input;
-// }
-// bufferStart = 0;
-// // header is parsing?
-// if (id < 0) { // header is not parsing
-// if (reqSize == 0) {
-// reqSize = HEADER_SIZE;
-// }
-//
-// int copySize = (reqSize < input.length) ? reqSize : input.length;
-// System.arraycopy(input, 0, headerBuffer, HEADER_SIZE - reqSize,
-// copySize);
-// if (input.length < reqSize) {
-// reqSize = reqSize - input.length;
-// return new byte[0];
-// } else {
-// bufferStart = reqSize;
-// reqSize = 0;
-// }
-// // parsing header
-// // ByteUtils.printByteArray(headerBuffer);
-// id = ByteUtils.toInt(headerBuffer);
-// seq = ByteUtils.toInt(headerBuffer, ID_SIZE);
-// long sec = ByteUtils.toInt(headerBuffer, ID_SIZE + SEQ_SIZE);
-// long nano = ByteUtils.toInt(headerBuffer, ID_SIZE + SEQ_SIZE
-// + INT_SIZE);
-//
-// DATime startTime = AnalyzerManager.getProject().getStartTime();
-// long startSec = startTime.getSec();
-// long startNano = startTime.getNano();
-//
-// // if (0 == startSec && 0 == startNano) {
-// // startTime.setSec(sec);
-// // startTime.setNano(nano);
-// // AnalyzerManager.getProject().setStartTime(startTime);
-// // startSec = sec;
-// // startNano = nano;
-// // }
-//
-// long resultSec = sec - startSec;
-// long resultNano = nano - startNano;
-//
-// time = resultSec * 1000000 + resultNano / 1000;
-//
-// payloadSize = ByteUtils.toInt(headerBuffer, ID_SIZE + SEQ_SIZE
-// + TIME_SIZE);
-// // clear headerBuffer
-// System.arraycopy(emptyHeaderBuffer, 0, headerBuffer, 0, HEADER_SIZE);
-// // input - headerBuffer = buffer
-// payload = new byte[payloadSize];
-// // System.out.println("DEBUG - id :" + String.format("%4x", id)
-// // + " seq :" + seq + " time :" + time
-// // + " payload size : " + payloadSize + " request size :"
-// // + reqSize + " input length :" + input.length);
-// }
-//
-// reqSize = (0 == reqSize) ? payloadSize : reqSize;
-//
-// int cpSize = (input.length - bufferStart > reqSize) ? reqSize
-// : input.length - bufferStart;
-// System.arraycopy(input, bufferStart, payload, payloadSize - reqSize,
-// cpSize);
-// if (reqSize > cpSize) {
-// reqSize = reqSize - cpSize;
-// return new byte[0];
-// } else {
-// int retIndex = bufferStart + reqSize;
-// byte[] ret = new byte[input.length - retIndex];
-// System.arraycopy(input, retIndex, ret, 0, input.length - retIndex);
-// complete = true;
-// return ret;
-// }
-
-
-// }
-
-// public byte[] addData(byte[] input) {
-// // int remainSize = (payloadSize - payload.length > 0) ? payloadSize
-// // - payload.length : DataChannelConstants.BUFFER_SIZE;
-//
-// int cpSize = (reqSize > input.length) ? input.length : reqSize;
-// int cpIndex = payloadSize - reqSize;
-//
-// System.arraycopy(input, 0, payload, cpIndex, cpSize);
-//
-// byte[] ret = new byte[0];
-// if (reqSize > input.length) {
-// reqSize = reqSize - input.length;
-// } else {
-// ret = new byte[input.length - reqSize];
-// System.arraycopy(input, reqSize, ret, 0, ret.length);
-// complete = true;
-// }
-//
-// // byte[] ret = (remainSize == DataChannelConstants.BUFFER_SIZE) ? null
-// // : new byte[input.length - remainSize];
-// // if (null != ret) {
-// // System.arraycopy(input, remainSize, ret, 0, input.length
-// // - remainSize);
-// // }
-// // complete = (payloadSize == payload.length) ? true : false;
-// return ret;
-// }
-
public int getId() {
return id;
}
this.time = time;
}
-// public int getPayloadSize() {
-// return payloadSize;
-// }
-
-// public void setPayloadSize(int payloadSize) {
-// this.payloadSize = payloadSize;
-// }
-
public byte[] getPayload() {
return payload;
}
System.arraycopy(input, 0, newInput, 0, input.length);
input = null;
payload = AnalyzerUtil.makeByteArray(id, newInput);
-// payloadSize = payload.length;
}
// for lower version
import static org.tizen.dynamicanalyzer.swap.model.probe.LogFormat.I;
import static org.tizen.dynamicanalyzer.swap.model.probe.LogFormat.L;
import static org.tizen.dynamicanalyzer.swap.model.probe.LogFormat.T;
-import static org.tizen.dynamicanalyzer.swap.model.probe.LogFormat.A;
import java.util.ArrayList;
import java.util.Arrays;
public class CommonColumns {
- private static String[] dcn = { "RID", "APPID", "PID", "TID", "args",
- "Return", "PCAddr", "Errno", "InternalCall", "CallerPCAddr",
- "Reserved", "Reserved" };
- private static Integer[] dct = { I, I, I, I, T, T, I, I, T, I, I, I, I };
+ private static String[] dcn = { "APPID", "PID", "TID", "args", "Return",
+ "Errno", "InternalCall", "CallerPCAddr", "Reserved", "Reserved" };
+ private static Integer[] dct = { I, I, I, T, T, T, I, T, I, I, I, I };
private static String[] tcn = { "App ID", "PID", "TID", "Args", "Return",
- "Errno", "Internal Call", "Caller PCAddr","Reserved", "Reserved" };
- private static Integer[] logTypes = { I, I, I, A, L, I, I, L, I, I };
+ "Errno", "Internal Call", "Caller PCAddr", "Reserved", "Reserved" };
+ private static Integer[] logTypes = { I, I, I, T, L, I, I, L, I, I };
private static List<String> dbColumnNames = null;
private static List<Integer> dbColumnTypes = null;
public static List<String> getDBColumnNames() {
if (null == dbColumnNames) {
dbColumnNames = new ArrayList<String>();
- dbColumnNames = Arrays.asList(dcn);
+ dbColumnNames.addAll(HeaderColumns.getDBColumnNames());
+ dbColumnNames.addAll(Arrays.asList(dcn));
}
-
ArrayList<String> ret = new ArrayList<String>();
ret.addAll(dbColumnNames);
public static List<Integer> getDBColumntypes() {
if (null == dbColumnTypes) {
- dbColumnTypes = Arrays.asList(dct);
+ dbColumnTypes = new ArrayList<Integer>();
+ dbColumnTypes.addAll(HeaderColumns.getDBColumntypes());
+ dbColumnTypes.addAll(Arrays.asList(dct));
}
ArrayList<Integer> ret = new ArrayList<Integer>();
public static List<String> getTableColumnNames() {
if (null == tableColumnNames) {
tableColumnNames = new ArrayList<String>();
- tableColumnNames = Arrays.asList(tcn);
+ tableColumnNames.addAll(HeaderColumns.getTableColumnNames());
+ tableColumnNames.addAll(Arrays.asList(tcn));
}
ArrayList<String> ret = new ArrayList<String>();
ret.addAll(tableColumnNames);
public static List<Integer> getLogColumnTypes() {
if (null == types) {
- types = Arrays.asList(logTypes);
+ types = new ArrayList<Integer>();
+ types.addAll(HeaderColumns.getLogColumnTypes());
+ types.addAll(Arrays.asList(logTypes));
}
ArrayList<Integer> ret = new ArrayList<Integer>();
tableColumnNames = CommonColumns.getTableColumnNames();
tableColumnNames.addAll(Arrays.asList(tcn));
- Integer[] types = { I, I, S, I, F };
+ Integer[] types = { I, I, S, I, D };
logColumnTypes = CommonColumns.getLogColumnTypes();
logColumnTypes.addAll(Arrays.asList(types));
}
setId(ID);
setName(NAME);
- String[] dcn = { "Size", "FDValue", "FDType", "FDApiType", "FileSize",
+ String[] dcn = { "Size", "FDValue", "FDApiType", "FileSize",
"FilePath" };
dbColumnNames = CommonColumns.getDBColumnNames();
dbColumnNames.addAll(Arrays.asList(dcn));
- Integer[] dct = { I, I, I, I, I, T };
+ Integer[] dct = { T, T, I, T, T };
dbColumnTypes = CommonColumns.getDBColumntypes();
dbColumnTypes.addAll(Arrays.asList(dct));
- String[] tcn = { "Size", "FD Value", "FD Type", "FD Api Type",
+ String[] tcn = { "Size", "FD Value", "FD Api Type",
"File Size", "FilePath" };
tableColumnNames = CommonColumns.getTableColumnNames();
tableColumnNames.addAll(Arrays.asList(tcn));
- Integer[] types = { I, I, I, I, I, S };
+ Integer[] types = { L, L, I, L, S };
logColumnTypes = CommonColumns.getLogColumnTypes();
logColumnTypes.addAll(Arrays.asList(types));
}
--- /dev/null
+package org.tizen.dynamicanalyzer.swap.model.probe;
+
+import static org.tizen.dynamicanalyzer.swap.model.probe.LogFormat.I;
+import static org.tizen.dynamicanalyzer.swap.model.probe.LogFormat.L;
+import static org.tizen.dynamicanalyzer.swap.model.probe.LogFormat.T;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class HeaderColumns {
+ private static String[] dcn = { "RID", "MessageId", "Seq", "Time" };
+ private static Integer[] dct = { I, I, I, T };
+ private static String[] tcn = { "Message ID", "Sequence", "Time" };
+ private static Integer[] logTypes = { I, I, L };
+
+ private static List<String> dbColumnNames = null;
+ private static List<Integer> dbColumnTypes = null;
+ private static List<String> tableColumnNames = null;
+ private static List<Integer> types = null;
+
+ public static List<String> getDBColumnNames() {
+ if (null == dbColumnNames) {
+ dbColumnNames = new ArrayList<String>();
+ dbColumnNames = Arrays.asList(dcn);
+ }
+
+ ArrayList<String> ret = new ArrayList<String>();
+ ret.addAll(dbColumnNames);
+
+ return ret;
+ }
+
+ public static List<Integer> getDBColumntypes() {
+ if (null == dbColumnTypes) {
+ dbColumnTypes = Arrays.asList(dct);
+ }
+
+ ArrayList<Integer> ret = new ArrayList<Integer>();
+ ret.addAll(dbColumnTypes);
+ return ret;
+ }
+
+ public static List<String> getTableColumnNames() {
+ if (null == tableColumnNames) {
+ tableColumnNames = new ArrayList<String>();
+ tableColumnNames = Arrays.asList(tcn);
+ }
+ ArrayList<String> ret = new ArrayList<String>();
+ ret.addAll(tableColumnNames);
+ return ret;
+ }
+
+ public static List<Integer> getLogColumnTypes() {
+ if (null == types) {
+ types = Arrays.asList(logTypes);
+ }
+
+ ArrayList<Integer> ret = new ArrayList<Integer>();
+ ret.addAll(types);
+ return ret;
+ }
+}
}
// dbColumnNames.addAll(Arrays.asList(dcn));
- Integer[] dct = { I, I, T };
+ Integer[] dct = { T, I, T };
dbColumnTypes = CommonColumns.getDBColumntypes();
dbColumnTypes.addAll(Arrays.asList(dct));
dbColumnNames = CommonColumns.getDBColumnNames();
dbColumnNames.addAll(Arrays.asList(dcn));
- Integer[] dct = { I, I, I };
+ Integer[] dct = { T, I, I };
dbColumnTypes = CommonColumns.getDBColumntypes();
dbColumnTypes.addAll(Arrays.asList(dct));
tableColumnNames = CommonColumns.getTableColumnNames();
tableColumnNames.addAll(Arrays.asList(tcn));
- Integer[] types = { I, I, I };
+ Integer[] types = { L, I, I };
logColumnTypes = CommonColumns.getLogColumnTypes();
logColumnTypes.addAll(Arrays.asList(types));
}
dbColumnNames = CommonColumns.getDBColumnNames();
dbColumnNames.addAll(Arrays.asList(dcn));
- Integer[] dct = { I, I, I, I };
+ Integer[] dct = { T, T, I, I };
dbColumnTypes = CommonColumns.getDBColumntypes();
dbColumnTypes.addAll(Arrays.asList(dct));
tableColumnNames = CommonColumns.getTableColumnNames();
tableColumnNames.addAll(Arrays.asList(tcn));
- Integer[] types = { I, I, I, I };
+ Integer[] types = { L, L, I, I };
logColumnTypes = CommonColumns.getLogColumnTypes();
logColumnTypes.addAll(Arrays.asList(types));
}
dbColumnNames = CommonColumns.getDBColumnNames();
dbColumnNames.addAll(Arrays.asList(dcn));
- Integer[] dct = { I, I, I, I, I, I };
+ Integer[] dct = { I, I, I, I, T, T };
dbColumnTypes = CommonColumns.getDBColumntypes();
dbColumnTypes.addAll(Arrays.asList(dct));
tableColumnNames = CommonColumns.getTableColumnNames();
tableColumnNames.addAll(Arrays.asList(tcn));
- Integer[] types = { I, I, I, I, I, I };
+ Integer[] types = { I, I, I, I, S, S };
logColumnTypes = CommonColumns.getLogColumnTypes();
logColumnTypes.addAll(Arrays.asList(types));
}
}
private static String parseLoad(int start, byte[] payload) {
+ int pos = start;
int backPos = start - INT_SIZE;
int count = ByteUtils.toInt(payload, backPos);
StringBuffer outBuf = new StringBuffer();
for (int ii = 0; ii < count; ii++) {
- int tid = ByteUtils.toInt(payload, start);
- start += INT_SIZE;
+ try{
+ if (pos == 180)
+ {
+ System.out.println();
+ }
+ int tid = ByteUtils.toInt(payload, pos);
+ pos += INT_SIZE;
outBuf.append(tid).append(CommonConstants.COMMA);
- float f = ByteUtils.toFloat(payload, start);
+ float f = ByteUtils.toFloat(payload, pos);
outBuf.append(f);
- start += FLOAT_SIZE;
+ pos += FLOAT_SIZE;
if (ii + 1 != count) {
outBuf.append(',');
}
+ }catch(ArrayIndexOutOfBoundsException e)
+ {
+ e.printStackTrace();
+ break;
+ }
}
return outBuf.toString();
} else if (latestButton.isButtonEnabled()) {
setStartTime(selectTime);
}
- computeData();
+// computeData();
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {