public class AnalyzerManager {
private static DATheme theme = null;
private static Project project = null;
+ private static boolean isRunning = false;
private static List<BaseLogCenter> baseLogCenters;
private static List<LogCenter> logCenters;
}
public static boolean isRunning() {
- String state = AnalyzerUtil.getRecordState();
- if (state.equals(RecordStateSourceProvider.RECORD_RECORDING)) {
- return true;
- } else {
- return false;
- }
+ // String state = AnalyzerUtil.getRecordState();
+ // if (state.equals(RecordStateSourceProvider.RECORD_RECORDING)) {
+ // return true;
+ // } else {
+ // return false;
+ // }
+ return isRunning;
+ }
+
+ public static void setRunningState(boolean isRunning) {
+ AnalyzerManager.isRunning = isRunning;
}
}
package org.tizen.dynamicanalyzer.common;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import org.eclipse.cdt.utils.elf.Elf;
import org.eclipse.cdt.utils.elf.Elf.Symbol;
+import org.tizen.dynamicanalyzer.model.AddrSymbolPair;
-public class ElfSymbolExtractManager {
- private String libPath = null;
+public class ElfSymbolExtracter {
+ private String sourcePath = null;
private HashMap<Long, String> symbolMap = null;
- private static ElfSymbolExtractManager instance = null;
-
- private ElfSymbolExtractManager(){
- }
-
- public static ElfSymbolExtractManager getInstance(){
- if(null == instance){
- instance = new ElfSymbolExtractManager();
- }
- return instance;
+ private List<AddrSymbolPair> addrSymbolPairs = null;
+
+ public ElfSymbolExtracter() {
+ symbolMap = new HashMap<Long, String>();
+ addrSymbolPairs = new ArrayList<AddrSymbolPair>();
}
-
- public boolean makeSymbol(String libPath){
- this.libPath = libPath;
- if(null != symbolMap){
+
+ public boolean makeSymbol(String path) {
+ this.sourcePath = path;
+ if (null != symbolMap) {
symbolMap.clear();
- }
- else{
+ } else {
symbolMap = new HashMap<Long, String>();
}
Elf elf;
try {
- elf = new Elf(libPath);
+ elf = new Elf(path);
elf.loadSymbols();
} catch (IOException e) {
// TODO Auto-generated catch block
return false;
}
Symbol[] symbols = elf.getSymtabSymbols();
- for(Symbol symbol : symbols){
- if(symbol.st_type() != Elf.Symbol.STT_FUNC || symbol.st_shndx == Elf.Symbol.SHN_UNDEF){
+ for (Symbol symbol : symbols) {
+ if (symbol.st_type() != Elf.Symbol.STT_FUNC
+ || symbol.st_shndx == Elf.Symbol.SHN_UNDEF) {
continue;
}
- symbolMap.put(symbol.st_value.getValue().longValue(), symbol.toString());
+ long addr = symbol.st_value.getValue().longValue();
+ String symbolStr = symbol.toString();
+ symbolMap.put(addr, symbolStr);
+ addrSymbolPairs.add(new AddrSymbolPair(addr, symbolStr));
}
return true;
}
-
- public Long[] getSymbolAddress(){
- if(null == symbolMap || 0 == symbolMap.size()){
+
+ public Long[] getSymbolAddress() {
+ if (null == symbolMap || 0 == symbolMap.size()) {
return null;
}
-
+
Long[] ret = new Long[symbolMap.size()];
- ret = (Long[])(symbolMap.keySet().toArray(ret));
+ ret = (Long[]) (symbolMap.keySet().toArray(ret));
return ret;
}
-
- public HashMap<Long, String> symbolMap(){
+
+ public HashMap<Long, String> symbolMap() {
return symbolMap;
}
-
- public void setLibPath(String libPath){
- this.libPath = libPath;
+
+ public void setLibPath(String libPath) {
+ this.sourcePath = libPath;
}
-
- public String getLibPath(){
- return libPath;
+
+ public String getLibPath() {
+ return sourcePath;
}
-
- public void clear(){
- libPath = null;
- if(null != symbolMap){
+
+ public void clear() {
+ sourcePath = null;
+ if (null != symbolMap) {
symbolMap.clear();
symbolMap = null;
}
}
+
+ public List<AddrSymbolPair> getAddrSymbolPairs() {
+ return addrSymbolPairs;
+ }
}
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogValues;
import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
public static final String ID = ReplayTraceHandler.class.getName();
public static Integer FAILED = 1;
public static boolean isReplay = false;
+ public static DATime startTime = null;
public static long stopTime = -1;
public static String RECORD_DATA_FILE_NAME = "/uirecorder.xml"; //$NON-NLS-1$
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
- UIRecorderTool recorderMng = UIRecorderTool.getInstance();
- String xmlFileName = AnalyzerManager.getProject().getSavePath()
- + RECORD_DATA_FILE_NAME;
+ if (!DACommunicator.isSWAPVersion()) {
+ UIRecorderTool recorderMng = UIRecorderTool.getInstance();
+ String xmlFileName = AnalyzerManager.getProject().getSavePath()
+ + RECORD_DATA_FILE_NAME;
- if (xmlFileName == null || xmlFileName.isEmpty()) {
- return FAILED;
+ if (xmlFileName == null || xmlFileName.isEmpty()) {
+ return FAILED;
+ } else {
+ recorderMng.setXmlPath(xmlFileName);
+ recorderMng.setReplayFlag(true);
+ isReplay = true;
+ stopTime = AnalyzerManager.getProject().getStopTime();
+ }
} else {
- recorderMng.setXmlPath(xmlFileName);
- recorderMng.setReplayFlag(true);
isReplay = true;
stopTime = AnalyzerManager.getProject().getStopTime();
+ startTime = AnalyzerManager.getProject().getStartTime();
}
return null;
}
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.sql.SqlManager;
import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
-import org.tizen.dynamicanalyzer.swap.logparser.Logs;
import org.tizen.dynamicanalyzer.swap.model.data.BasicDataMessage;
import org.tizen.dynamicanalyzer.swap.model.probe2.LogDataFactory;
import org.tizen.dynamicanalyzer.handlers.StopHandler;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.project.Project;
-import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
import org.tizen.dynamicanalyzer.swap.model.control.TargetInfo;
import org.tizen.dynamicanalyzer.swap.model.data.ProcessInfo;
import org.tizen.dynamicanalyzer.ui.toolbar.StopLogProcessor;
System.out.println("Ending steps!");
message = null;
DACommunicator.setRunning(false);
- AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+// AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ AnalyzerManager.setRunningState(false);
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
--- /dev/null
+package org.tizen.dynamicanalyzer.model;
+
+public class AddrSymbolPair {
+ long addr = 0;
+ String symbol = null;
+
+ public AddrSymbolPair(long addr, String symbol) {
+ this.addr = addr;
+ this.symbol = symbol;
+ }
+
+ public long getAddr() {
+ return addr;
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+}
import java.util.List;
import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.ElfSymbolExtracter;
+import org.tizen.dynamicanalyzer.model.AddrSymbolPair;
import org.tizen.dynamicanalyzer.swap.model.control.BinaryInfo;
public class AppInfo {
private String installTime = null;
+ private ElfSymbolExtracter symbolExtractor = new ElfSymbolExtracter();
+
public String getInstallTime() {
return installTime;
}
public void setBinInfo(BinaryInfo binInfo) {
this.binInfo = binInfo;
}
+
+ public List<AddrSymbolPair> getSymbols() {
+ return symbolExtractor.getAddrSymbolPairs();
+ }
}
public void insert(int logId, List<BasicDataMessage> input)
throws InterruptedException {
String tableName = LogDataFactory.getTableNamebyId(logId);
- // String insertQuery = logc.getInsertQuery();
String insertQuery = "insert into " + tableName
+ " values( ?, ?, ?, ?, ?);";
System.out.println("inser query : " + insertQuery);
- // int dataSize = input.size();
- // for (int inputIndex = 0; inputIndex < dataSize; inputIndex++) {
- // List<String> insetRowData = new ArrayList<String>();
- // List<String> log = input.get(inputIndex);
- // int size = logc.getTotalColumnCount();
- // insetRowData.add(Integer.toString(logc.getIndex()));
- // for (int i = 0; i < size; i++) {
- // try {
- // if (i + 2 > size) {
- // break;
- // }
- // insetRowData.add(log.get(i));
- // } catch (ArrayIndexOutOfBoundsException e) {
- // System.out.println("sql insert exception : index " + i); //$NON-NLS-1$
- // e.printStackTrace();
- // }
- // }
- // insetData.add(insetRowData);
- // logc.addIndex();
- // }
insertLogQuery(logId, insertQuery, input);
}
String insertQuery = unitTableInfo.insertQuery();
HashMap<Long, CallStackUnit> callstackMap = AnalyzerManager
.getCallstackManager().getCallStackApiByAddrMap();
- // HashMap<Long, CallStackUnit> callstackMap = CallStackManager
- // .getInstance().getCallStackApiByAddrMap();
List<CallStackUnit> callstackUnits = new ArrayList<CallStackUnit>();
callstackUnits.addAll(callstackMap.values());
int size = callstackUnits.size();
DBTableManager.TABLE_INDEX_CALLSTACK_DATA);
List<List<String>> insetData = new ArrayList<List<String>>();
String insertQuery = callstackData.insertQuery();
- // Collection<CallStackData> col = CallStackManager.getInstance()
- // .getCallStackDataBySeqMap().values();
Collection<CallStackData> col = AnalyzerManager.getCallstackManager()
.getCallStackDataBySeqMap().values();
List<CallStackData> callstackDataList = new ArrayList<CallStackData>();
insertQuery(insertQuery, insetData);
}
- // public void saveAppInfo() {
- // DBTableInfo appInfoData = DBTableManager.getInstance().getTableInfo(
- // DBTableManager.TABLE_INDEX_APP_INFO);
- // String insertQuery = appInfoData.insertQuery();
- // List<String> info = AnalyzerManager.getProject().getAppInfo();
- // int size = info.size();
- // List<List<String>> insetData = new ArrayList<List<String>>();
- // for (int i = 0; i < size; i++) {
- // List<String> insetRowData = new ArrayList<String>();
- // insetRowData.add(info.get(i));
- // insetData.add(insetRowData);
- // }
- // insertQuery(insertQuery, insetData);
- // }
-
public void saveProfilingData() {
ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
.getProfileDataMaker();
return logs;
}
+ public List<BasicDataMessage> getReplayLogs() {
+ String query = null;
+ Statement stat = null;
+ ResultSet rs = null;
+ Connection conn = null;
+ List<BasicDataMessage> logs = null;
+ try {
+ conn = getConnection();
+ if (null == conn) {
+ return null;
+ }
+ semaphoreAcquire();
+ StringBuilder columns = new StringBuilder();
+ columns.append("Rid , ID , SeqNumber , Time , payload ");
+ query = String.format("select %s from %s ;",//$NON-NLS-1$
+ columns.toString(), "replay");
+
+ stat = conn.createStatement();
+ rs = stat.executeQuery(query);
+ if (null == rs) {
+ return null;
+ }
+ logs = new ArrayList<BasicDataMessage>();
+ while (rs.next()) {
+ BasicDataMessage bdm = new BasicDataMessage();
+ bdm.setId(rs.getInt(2));
+ bdm.setSeq(rs.getInt(3));
+ bdm.setTime(rs.getLong(4));
+ bdm.setPayload(rs.getBytes(5));
+ logs.add(bdm);
+ }
+ } catch (SQLException e) {
+ System.out.println("SQLException - selecte : " + query);
+ e.printStackTrace();
+ } finally {
+ AnalyzerUtil.tryClose(stat, rs);
+ if (null != conn) {
+ semaphoreRelease();
+ }
+ }
+ return logs;
+ }
+
public List<List<String>> selectQuery(String dbFilePath,
String[] columnName, String tableName, String option) {
List<List<String>> dbInfo = null;
import java.util.List;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.communicator.BaseCommunicator;
import org.tizen.dynamicanalyzer.communicator.CommunicatorUtils;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
+import org.tizen.dynamicanalyzer.model.AddrSymbolPair;
import org.tizen.dynamicanalyzer.model.DeviceInfo;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
import org.tizen.dynamicanalyzer.project.AppInfo;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
import org.tizen.dynamicanalyzer.swap.logparser.SWAPLogParser;
import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.swap.model.control.ApplicationInfo;
import org.tizen.dynamicanalyzer.swap.model.control.ApplicationInst;
import org.tizen.dynamicanalyzer.swap.model.control.BinaryInfo;
+import org.tizen.dynamicanalyzer.swap.model.control.FunctionInst;
import org.tizen.dynamicanalyzer.swap.model.control.RunTimeConfiguration;
import org.tizen.dynamicanalyzer.swap.model.control.TargetInfo;
import org.tizen.dynamicanalyzer.swap.model.control.UserSpaceInst;
+import org.tizen.dynamicanalyzer.swap.model.data.BasicDataMessage;
import org.tizen.dynamicanalyzer.ui.file.FileChartManager;
import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
import org.tizen.dynamicanalyzer.ui.thread.ThreadChartManager;
@Override
public HostResult startTrace() {
+ HostResult hr = sendBinaryInfoMessage();
+ if (!hr.isSuccess()) {
+ System.out.println("binary info get failed :" + hr.getMessage());
+ }
// binary info message send
DACommunicator.setRunning(true);
ApplicationInfo appInfo = new ApplicationInfo();
RunTimeConfiguration rt = new RunTimeConfiguration();
rt.setFeatures(ConfigureManager.getInstance().getConfiguration());
+ byte[] replayEvent = null;
+ // check replay mode
+ if (ReplayTraceHandler.isReplay) {
+ // make replay event
+ // on/off , replay start time, count, event objs
+ int onOff = 1;
+ DATime startTime = ReplayTraceHandler.startTime;
+ List<BasicDataMessage> replayLogs = SqlManager.getInstance()
+ .getReplayLogs();
+ int count = replayLogs.size();
+ byte[] eventObjs = null;
+ for (int i = 0; i < count; i++) {
+ eventObjs = ByteUtils.concatByteArray(eventObjs, replayLogs
+ .get(i).getPayload());
+ }
+
+ replayEvent = ByteUtils.getByte(onOff, startTime.getSec(),
+ startTime.getNano(), count, eventObjs);
+ } else {
+ replayEvent = ByteUtils.getByte(0);
+ }
+
// TODO: app inst , replay info added!!
byte[] rear = ByteUtils.getByte(appInfo.getByteValue(),
- rt.getByteValue(), 0, 0);
+ rt.getByteValue(), getUserSpaceInst().getByteValue(),
+ replayEvent);
int length = rear.length;
byte[] ret = ByteUtils.getByte(AnalyzerConstants.MSG_START_SWAP,
return result;
}
-// private UserSpaceInst getUserSpaceInst() {
-// UserSpaceInst output = new UserSpaceInst();
-// output.setCount(1); // single processing
-// List<ApplicationInst> applicationInstList = new ArrayList<ApplicationInst>();
-//
-// }
+ private UserSpaceInst getUserSpaceInst() {
+ UserSpaceInst output = new UserSpaceInst();
+ 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);
+ AppInfo selectedApp = DACommunicator.getSelectedApp();
+ appInst.setApplicationId(selectedApp.getInfo(AppInfo.APPID_INDEX));
+ appInst.setExecutablePath(selectedApp.getInfo(AppInfo.EXEC_INDEX));
+
+ List<AddrSymbolPair> symbols = selectedApp.getSymbols();
+ List<FunctionInst> functionInstList = appInst.getFunctionInstList();
+
+ int size = symbols.size();
+ appInst.setFunctionCount(size);
+ for (int i = 0; i < size; i++) {
+ AddrSymbolPair addrSymbol = symbols.get(i);
+ FunctionInst functionInst = new FunctionInst();
+ functionInst.setAddr(addrSymbol.getAddr());
+ functionInst.setArgs(getFunctionArgs(addrSymbol.getSymbol()));
+ functionInstList.add(functionInst);
+ }
+
+ appInst.setLibcount(0);
+ appInst.setLibraryInstList(null);
+ output.getAppInstList().add(appInst);
+ return output;
+ }
public HostResult sendBinaryInfoMessage() {
// send config message
appInfo.setExecPath(selectedApp.getInfo(AppInfo.EXEC_INDEX));
int length = appInfo.getByteValue().length;
- byte[] msg = ByteUtils.concatByteArray(msgBinInfo, length,
+ byte[] msg = ByteUtils.getByte(msgBinInfo, length,
appInfo.getByteValue());
HostResult result = handleControlMessage(
DACommunicator.getSelectedDevice(), msg);
- if (!result.isSuccess() || isCorrectAck(MSG_BINARY_INFO_ACK, result)) {
+ if (!result.isSuccess() || !isCorrectAck(MSG_BINARY_INFO_ACK, result)) {
return HostResult.ERR_BIN_INFO_GET_FAIL;
}
// change binary file path of host
File binFile = new File(binaryPath);
if (!binFile.exists()) {
- SyncResult res = CommunicatorUtils.pull(targetPath,
- AnalyzerPaths.TEMP_FOLDER_PATH);
+ String name = selectedApp.getInfo(AppInfo.LABEL_INDEX);
+ binaryPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator + name;
+ SyncResult res = CommunicatorUtils.pull(targetPath, binaryPath);
if (null != res && RESULT_OK == res.getCode()) {
System.out.println("binary copy success!!");//$NON-NLS-1$
} else {
System.out.println("Failed to get " + targetPath); //$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);
return result;
int index = INT_SIZE;
int size = ByteUtils.toInt(data, index);
index += INT_SIZE * 2;
+ size -= INT_SIZE;
byte[] payload = new byte[size];
System.arraycopy(data, index, payload, 0, size);
return payload;
}
+
+ private byte[] getFunctionArgs(String symbol) {
+ int start = symbol.indexOf(CommonConstants.OPEN_BRACKET);
+ int end = symbol.indexOf(CommonConstants.CLOSE_BRACKET);
+
+ String argStr = symbol.substring(start, end).trim();
+ if (argStr.isEmpty()) {
+ return new byte[0];
+ }
+ String[] args = argStr.split(CommonConstants.COMMA);
+ byte[] ret = new byte[args.length];
+ for (int i = 0; i < args.length; i++) {
+ String arg = args[i];
+ int index = arg.indexOf(CommonConstants.SPACE);
+ arg = arg.substring(0, index - 1);
+ ret[i] = (byte) getArgType(arg);
+ }
+
+ return ret;
+ }
+
+ private char getArgType(String input) {
+ if (input.equals("int")) {
+ return 'd';
+ } else if (input.equals("char")) {
+ return 'c';
+ } else if (input.equals("long")) {
+ return 'x';
+ } else if (input.equals("float")) {
+ return 'f';
+ } else if (input.equals("double")) {
+ return 'w';
+ } else if (input.equals("bool")) {
+ return 'b';
+ } else {
+ return 'p';
+ }
+ }
}
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.communicator.CommunicatorUtils;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
import org.tizen.dynamicanalyzer.handlers.StopHandler;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
System.out.println("Ending steps!");
// message = null;
DACommunicator.setRunning(false);
- AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ // AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ AnalyzerManager.setRunningState(false);
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
StopLogProcessor.runStopLogProcessThread();
DACommunicator.closeSock();
AnalyzerUtil.executeCommand(StopHandler.ID);
+ ReplayTraceHandler.isReplay = false;
+ ReplayTraceHandler.startTime = null;
}
private void processMessage(BasicDataMessage data) {
// process error message
break;
case DataChannelConstants.MSG_SYSTEM:
- case DataChannelConstants.MSG_RECORD:
case DataChannelConstants.MSG_SAMPLE:
case DataChannelConstants.MSG_FUNCTION_ENTRY:
case DataChannelConstants.MSG_FUNCTION_EXIT:
case DataChannelConstants.MSG_CONTEXT_SWITCH_ENTRY:
case DataChannelConstants.MSG_CONTEXT_SWITCH_EXIT:
+ case DataChannelConstants.MSG_RECORD:
// make log
log = LogDataFactory.createInstance(data);
if (null != log) {
import org.tizen.dynamicanalyzer.swap.model.probe2.LogData;
import org.tizen.dynamicanalyzer.swap.model.probe2.ProbeCommonData;
import org.tizen.dynamicanalyzer.swap.model.probe2.ProfileData;
+import org.tizen.dynamicanalyzer.swap.model.probe2.ReplayData;
import org.tizen.dynamicanalyzer.swap.model.probe2.ScreenShotData;
import org.tizen.dynamicanalyzer.swap.model.probe2.SystemData;
import org.tizen.dynamicanalyzer.ui.page.BaseView;
pData,
FunctionUsageProfiler.getInstance()
.getProfileDataMaker());
+ } else if (log instanceof ReplayData) {
+ pushLog(log, msg, logPack);
} else {
if (log instanceof ScreenShotData) {
String remoteImgPath = ((ScreenShotData) log)
--- /dev/null
+package org.tizen.dynamicanalyzer.swap.model;
+
+public class RecordEventObject {
+ private DATime eventTime = null;
+ private int eventId = 0;
+ private int eventType = 0;
+ private int eventCode = 0;
+ private int eventValue = 0;
+
+ public int getEventId() {
+ return eventId;
+ }
+
+ public void setEventId(int eventId) {
+ this.eventId = eventId;
+ }
+
+ public int getEventType() {
+ return eventType;
+ }
+
+ public void setEventType(int eventType) {
+ this.eventType = eventType;
+ }
+
+ public int getEventCode() {
+ return eventCode;
+ }
+
+ public void setEventCode(int eventCode) {
+ this.eventCode = eventCode;
+ }
+
+ public int getEventValue() {
+ return eventValue;
+ }
+
+ public void setEventValue(int eventValue) {
+ this.eventValue = eventValue;
+ }
+
+ public DATime getEventTime() {
+ return eventTime;
+ }
+
+ public void setEventTime(DATime eventTime) {
+ this.eventTime = eventTime;
+ }
+}
package org.tizen.dynamicanalyzer.swap.model.control;
+import java.util.ArrayList;
import java.util.List;
import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
public class ApplicationInst implements SWAPModel {
- // path of binary
- private String path = null;
+ private int applicationType = 0;
+ private String applicationId = null;
+ private String executablePath = null;
+ private int functionCount = 0;
+ private List<FunctionInst> functionInstList = new ArrayList<FunctionInst>();
+ private int libcount = 0;
+ private List<LibraryInst> libraryInstList = new ArrayList<LibraryInst>();
- // count of functions
- private int funcCount = 0;
-
- // FunctionInst list
- private List<FunctionInst> funcInstList = null;
-
- // count of library
- private int libCount = 0;
-
- // LibararyInst list
- private List<LibraryInst> libInstList = null;
+ @Override
+ public byte[] getByteValue() {
+ return ByteUtils.getByte(applicationType, applicationId,
+ executablePath, functionCount, functionInstList, libcount,
+ libraryInstList);
+ }
- public String getPath() {
- return path;
+ @Override
+ public void setByteToValues(byte[] input) {
+ // TODO Auto-generated method stub
}
- public void setPath(String path) {
- this.path = path;
+ public int getApplicationType() {
+ return applicationType;
}
- public int getFuncCount() {
- return funcCount;
+ public void setApplicationType(int applicationType) {
+ this.applicationType = applicationType;
}
- public void setFuncCount(int funcCount) {
- this.funcCount = funcCount;
+ public String getApplicationId() {
+ return applicationId;
}
- public List<FunctionInst> getFuncInstList() {
- return funcInstList;
+ public void setApplicationId(String applicationId) {
+ this.applicationId = applicationId;
}
- public void setFuncInstList(List<FunctionInst> funcInstList) {
- this.funcInstList = funcInstList;
+ public String getExecutablePath() {
+ return executablePath;
}
- public int getLibCount() {
- return libCount;
+ public void setExecutablePath(String executablePath) {
+ this.executablePath = executablePath;
}
- public void setLibCount(int libCount) {
- this.libCount = libCount;
+ public int getFunctionCount() {
+ return functionCount;
}
- public List<LibraryInst> getLibInstList() {
- return libInstList;
+ public void setFunctionCount(int functionCount) {
+ this.functionCount = functionCount;
}
- public void setLibInstList(List<LibraryInst> libInstList) {
- this.libInstList = libInstList;
+ public List<FunctionInst> getFunctionInstList() {
+ return functionInstList;
}
- @Override
- public byte[] getByteValue() {
- return ByteUtils.getByte(path, funcCount, funcInstList, libCount,
- libInstList);
+ public int getLibcount() {
+ return libcount;
}
- @Override
- public void setByteToValues(byte[] input) {
- // TODO Auto-generated method stub
+ public void setLibcount(int libcount) {
+ this.libcount = libcount;
+ }
+ public void setLibraryInstList(List<LibraryInst> libraryInstList) {
+ this.libraryInstList = libraryInstList;
}
}
import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
public class FunctionInst implements SWAPModel {
- // function address
private long addr = 0;
-
- // count of args
- private int argCount = 0;
-
- // args
- private String args = null;
+ private byte[] args = null;
public long getAddr() {
return addr;
this.addr = addr;
}
- public int getArgCount() {
- return argCount;
- }
-
- public void setArgCount(int argCount) {
- this.argCount = argCount;
- }
-
- public String getArgs() {
+ public byte[] getArgs() {
return args;
}
- public void setArgs(String args) {
+ public void setArgs(byte[] args) {
this.args = args;
}
@Override
public byte[] getByteValue() {
- return ByteUtils.getByte(addr, argCount, args);
+ return ByteUtils.getByte(addr, args);
}
@Override
package org.tizen.dynamicanalyzer.swap.model.control;
+import java.util.ArrayList;
import java.util.List;
import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
private int count = 0;
private List<ApplicationInst> appInstList = null;
+ public UserSpaceInst() {
+ appInstList = new ArrayList<ApplicationInst>();
+ }
public int getCount() {
return count;
}
return appInstList;
}
- public void setAppInstList(List<ApplicationInst> appInstList) {
- this.appInstList = appInstList;
- }
-
@Override
public byte[] getByteValue() {
return ByteUtils.getByte(count, appInstList);
package org.tizen.dynamicanalyzer.swap.model.probe2;
-import static org.tizen.dynamicanalyzer.common.AnalyzerConstants.MSG_CONTEXT_SWITCH_ENTRY;
+import static org.tizen.dynamicanalyzer.common.AnalyzerConstants.*;
import static org.tizen.dynamicanalyzer.common.AnalyzerConstants.MSG_CONTEXT_SWITCH_EXIT;
import static org.tizen.dynamicanalyzer.common.AnalyzerConstants.MSG_DATA_SAMPLE;
import static org.tizen.dynamicanalyzer.common.AnalyzerConstants.MSG_DATA_SYSTEM;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.swap.model.DATime;
+import org.tizen.dynamicanalyzer.swap.model.RecordEventObject;
import org.tizen.dynamicanalyzer.swap.model.data.ApiNameManager;
public class DataFactory {
case MSG_FUNCTION_EXIT:
createProfileData(data, paylaod);
break;
-
+ case MSG_RECORD:
+ createRecordData(data, paylaod);
+ break;
case LogCenterConstants.LOG_USER_FUNCTION:
createUserFunctionData(data, paylaod);
break;
}
private static void createCommonData(LogData data, byte[] payload) {
-// System.out.println("Create common data method - log seq " + data.getSeq());
+ // System.out.println("Create common data method - log seq " +
+ // data.getSeq());
ProbeCommonData probeData = ((ProbeCommonData) data);
int apiId = ByteUtils.toInt(payload, index);
index += INT_SIZE;
index = argInfo.getLastIndex();
long ret = ByteUtils.toLong(payload, index);
index += LONG_SIZE;
-// long errno = ByteUtils.toLong(payload, index);
-// index += LONG_SIZE;
+ // long errno = ByteUtils.toLong(payload, index);
+ // index += LONG_SIZE;
int errno = ByteUtils.toInt(payload, index);
index += INT_SIZE;
int internalCall = ByteUtils.toInt(payload, index);
probeData.setCallerAddress(callerAddress);
probeData.setReserved1(reserved1);
probeData.setReserved2(reserved2);
-
+
probeData.setApiName(ApiNameManager.getApiName(apiId));
}
index += INT_SIZE;
int y = ByteUtils.toInt(payload, index);
index += INT_SIZE;
- int info1 = ByteUtils.toInt(payload, index);
- index += INT_SIZE;
-// int info2 = ByteUtils.toInt(payload, index);
+ String info1 = ByteUtils.getString(payload, index);
+ index += ByteUtils.getStringLength(payload, index);
+ int info2 = ByteUtils.toInt(payload, index);
data.setEventType(eventType);
data.setDetailType(detailType);
data.setX(x);
data.setY(y);
data.setInfo1(info1);
-// data.setInfo2(info2);
+ data.setInfo2(info2);
data.setInfo2(0);
}
int processCount = ByteUtils.toInt(payload, index);
index += INT_SIZE;
- String processLoad = parseLoad(index, payload);
- index += (processCount * (INT_SIZE + FLOAT_SIZE));
-
- int diskReadSize = ByteUtils.toInt(payload, index);
- index += INT_SIZE;
-
- int diskWriteSize = ByteUtils.toInt(payload, index);
- index += INT_SIZE;
-
- int networkSendSize = ByteUtils.toInt(payload, index);
- index += INT_SIZE;
-
- int networkReceiveSize = ByteUtils.toInt(payload, index);
+ // String processLoad = parseLoad(index, payload);
+ // index += (processCount * (INT_SIZE + FLOAT_SIZE));
+ //
+ // int diskReadSize = ByteUtils.toInt(payload, index);
+ // index += INT_SIZE;
+ //
+ // int diskWriteSize = ByteUtils.toInt(payload, index);
+ // index += INT_SIZE;
+ //
+ // int networkSendSize = ByteUtils.toInt(payload, index);
+ // index += INT_SIZE;
+ //
+ // int networkReceiveSize = ByteUtils.toInt(payload, index);
data.setEnergy(energy);
data.setWifi(wifi);
data.setThreadCount(threadCount);
data.setThreadLoad(threadLoad);
data.setProcessCount(processCount);
- data.setProcessLoad(processLoad);
- data.setDiskReadSize(diskReadSize);
- data.setDiskWriteSize(diskWriteSize);
- data.setNetworkSendSize(networkSendSize);
- data.setNetworkReceiveSize(networkReceiveSize);
+ // data.setProcessLoad(processLoad);
+ // data.setDiskReadSize(diskReadSize);
+ // data.setDiskWriteSize(diskWriteSize);
+ // data.setNetworkSendSize(networkSendSize);
+ // data.setNetworkReceiveSize(networkReceiveSize);
}
private static void createProfileData(LogData log, byte[] payload) {
}
}
+ private static void createRecordData(LogData log, byte[] payload) {
+ ReplayData data = (ReplayData) log;
+
+ int count = ByteUtils.toInt(payload, index);
+ index += INT_SIZE;
+ data.setObjectCount(count);
+
+ for (int i = 0; i < count; i++) {
+ RecordEventObject recordObj = new RecordEventObject();
+ // event time
+ int sec = ByteUtils.toInt(payload, index);
+ index += INT_SIZE;
+ int nano = ByteUtils.toInt(payload, index);
+ index += INT_SIZE;
+ DATime time = new DATime();
+ time.setSec(sec);
+ time.setNano(nano);
+ recordObj.setEventTime(time);
+
+ // event id
+ int value = ByteUtils.toInt(payload, index);
+ recordObj.setEventId(value);
+ index += INT_SIZE;
+
+ // event type
+ value = ByteUtils.toInt(payload, index);
+ recordObj.setEventType(value);
+ index += INT_SIZE;
+
+ // eventy code
+ value = ByteUtils.toInt(payload, index);
+ recordObj.setEventCode(value);
+ index += INT_SIZE;
+
+ value = ByteUtils.toInt(payload, index);
+ recordObj.setEventValue(value);
+ data.getRecordEvent().add(recordObj);
+ }
+ }
+
private static void createUserFunctionData(LogData log, byte[] payload) {
createCommonData(log, payload);
UserFunctionData data = (UserFunctionData) log;
import java.util.ArrayList;
import java.util.List;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import static org.tizen.dynamicanalyzer.common.AnalyzerConstants.*;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.swap.model.data.BasicDataMessage;
private static int syncLogNum = 0;
private static int sampleLogNum = 0;
private static int systemLogNum = 0;
+ private static int recordLogNum = 0;
private static int userFunctionLogNum = 0;
private LogDataFactory() {
public static void initLogList() {
logList.clear();
- logList.add(AnalyzerConstants.MSG_PROBE_MEMORY);
- logList.add(AnalyzerConstants.MSG_PROBE_UICONTROL);
- logList.add(AnalyzerConstants.MSG_PROBE_UIEVENT);
- logList.add(AnalyzerConstants.MSG_PROBE_FILE);
- logList.add(AnalyzerConstants.MSG_PROBE_LIFECYCLE);
- logList.add(AnalyzerConstants.MSG_PROBE_SCREENSHOT);
- logList.add(AnalyzerConstants.MSG_PROBE_SCENE);
- logList.add(AnalyzerConstants.MSG_PROBE_THREAD);
- logList.add(AnalyzerConstants.MSG_PROBE_CUSTOM);
- logList.add(AnalyzerConstants.MSG_PROBE_SYNC);
- logList.add(AnalyzerConstants.MSG_DATA_SAMPLE);
- logList.add(AnalyzerConstants.MSG_DATA_SYSTEM);
+ logList.add(MSG_PROBE_MEMORY);
+ logList.add(MSG_PROBE_UICONTROL);
+ logList.add(MSG_PROBE_UIEVENT);
+ logList.add(MSG_PROBE_FILE);
+ logList.add(MSG_PROBE_LIFECYCLE);
+ logList.add(MSG_PROBE_SCREENSHOT);
+ logList.add(MSG_PROBE_SCENE);
+ logList.add(MSG_PROBE_THREAD);
+ logList.add(MSG_PROBE_CUSTOM);
+ logList.add(MSG_PROBE_SYNC);
+ logList.add(MSG_DATA_SAMPLE);
+ logList.add(MSG_DATA_SYSTEM);
logList.add(LogCenterConstants.LOG_USER_FUNCTION);
+ logList.add(MSG_RECORD);
}
public static LogData createInstance(BasicDataMessage input) {
byte[] payload = input.getPayload();
LogData output = null;
switch (id) {
- case AnalyzerConstants.MSG_PROBE_MEMORY:
- case LogCenterConstants.LOG_MEMORY:
+ case MSG_PROBE_MEMORY:
// memory
output = new MemoryData(input);
break;
- case AnalyzerConstants.MSG_PROBE_UICONTROL:
- case LogCenterConstants.LOG_CONTROL:
+ case MSG_PROBE_UICONTROL:
// ui control
output = new ControlData(input);
break;
- case AnalyzerConstants.MSG_PROBE_UIEVENT:
- case LogCenterConstants.LOG_UI_EVENT:
+ case MSG_PROBE_UIEVENT:
output = new UIEventData(input);
break;
- case AnalyzerConstants.MSG_PROBE_FILE:
- case LogCenterConstants.LOG_RESOURCE:
+ case MSG_PROBE_FILE:
// file
output = new FileData(input);
break;
- case AnalyzerConstants.MSG_PROBE_LIFECYCLE:
- case LogCenterConstants.LOG_LIFECYCLE:
+ case MSG_PROBE_LIFECYCLE:
// life cycle
output = new LifeCycleData(input);
break;
- case AnalyzerConstants.MSG_PROBE_SCREENSHOT:
- case LogCenterConstants.LOG_SCREENSHOT:
+ case MSG_PROBE_SCREENSHOT:
// screenshot
output = new ScreenShotData(input);
break;
- case AnalyzerConstants.MSG_PROBE_SCENE:
- case LogCenterConstants.LOG_SCENE:
+ case MSG_PROBE_SCENE:
// scene
output = new SceneData(input);
break;
- case AnalyzerConstants.MSG_PROBE_THREAD:
- case LogCenterConstants.LOG_THREAD:
+ case MSG_PROBE_THREAD:
// thread
output = new ThreadData(input);
break;
- case AnalyzerConstants.MSG_PROBE_CUSTOM:
- case LogCenterConstants.LOG_CUSTOM_CHART:
+ case MSG_PROBE_CUSTOM:
// custom
output = new CustomData(input);
break;
- case AnalyzerConstants.MSG_PROBE_SYNC:
- case LogCenterConstants.LOG_SYNC:
+ case MSG_PROBE_SYNC:
// sync
output = new SyncData(input);
break;
// user fucntion entry/exit
output = new UserFunctionData(input);
break;
- case AnalyzerConstants.MSG_DATA_SAMPLE:
- case LogCenterConstants.LOG_PROFILING:
+ case MSG_DATA_SAMPLE:
// profiling sample log
output = new ProfileData(input);
((ProfileData) output).setCallstack(input.getCallstack());
break;
- case AnalyzerConstants.MSG_DATA_SYSTEM:
- case LogCenterConstants.LOG_DEVICE:
+ case MSG_DATA_SYSTEM:
// system log
output = new SystemData(input);
break;
+ case MSG_RECORD:
+ // replay log
+ output = new ReplayData(input);
+ break;
default:
return null;
}
public static String getTableNamebyId(int id) {
String name = null;
switch (id) {
- case AnalyzerConstants.MSG_PROBE_MEMORY:
- case LogCenterConstants.LOG_MEMORY:
- // memory
+ case MSG_PROBE_MEMORY:
name = "memory";
break;
- case AnalyzerConstants.MSG_PROBE_UICONTROL:
- case LogCenterConstants.LOG_CONTROL:
- // ui control
+ case MSG_PROBE_UICONTROL:
name = "control";
break;
- case AnalyzerConstants.MSG_PROBE_UIEVENT:
- case LogCenterConstants.LOG_UI_EVENT:
+ case MSG_PROBE_UIEVENT:
name = "uievent";
break;
- case AnalyzerConstants.MSG_PROBE_FILE:
- case LogCenterConstants.LOG_RESOURCE:
- // file
+ case MSG_PROBE_FILE:
name = "file";
break;
- case AnalyzerConstants.MSG_PROBE_LIFECYCLE:
- case LogCenterConstants.LOG_LIFECYCLE:
- // life cycle
+ case MSG_PROBE_LIFECYCLE:
name = "lifecycle";
break;
- case AnalyzerConstants.MSG_PROBE_SCREENSHOT:
- case LogCenterConstants.LOG_SCREENSHOT:
- // screenshot
+ case MSG_PROBE_SCREENSHOT:
name = "screenshot";
break;
- case AnalyzerConstants.MSG_PROBE_SCENE:
- case LogCenterConstants.LOG_SCENE:
- // scene
+ case MSG_PROBE_SCENE:
name = "scene";
break;
- case AnalyzerConstants.MSG_PROBE_THREAD:
- case LogCenterConstants.LOG_THREAD:
- // thread
+ case MSG_PROBE_THREAD:
name = "thread";
break;
- case AnalyzerConstants.MSG_PROBE_CUSTOM:
- case LogCenterConstants.LOG_CUSTOM_CHART:
- // custom
+ case MSG_PROBE_CUSTOM:
name = "custom";
break;
- case AnalyzerConstants.MSG_PROBE_SYNC:
- case LogCenterConstants.LOG_SYNC:
- // sync
+ case MSG_PROBE_SYNC:
name = "sync";
break;
case LogCenterConstants.LOG_USER_FUNCTION:
// user fucntion entry/exit
name = "user_function";
break;
- case AnalyzerConstants.MSG_DATA_SAMPLE:
- case LogCenterConstants.LOG_PROFILING:
+ case MSG_DATA_SAMPLE:
// profiling sample log
+ // function enter/exit
+ // context enstr/exit
name = "profiling";
break;
- case AnalyzerConstants.MSG_DATA_SYSTEM:
- case LogCenterConstants.LOG_DEVICE:
+ case MSG_DATA_SYSTEM:
// system log
name = "system";
break;
+ case MSG_RECORD:
+ name = "replay";
+ break;
default:
-
+ break;
}
return name;
}
public static int getLogColumnCountbyId(int id) {
int count = 0;
switch (id) {
- case AnalyzerConstants.MSG_PROBE_MEMORY:
+ case MSG_PROBE_MEMORY:
case LogCenterConstants.LOG_MEMORY:
// memory
count = 16;
break;
- case AnalyzerConstants.MSG_PROBE_UICONTROL:
+ case MSG_PROBE_UICONTROL:
case LogCenterConstants.LOG_CONTROL:
// ui control
count = 19;
break;
- case AnalyzerConstants.MSG_PROBE_UIEVENT:
+ case MSG_PROBE_UIEVENT:
case LogCenterConstants.LOG_UI_EVENT:
count = 19;
break;
- case AnalyzerConstants.MSG_PROBE_FILE:
+ case MSG_PROBE_FILE:
case LogCenterConstants.LOG_RESOURCE:
// file
count = 19;
break;
- case AnalyzerConstants.MSG_PROBE_LIFECYCLE:
+ case MSG_PROBE_LIFECYCLE:
case LogCenterConstants.LOG_LIFECYCLE:
// life cycle
count = 12;
break;
- case AnalyzerConstants.MSG_PROBE_SCREENSHOT:
+ case MSG_PROBE_SCREENSHOT:
case LogCenterConstants.LOG_SCREENSHOT:
// screenshot
count = 15;
break;
- case AnalyzerConstants.MSG_PROBE_SCENE:
+ case MSG_PROBE_SCENE:
case LogCenterConstants.LOG_SCENE:
// scene
count = 20;
break;
- case AnalyzerConstants.MSG_PROBE_THREAD:
+ case MSG_PROBE_THREAD:
case LogCenterConstants.LOG_THREAD:
// thread
count = 17;
break;
- case AnalyzerConstants.MSG_PROBE_CUSTOM:
+ case MSG_PROBE_CUSTOM:
case LogCenterConstants.LOG_CUSTOM_CHART:
// custom
count = 18;
break;
- case AnalyzerConstants.MSG_PROBE_SYNC:
+ case MSG_PROBE_SYNC:
case LogCenterConstants.LOG_SYNC:
// sync
count = 16;
// user fucntion entry/exit
count = 17;
break;
- case AnalyzerConstants.MSG_DATA_SAMPLE:
+ case MSG_DATA_SAMPLE:
case LogCenterConstants.LOG_PROFILING:
// profiling sample log
count = 4;
break;
- case AnalyzerConstants.MSG_DATA_SYSTEM:
+ case MSG_DATA_SYSTEM:
case LogCenterConstants.LOG_DEVICE:
// system log
count = 35;
public static int getLogCountById(int id) {
switch (id) {
- case AnalyzerConstants.MSG_PROBE_MEMORY:
+ case MSG_PROBE_MEMORY:
// memory
return memoryLogNum++;
- case AnalyzerConstants.MSG_PROBE_UICONTROL:
+ case MSG_PROBE_UICONTROL:
// ui control
return controlLogNum++;
- case AnalyzerConstants.MSG_PROBE_UIEVENT:
+ case MSG_PROBE_UIEVENT:
return uiEventLogNum++;
- case AnalyzerConstants.MSG_PROBE_FILE:
+ case MSG_PROBE_FILE:
return fileLogNum++;
- case AnalyzerConstants.MSG_PROBE_LIFECYCLE:
+ case MSG_PROBE_LIFECYCLE:
return lifecycleLogNum++;
- case AnalyzerConstants.MSG_PROBE_SCREENSHOT:
+ case MSG_PROBE_SCREENSHOT:
return screenshotLogNum++;
- case AnalyzerConstants.MSG_PROBE_SCENE:
+ case MSG_PROBE_SCENE:
return sceneLogNum++;
- case AnalyzerConstants.MSG_PROBE_THREAD:
+ case MSG_PROBE_THREAD:
return threadLogNum++;
- case AnalyzerConstants.MSG_PROBE_CUSTOM:
+ case MSG_PROBE_CUSTOM:
return customLogNum++;
- case AnalyzerConstants.MSG_PROBE_SYNC:
+ case MSG_PROBE_SYNC:
return syncLogNum++;
case LogCenterConstants.LOG_USER_FUNCTION:
return userFunctionLogNum++;
- case AnalyzerConstants.MSG_DATA_SAMPLE:
+ case MSG_DATA_SAMPLE:
return sampleLogNum++;
- case AnalyzerConstants.MSG_DATA_SYSTEM:
+ case MSG_DATA_SYSTEM:
return systemLogNum++;
+ case MSG_RECORD:
+ return recordLogNum++;
default:
-
+ break;
}
return 0;
}
--- /dev/null
+package org.tizen.dynamicanalyzer.swap.model.probe2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.swap.model.RecordEventObject;
+import org.tizen.dynamicanalyzer.swap.model.data.BasicDataMessage;
+
+public class ReplayData extends LogData {
+
+ private int objectCount = 0;
+ private List<RecordEventObject> recordEvent = new ArrayList<RecordEventObject>();
+
+ public ReplayData(BasicDataMessage data) {
+ super(data);
+ }
+
+ public int getObjectCount() {
+ return objectCount;
+ }
+
+ public void setObjectCount(int objectCount) {
+ this.objectCount = objectCount;
+ }
+
+ public List<RecordEventObject> getRecordEvent() {
+ return recordEvent;
+ }
+}
int detailType = 0;
int x = 0;
int y = 0;
- int info1 = 0;
+ String info1 = null;
int info2 = 0;
public int getEventType() {
this.y = y;
}
- public int getInfo1() {
+ public String getInfo1() {
return info1;
}
- public void setInfo1(int info1) {
+ public void setInfo1(String info1) {
this.info1 = info1;
}
import java.util.ArrayList;
import java.util.List;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.FilePageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
-import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
}
public void checkUpdate() {
- if (false == hasUpdate
- && AnalyzerUtil.getRecordState().equals(
- RecordStateSourceProvider.RECORD_RECORDING)) {
+ if (false == hasUpdate && AnalyzerManager.isRunning()) {
return;
} else {
hasUpdate = false;
}
}
- if (AnalyzerUtil.getRecordState().equals(
- RecordStateSourceProvider.RECORD_READY)) {
+ if (!AnalyzerManager.isRunning()) {
if (isParent() && (event == null)) {
for (int i = 0; i < size; i++) {
if ((!children.get(i).isClosed(null))
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2;
import org.tizen.dynamicanalyzer.swap.model.probe2.FileData;
import org.tizen.dynamicanalyzer.swap.model.probe2.LogData;
}
public void checkUpdate() {
- if (AnalyzerUtil.getRecordState().equals(
- RecordStateSourceProvider.RECORD_READY)) {
+ if (!AnalyzerManager.isRunning()) {
int size = rows.size();
FileChartData data;
for (int i = 0; i < size; i++) {
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.CommonConstants;
-import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
getGestureInfo(detailType, log)));
break;
case TYPE_ORIENTATION:
- int status = log.getInfo1();
+ int status = Integer.parseInt(log.getInfo1());
orientationEventSeries.addSeriesItem(new DAChartSeriesItem(
time, 0, TimelineChartLabels.UIEVENT_ORIENTATION
+ " "//$NON-NLS-1$
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
return;
}
state = STOP_PROCESS_START;
- AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+// AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ AnalyzerManager.setRunningState(false);
Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
dialog = new ProgressDialog(shell, SWT.APPLICATION_MODAL);
if (null != dialog) {
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialog;
}
if (null != DACommunicator.getSelectedDevice()) {
- AnalyzerUtil
- .setRecordState(RecordStateSourceProvider.RECORD_READY);
+// AnalyzerUtil
+// .setRecordState(RecordStateSourceProvider.RECORD_READY);
+ AnalyzerManager.setRunningState(false);
startButton.setButtonEnabled(true);
setRepalyButtonEnable(true);
}
return;
}
AnalyzerUtil.changePage(TimelinePage.ID);
- AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_RECORDING);
- RecordStartStopThread.runStartStopThread();
+// AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_RECORDING);
+ AnalyzerManager.setRunningState(true);
+ TraceStartStopThread.runStartStopThread();
}
public void stopTrace() {
ShortCutManager.getInstance().setEnabled(false);
AnalyzerManager.getProject().setStopTime(getTime());
- AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
- RecordStartStopThread.runStartStopThread();
+// AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ AnalyzerManager.setRunningState(false);
+ TraceStartStopThread.runStartStopThread();
}
private void createToolbar(Composite parent) {
package org.tizen.dynamicanalyzer.ui.toolbar;
+import static org.tizen.dynamicanalyzer.common.AnalyzerConstants.*;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.HostResult;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
-public class RecordStartStopThread implements Runnable {
+public class TraceStartStopThread implements Runnable {
private static Thread startStopThread = null;
private static int count = 0;
public static void runStartStopThread() {
if (count == 0) {
count++;
- startStopThread = new Thread(null, new RecordStartStopThread(),
- AnalyzerConstants.START_STOP_THREAD);
+ startStopThread = new Thread(null, new TraceStartStopThread(),
+ START_STOP_THREAD);
startStopThread.start();
}
}
});
ShortCutManager.getInstance().setEnabled(true);
} else {
- AnalyzerUtil
- .setRecordState(RecordStateSourceProvider.RECORD_READY);
+ // AnalyzerUtil
+ // .setRecordState(RecordStateSourceProvider.RECORD_READY);
+ AnalyzerManager.setRunningState(false);
final String msg = isStarted.toString();
Display.getDefault().syncExec(new Runnable() {
@Override
}
private void recordStop() {
- AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ // AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ AnalyzerManager.setRunningState(false);
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
getInstance().getControlDataChecker().parserLog(
(ControlData) logs.get(i));
} else {
- getInstance().getSceneTransformDataChecker().parserLog(
- (SceneData) logs.get(i));
+// getInstance().getSceneTransformDataChecker().parserLog(
+// (SceneData) logs.get(i));
}
}
}
import java.net.Socket;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
import org.eclipse.core.commands.ExecutionException;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.handlers.RealtimePerspectiveHandler;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.data.ApiNameManager;
-import org.tizen.dynamicanalyzer.swap.model.probe2.LogData;
import org.tizen.dynamicanalyzer.swap.model.probe2.LogDataFactory;
import org.tizen.dynamicanalyzer.swap.model.probe2.ProbeCommonData;
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
import org.tizen.dynamicanalyzer.ui.page.BaseView;
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.page.ViewAction;
public class AnalyzerUtil {
private static IWorkbenchWindow window = null;
- private static String recordState = RecordStateSourceProvider.RECORD_READY;
+// private static String recordState = RecordStateSourceProvider.RECORD_READY;
private static final int ENLARGED_LENGTH = 12;
// FIXME start
return CommonConstants.EMPTY;
}
- public static String getRecordState() {
- return recordState;
- }
+// public static String getRecordState() {
+// return recordState;
+// }
public static ViewPart getViewPart(String id) {
IWorkbenchPage page = getWorkbenchWindow().getActivePage();
});
}
- public static void setRecordState(final String state) {
- recordState = state;
- }
+// public static void setRecordState(final String state) {
+// recordState = state;
+// }
public static int getTableItemHeight(Grid table) {
GC gc = new GC(table);
.parseInt(input[LogCenterConstants.UI_EVENT_DETAIL_TYPE]);
int x = Integer.parseInt(input[LogCenterConstants.UI_EVENT_X]);
int y = Integer.parseInt(input[LogCenterConstants.UI_EVENT_Y]);
- int info1 = initIntPayload(input[LogCenterConstants.UI_EVENT_INFO1]);
+ String info1 = input[LogCenterConstants.UI_EVENT_INFO1];
int info2 = initIntPayload(input[LogCenterConstants.UI_EVENT_INFO2]);
rear = ByteUtils.getByte(eventType, detailType, x, y, info1, info2);
result = ByteUtils.concatByteArray(front, rear);
}
return apiMap;
}
+
}