rename (Streamable -> StreamElement) (SWAPModel -> Streamable) (ByteUtils -> ByteUtil)
move some classes to common plugin (ByteUtils, ByteSwapper, SWAPModel)
Change-Id: I97368a294f34808f1c2cde395c64dee639db5a3c
Signed-off-by: greatim <jaewon81.lim@samsung.com>
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: org.tizen.dynamicanalyzer.callback,
org.tizen.dynamicanalyzer.constant,
+ org.tizen.dynamicanalyzer.model,
org.tizen.dynamicanalyzer.util
Import-Package: org.tizen.common.core.application
* - S-Core Co., Ltd
*
*/
-package org.tizen.dynamicanalyzer.swap.model;
+package org.tizen.dynamicanalyzer.model;
-public interface SWAPModel {
- public byte[] getByteValue();
+public interface Streamable {
+ public byte[] toByteStream();
- public void setByteToValues(byte[] input);
+ public void fromByteStream(byte[] input);
}
* - S-Core Co., Ltd
*
*/
-package org.tizen.dynamicanalyzer.utils;
+package org.tizen.dynamicanalyzer.util;
public class ByteSwapper {
/**
* - S-Core Co., Ltd
*
*/
-package org.tizen.dynamicanalyzer.swap.model;
+package org.tizen.dynamicanalyzer.util;
import java.nio.ByteBuffer;
import java.util.List;
-import org.tizen.dynamicanalyzer.utils.ByteSwapper;
-import org.tizen.dynamicanalyzer.util.DALogger;
+import org.tizen.dynamicanalyzer.model.Streamable;
-public class ByteUtils {
+public class ByteUtil {
private static final DALogger DA_LOG = DALogger.getInstance();
public static byte EOS = '\0';
if (obj instanceof Integer) {
int value = (Integer) obj;
- temp = ByteUtils
- .concatByteArray(temp, ByteUtils.toBytes(value));
+ temp = ByteUtil
+ .concatByteArray(temp, ByteUtil.toBytes(value));
} else if (obj instanceof Long) {
long value = (Long) obj;
- temp = ByteUtils
- .concatByteArray(temp, ByteUtils.toBytes(value));
+ temp = ByteUtil
+ .concatByteArray(temp, ByteUtil.toBytes(value));
} else if (obj instanceof Float) {
float f = (Float) obj;
- temp = ByteUtils.concatByteArray(temp,
- ByteUtils.floatToBytes(f));
+ temp = ByteUtil.concatByteArray(temp,
+ ByteUtil.floatToBytes(f));
} else if (obj instanceof Double) {
double d = (Double) obj;
- temp = ByteUtils.concatByteArray(temp,
- ByteUtils.doubleToBytes(d));
+ temp = ByteUtil.concatByteArray(temp,
+ ByteUtil.doubleToBytes(d));
} else if (obj instanceof String) {
String value = (String) obj;
- temp = ByteUtils.concatByteArray(temp,
- ByteUtils.stringToByte(value));
+ temp = ByteUtil.concatByteArray(temp,
+ ByteUtil.stringToByte(value));
} else if (obj instanceof byte[]) {
- temp = ByteUtils.concatByteArray(temp, (byte[]) obj);
+ temp = ByteUtil.concatByteArray(temp, (byte[]) obj);
} else if (obj instanceof List<?>) {
List<?> a = (List<?>) obj;
- temp = ByteUtils.concatByteArray(temp,
+ temp = ByteUtil.concatByteArray(temp,
getByteFromList((List<Object>) obj));
} else {
continue;
public static <T> byte[] getByteFromList(List<T> input) {
byte[] temp = new byte[0];
for (T obj : input) {
- if (obj instanceof SWAPModel) {
- temp = ByteUtils.concatByteArray(temp,
- ((SWAPModel) obj).getByteValue());
+ if (obj instanceof Streamable) {
+ temp = ByteUtil.concatByteArray(temp,
+ ((Streamable) obj).toByteStream());
} else {
- temp = ByteUtils.concatByteArray(temp, obj);
+ temp = ByteUtil.concatByteArray(temp, obj);
}
}
return temp;
import org.eclipse.core.commands.ExecutionException;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.swap.model.data.ReplayData;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
import org.tizen.dynamicanalyzer.ui.toolbar.replay.data.ReplayDataManager;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.widgets.timer.IAlarm;
import org.tizen.dynamicanalyzer.widgets.timer.TimerClock;
int count = replayData.getObjectCount();
byte[] eventObjs = null;
for (int i = 0; i < count; i++) {
- eventObjs = ByteUtils.concatByteArray(eventObjs, replayData
+ eventObjs = ByteUtil.concatByteArray(eventObjs, replayData
.getRecordEvent().get(i).getByteValues());
// System.out.println(" sec : "
// + " value : "
// + replayData.getRecordEvent().get(i).getEventValue());
}
- replayEvent = ByteUtils.getByte(REPLAY_ON, startTime.getSec(),
+ replayEvent = ByteUtil.getByte(REPLAY_ON, startTime.getSec(),
startTime.getNano(), count, eventObjs);
}
return null;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;
import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.util.DALogger;
public class LogParser implements Runnable {
int tid = 0;
int cpuNum = 0;
- front = ByteUtils.getByte(pid, pcAddr, tid, cpuNum);
+ front = ByteUtil.getByte(pid, pcAddr, tid, cpuNum);
} else {
if (id == DataChannelConstants.MSG_PROBE_SCREENSHOT) {
DA_LOG.debug("debug ");
int reserved1 = initIntPayload(newLog[8]);
int reserved2 = initIntPayload(newLog[9]);
- front = ByteUtils.getByte(apiId, pid, tid, argsCount, args, ret,
+ front = ByteUtil.getByte(apiId, pid, tid, argsCount, args, ret,
err, internal, caller, reserved1, reserved2);
}
.parseInt(input[LogCenterConstants.MEMORY_APITYPE_INDEX]);
long address = AnalyzerUtil
.addrToLong(input[LogCenterConstants.MEMORY_ADDR_INDEX]);
- rear = ByteUtils.getByte(size, apiType, address);
- result = ByteUtils.concatByteArray(front, rear);
+ rear = ByteUtil.getByte(size, apiType, address);
+ result = ByteUtil.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_PROBE_UICONTROL:
String parentName = input[LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_NAME_INDEX];
String childClassName = input[LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX];
long childPointer = AnalyzerUtil
.addrToLong(input[LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_POINTER_INDEX]);
- rear = ByteUtils.getByte(parentName, parentClassName,
+ rear = ByteUtil.getByte(parentName, parentClassName,
parentPointer, childName, childClassName, childPointer);
- result = ByteUtils.concatByteArray(front, rear);
+ result = ByteUtil.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_PROBE_UIEVENT:
int eventType = Integer
int y = Integer.parseInt(input[LogCenterConstants.UI_EVENT_Y]);
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);
+ rear = ByteUtil.getByte(eventType, detailType, x, y, info1, info2);
+ result = ByteUtil.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_PROBE_FILE:
long sizeValue = Long
long fileSize = Long
.parseLong(input[LogCenterConstants.RESOURCE_FILE_SIZE_INDEX]);
String filePath = input[LogCenterConstants.RESOURCE_FILE_PATH_INDEX];
- rear = ByteUtils.getByte(sizeValue, fdValue, fdType, fdApiType,
+ rear = ByteUtil.getByte(sizeValue, fdValue, fdType, fdApiType,
fileSize, filePath);
- result = ByteUtils.concatByteArray(front, rear);
+ result = ByteUtil.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_PROBE_NETWORK:
DA_LOG.debug("case AnalyzerConstants.MSG_PROBE_NETWORK");
long elapsedTime = Long
.parseLong(input[LogCenterConstants.GL_ELAPSED_TIME_INDEX]);
String contextValue = input[LogCenterConstants.GL_CONTEXT_VALUE_INDEX];
- rear = ByteUtils.getByte(apiType, elapsedTime, contextValue);
- result = ByteUtils.concatByteArray(front, rear);
+ rear = ByteUtil.getByte(apiType, elapsedTime, contextValue);
+ result = ByteUtil.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_PROBE_LIFECYCLE:
result = front;
String imgFilePath = input[LogCenterConstants.SCREENSHOT_IMAGE_PATH_INDEX];
int orientation = Integer
.parseInt(input[LogCenterConstants.SCREENSHOT_ROTATE_INDEX]);
- rear = ByteUtils.getByte(imgFilePath, orientation);
- result = ByteUtils.concatByteArray(front, rear);
+ rear = ByteUtil.getByte(imgFilePath, orientation);
+ result = ByteUtil.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_PROBE_SCENE:
String sceneName = input[LogCenterConstants.USER_INTERFACE_SCENE_TRANSFORMS_LIST_SCENE_NAME_INDEX];
.parseInt(input[LogCenterConstants.USER_INTERFACE_SCENE_TRANSFORMS_LIST_TRANSITION_INDEX]);
int userTransitionTime = Integer
.parseInt(input[LogCenterConstants.USER_INTERFACE_SCENE_TRANSFORMS_LIST_USERTIME_INDEX]);
- rear = ByteUtils
+ rear = ByteUtil
.getByte(sceneName, formName, formPointer, panelName,
panelPointer, transitionTime, userTransitionTime);
- result = ByteUtils.concatByteArray(front, rear);
+ result = ByteUtil.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_DATA_SYSTEM:
result = front;
break;
case DataChannelConstants.MSG_DATA_SAMPLE:
- result = ByteUtils.concatByteArray(front, rear);
+ result = ByteUtil.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_PROBE_THREAD:
long pThreadId = Long
.parseInt(input[LogCenterConstants.THREAD_TYPE_INDEX]);
int threadApiType = Integer
.parseInt(input[LogCenterConstants.THREAD_API_TYPE_INDEX]);
- rear = ByteUtils.getByte(pThreadId, ospThradId, threadType,
+ rear = ByteUtil.getByte(pThreadId, ospThradId, threadType,
threadApiType);
- result = ByteUtils.concatByteArray(front, rear);
+ result = ByteUtil.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_PROBE_CUSTOM:
int handle = Integer
.parseInt(input[LogCenterConstants.CUSTOM_CHART_COLOR]);
double value = Double
.parseDouble(input[LogCenterConstants.CUSTOM_CHART_VALUE]);
- rear = ByteUtils.getByte(handle, customType, customName, color,
+ rear = ByteUtil.getByte(handle, customType, customName, color,
value);
- result = ByteUtils.concatByteArray(front, rear);
+ result = ByteUtil.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_PROBE_SYNC:
long syncVal = Long
.parseInt(input[LogCenterConstants.SYNC_TYPE_INDEX]);
int syncApiType = Integer
.parseInt(input[LogCenterConstants.SYNC_API_TYPE_INDEX]);
- rear = ByteUtils.getByte(syncVal, syncType, syncApiType);
- result = ByteUtils.concatByteArray(front, rear);
+ rear = ByteUtil.getByte(syncVal, syncType, syncApiType);
+ result = ByteUtil.concatByteArray(front, rear);
break;
default:
// USER_FUNCTION
.parseLong(input[LogCenterConstants.USER_FUNCTION_ELAPSED_TIME_INDEX]);
long pcAddr = Long
.parseLong(input[LogCenterConstants.PCADDR_INDEX]);
- rear = ByteUtils
+ rear = ByteUtil
.getByte(lowPc, highPc, ufType, elapsedTime, pcAddr);
- result = ByteUtils.concatByteArray(front, rear);
+ result = ByteUtil.concatByteArray(front, rear);
break;
}
byte[] temp = new byte[0];
for (int i = 0; i < fr.length; i++) {
float f = Float.parseFloat(fr[i]);
- temp = ByteUtils.getByte(temp, f);
+ temp = ByteUtil.getByte(temp, f);
coreCount = i + 1;
}
if (coreCount != 0) {
temp = new byte[0];
for (int i = 0; i < load.length - 1; i++) {
float f = Float.parseFloat(load[i]);
- temp = ByteUtils.getByte(temp, f);
+ temp = ByteUtil.getByte(temp, f);
}
byte[] cpuLoad = new byte[temp.length];
System.arraycopy(temp, 0, cpuLoad, 0, temp.length);
for (int i = 0; i < tLoad.length; i += 2) {
int tid = Integer.parseInt(tLoad[i]);
float tl = Float.parseFloat(tLoad[i + 1]);
- temp = ByteUtils.getByte(temp, tid, tl);
+ temp = ByteUtil.getByte(temp, tid, tl);
}
byte[] threadLoad = new byte[temp.length];
System.arraycopy(temp, 0, threadLoad, 0, temp.length);
for (int i = 0; i < pLoad.length; i += 2) {
int tid = Integer.parseInt(pLoad[i]);
float tl = Float.parseFloat(pLoad[i + 1]);
- temp = ByteUtils.getByte(temp, tid, tl);
+ temp = ByteUtil.getByte(temp, tid, tl);
}
byte[] procLoad = new byte[temp.length];
System.arraycopy(temp, 0, procLoad, 0, temp.length);
int netSend = initIntPayload(newLog[31]);
int netRecv = initIntPayload(newLog[32]);
- byte[] front = ByteUtils.getByte(energy, wifi, bt, gps, brightness,
+ byte[] front = ByteUtil.getByte(energy, wifi, bt, gps, brightness,
camera, sound, audio, vibration, voltage, rssi, video, call,
dnet, cpuFrequency, appCpuUsage, cpuLoad, virtualMem, resident,
shared, pss, totalAlloc, systemTotal, systemUsed,
// this class is parent class of data class which is element of blocking queue.
// this class has methods to confirm that is end of stream or not
-public abstract class Streamable {
+public abstract class StreamElement {
private boolean endOfStream = false;
public final boolean isEndOfStream() {
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.DALogger;
if (ReplayTraceHandler.isReplay) {
replayEvent = ReplayTraceHandler.getReplayEvent();
} else {
- replayEvent = ByteUtils.getByte(ReplayTraceHandler.REPLAY_OFF);
+ replayEvent = ByteUtil.getByte(ReplayTraceHandler.REPLAY_OFF);
}
}
import java.util.ArrayList;
import java.util.List;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
-import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
+import org.tizen.dynamicanalyzer.model.Streamable;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
-public class ApplicationInst implements SWAPModel {
+public class ApplicationInst implements Streamable {
public static final int APPTYPE_TIZEN = 0x01;
public static final int APPTYPE_PROCESS = 0x02;
public static final int APPTYPE_COMMON_EXEC = 0x03;
private List<FunctionInst> functionInstList = new ArrayList<FunctionInst>();
@Override
- public byte[] getByteValue() {
- return ByteUtils.getByte(applicationType, applicationId,
+ public byte[] toByteStream() {
+ return ByteUtil.getByte(applicationType, applicationId,
executablePath, functionCount, functionInstList);
}
@Override
- public void setByteToValues(byte[] input) {
+ public void fromByteStream(byte[] input) {
// TODO Auto-generated method stub
}
*/
package org.tizen.dynamicanalyzer.swap.channel.control;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
-import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
+import org.tizen.dynamicanalyzer.model.Streamable;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
-public class BasicMessage implements SWAPModel {
+public class BasicMessage implements Streamable {
private int id = 0;
private int length = 0;
private byte[] payload = null;
}
@Override
- public byte[] getByteValue() {
- return ByteUtils.getByte(id, length, payload);
+ public byte[] toByteStream() {
+ return ByteUtil.getByte(id, length, payload);
}
@Override
- public void setByteToValues(byte[] input) {
+ public void fromByteStream(byte[] input) {
// TODO Auto-generated method stub
}
*/
package org.tizen.dynamicanalyzer.swap.channel.control;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
-import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
+import org.tizen.dynamicanalyzer.model.Streamable;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
-public class BinaryInfo implements SWAPModel {
+public class BinaryInfo implements Streamable {
private int type = 0;
private String targetBinaryPath = null;
private String localBinaryPath = null;
}
@Override
- public byte[] getByteValue() {
- return ByteUtils.concatByteArray(type, localBinaryPath);
+ public byte[] toByteStream() {
+ return ByteUtil.concatByteArray(type, localBinaryPath);
}
@Override
- public void setByteToValues(byte[] input) {
+ public void fromByteStream(byte[] input) {
// TODO Auto-generated method stub
}
*/
package org.tizen.dynamicanalyzer.swap.channel.control;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
-import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
+import org.tizen.dynamicanalyzer.model.Streamable;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
-public class EventObject implements SWAPModel {
+public class EventObject implements Streamable {
public static final int TOUCH = 0x8001;
public static final int KEY = 0x8002;
}
@Override
- public byte[] getByteValue() {
- return ByteUtils.getByte(time, id, type, code, value);
+ public byte[] toByteStream() {
+ return ByteUtil.getByte(time, id, type, code, value);
}
@Override
- public void setByteToValues(byte[] input) {
+ public void fromByteStream(byte[] input) {
// TODO Auto-generated method stub
}
*/
package org.tizen.dynamicanalyzer.swap.channel.control;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
-import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
+import org.tizen.dynamicanalyzer.model.Streamable;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
-public class FunctionInst implements SWAPModel {
+public class FunctionInst implements Streamable {
private long addr = 0;
private byte[] args = null;
}
@Override
- public byte[] getByteValue() {
- return ByteUtils.getByte(addr, args);
+ public byte[] toByteStream() {
+ return ByteUtil.getByte(addr, args);
}
@Override
- public void setByteToValues(byte[] input) {
+ public void fromByteStream(byte[] input) {
// TODO Auto-generated method stub
}
import java.util.List;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
-import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
+import org.tizen.dynamicanalyzer.model.Streamable;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
-public class LibraryInst implements SWAPModel {
+public class LibraryInst implements Streamable {
// path of binary
private String path = null;
}
@Override
- public byte[] getByteValue() {
- return ByteUtils.getByte(path, count, funcInstList);
+ public byte[] toByteStream() {
+ return ByteUtil.getByte(path, count, funcInstList);
}
@Override
- public void setByteToValues(byte[] input) {
+ public void fromByteStream(byte[] input) {
// TODO Auto-generated method stub
}
import java.util.ArrayList;
import java.util.List;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
-import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
+import org.tizen.dynamicanalyzer.model.Streamable;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
-public class ReplayEvent implements SWAPModel {
+public class ReplayEvent implements Streamable {
private int enabled = 0;
private long time = 0;
private int objectCount = 0;
}
@Override
- public byte[] getByteValue() {
- return ByteUtils.getByte(enabled, time, objectCount, eventObjectList);
+ public byte[] toByteStream() {
+ return ByteUtil.getByte(enabled, time, objectCount, eventObjectList);
}
@Override
- public void setByteToValues(byte[] input) {
+ public void fromByteStream(byte[] input) {
// TODO Auto-generated method stub
}
*/
package org.tizen.dynamicanalyzer.swap.channel.control;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
-import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
+import org.tizen.dynamicanalyzer.model.Streamable;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
-public class RunTimeConfiguration implements SWAPModel {
+public class RunTimeConfiguration implements Streamable {
private long lowFeatures = 0;
private long highFeatures = 0;
}
@Override
- public byte[] getByteValue() {
- byte[] lowByte = ByteUtils.getByte(lowFeatures);
- byte[] highByte = ByteUtils.getByte(highFeatures);
+ public byte[] toByteStream() {
+ byte[] lowByte = ByteUtil.getByte(lowFeatures);
+ byte[] highByte = ByteUtil.getByte(highFeatures);
byte[] features = new byte[8];
System.arraycopy(lowByte, 0, features, 0, 4);
System.arraycopy(highByte, 0, features, 4, 4);
- return ByteUtils.getByte(features, nullFeatures, systemTracePeriod,
+ return ByteUtil.getByte(features, nullFeatures, systemTracePeriod,
samplingPeriod);
}
@Override
- public void setByteToValues(byte[] input) {
+ public void fromByteStream(byte[] input) {
// TODO Auto-generated method stub
}
import java.util.ArrayList;
import java.util.List;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
-import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
+import org.tizen.dynamicanalyzer.model.Streamable;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
-public class UserSpaceInst implements SWAPModel {
+public class UserSpaceInst implements Streamable {
// count of applications
// private int count = 0;
private List<ApplicationInst> appInstList = null;
}
@Override
- public byte[] getByteValue() {
- return ByteUtils.getByte(getCount(), appInstList);
+ public byte[] toByteStream() {
+ return ByteUtil.getByte(getCount(), appInstList);
}
@Override
- public void setByteToValues(byte[] input) {
+ public void fromByteStream(byte[] input) {
// TODO Auto-generated method stub
}
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
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.data.LogDataFactory;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.util.DALogger;
public class BasicDataMessage {
String strId = String.format("%4x", id);
DA_LOG.debug("Message [id : " + strId + "] [seq :" + seq
+ "] [ Time : " + time + " ms]");
- ByteUtils.printByteArray(payload);
+ ByteUtil.printByteArray(payload);
}
}
}
import org.tizen.dynamicanalyzer.swap.channel.control.UserSpaceInst;
import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
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.data.LogDataUtils;
import org.tizen.dynamicanalyzer.swap.platform.BinarySettingData;
import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
import org.tizen.dynamicanalyzer.ui.toolbar.StartProcessManager;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
UserSpaceInst userSpaceInst = getUserSpaceInst();
DA_LOG.performance("TEST", "Start Trace", "Set application inst");
byte[] replayData = AnalyzerManager.getProject().getReplayEvent();
- byte[] rear = ByteUtils.getByte(userSpaceInst.getByteValue(),
+ byte[] rear = ByteUtil.getByte(userSpaceInst.toByteStream(),
replayData);
int length = rear.length;
- byte[] ret = ByteUtils.getByte(AnalyzerConstants.MSG_START_SWAP,
+ byte[] ret = ByteUtil.getByte(AnalyzerConstants.MSG_START_SWAP,
length, rear);
DA_LOG.debug("print start message");
index += INT_SIZE; // message id
index += INT_SIZE; // payload length
index += INT_SIZE; // return id
- int sec = ByteUtils.toInt(data, index);
+ int sec = ByteUtil.toInt(data, index);
index += INT_SIZE;
- int nano = ByteUtils.toInt(data, index);
+ int nano = ByteUtil.toInt(data, index);
AnalyzerManager.getProject().setProfileStartTime(
new DATime(sec, nano));
byte[] payload = getMessagePayload(result.getRet());
DATime profilingStartTime = new DATime();
int index = 0;
- int sec = ByteUtils.toInt(payload, index);
+ int sec = ByteUtil.toInt(payload, index);
index += INT_SIZE;
- int nano = ByteUtils.toInt(payload, index);
+ int nano = ByteUtil.toInt(payload, index);
index += INT_SIZE;
profilingStartTime.setSec(sec);
profilingStartTime.setNano(nano);
public HostResult sendBinaryInfoMessage(AppInfo selectedApp) {
// send config message
- byte[] msgBinInfo = ByteUtils
+ byte[] msgBinInfo = ByteUtil
.toBytes(AnalyzerConstants.MSG_BINARY_INFO);
PackageInfo pkgInfo = GlobalInformation.getCurrentDeviceInfo()
}
int binCount = apps.size();
- byte[] preMsg = ByteUtils.getByte(binCount);
+ byte[] preMsg = ByteUtil.getByte(binCount);
for (AppInfo app : apps) {
String targetPath = app.getExecPath();
- preMsg = ByteUtils.getByte(preMsg, targetPath);
+ preMsg = ByteUtil.getByte(preMsg, targetPath);
}
int length = preMsg.length;
- byte[] msg = ByteUtils.getByte(msgBinInfo, length, preMsg);
+ byte[] msg = ByteUtil.getByte(msgBinInfo, length, preMsg);
HostResult result = handleControlMessage(
GlobalInformation.getCurrentDeviceInfo(), msg);
byte[] payload = getMessagePayload(result.getRet());
int index = 0;
- int count = ByteUtils.toInt(payload, index);
+ int count = ByteUtil.toInt(payload, index);
index += INT_SIZE;
String localBinaryPath = null;
binInfo.setTargetBinaryPath(targetPath);
app.setMainBinaryInfo(binInfo);
- int binaryType = ByteUtils.toInt(payload, index);
+ int binaryType = ByteUtil.toInt(payload, index);
index += INT_SIZE;
- localBinaryPath = ByteUtils.getString(payload, index).trim();
- index += ByteUtils.getStringLength(payload, index);
+ localBinaryPath = ByteUtil.getString(payload, index).trim();
+ index += ByteUtil.getStringLength(payload, index);
String[] splitLocalBinaryPath = localBinaryPath
.split(CommonConstants.SLASH);
binInfo.setLocalBinaryPath(localBinaryPath);
binInfo.setTempBinaryPath(localBinaryPath);
}
- String md5sum = ByteUtils.getString(payload, index);
- index += ByteUtils.getStringLength(payload, index);
+ String md5sum = ByteUtil.getString(payload, index);
+ index += ByteUtil.getStringLength(payload, index);
binInfo.setType(binaryType);
binInfo.setTempBinaryPath(localBinaryPath);
binInfo.setMd5sumValue(md5sum);
continue;
} else {
- String md5sum = ByteUtils.getString(payload, index);
- index += ByteUtils.getStringLength(payload, index);
+ String md5sum = ByteUtil.getString(payload, index);
+ index += ByteUtil.getStringLength(payload, index);
binInfo.setType(binaryType);
binInfo.setTempBinaryPath(localBinaryPath);
binInfo.setMd5sumValue(md5sum);
public HostResult sendConfigurationMessage(DeviceInfo devInfo, int type,
String message) {
// send config message
- byte[] config = ByteUtils.toBytes(AnalyzerConstants.MSG_CONFIG);
+ byte[] config = ByteUtil.toBytes(AnalyzerConstants.MSG_CONFIG);
RunTimeConfiguration rt = new RunTimeConfiguration();
rt.setFeatures(
ConfigureManager.getInstance().getConfiguration(devInfo),
rt.setSystemTracePeriod(ConfigureManager.getInstance()
.getSystemPeriod());
rt.setSamplingPeriod(ConfigureManager.getInstance().getSamplingPeriod());
- byte[] rtByte = rt.getByteValue();
+ byte[] rtByte = rt.toByteStream();
int length = rtByte.length;
- byte[] msg = ByteUtils.getByte(config, length, rtByte);
+ byte[] msg = ByteUtil.getByte(config, length, rtByte);
// ByteUtils.printByteArrayForStart(msg);
@Override
public HostResult stopTrace() {
if (DACommunicator.isRunning()) {
- byte[] stop = ByteUtils.toBytes(AnalyzerConstants.MSG_STOP_SWAP);
+ byte[] stop = ByteUtil.toBytes(AnalyzerConstants.MSG_STOP_SWAP);
int length = 0;
- byte[] stopMsg = ByteUtils.getByte(stop, length);
+ byte[] stopMsg = ByteUtil.getByte(stop, length);
HostResult result = handleControlMessage(
GlobalInformation.getCurrentDeviceInfo(), stopMsg);
controlSock.getOutputStream().write(message);
}
- int msgId = ByteUtils.toInt(message);
+ int msgId = ByteUtil.toInt(message);
DA_LOG.debug("wait for ack... [send message : " + msgId + " ]");
int readsize = -1;
byte[] buf = new byte[readsize];
System.arraycopy(cbuf, 0, buf, 0, readsize);
result = HostResult.SUCCESS;
- int ackId = ByteUtils.toInt(buf);
+ int ackId = ByteUtil.toInt(buf);
// for debug
System.out.print("ack id : ");
public HostResult getTargetInfo(DeviceInfo device) {
DA_LOG.debug("Send target info : "
- + ByteUtils.getByte(AnalyzerConstants.MSG_TARGET_INFO, 0));
+ + ByteUtil.getByte(AnalyzerConstants.MSG_TARGET_INFO, 0));
HostResult result = handleControlMessage(device,
- ByteUtils.getByte(AnalyzerConstants.MSG_TARGET_INFO, 0));
+ ByteUtil.getByte(AnalyzerConstants.MSG_TARGET_INFO, 0));
if (result.isSuccess()) {
// FIXME : log parsing
byte[] data = result.getRet();
@Override
public HostResult sendKeepAliveMessage(DeviceInfo device) {
DA_LOG.debug("Send keep alive message : "
- + ByteUtils.getByte(AnalyzerConstants.MSG_KEEP_ALIVE, 0));
+ + ByteUtil.getByte(AnalyzerConstants.MSG_KEEP_ALIVE, 0));
HostResult result = handleControlMessage(device,
- ByteUtils.getByte(AnalyzerConstants.MSG_KEEP_ALIVE, 0));
+ ByteUtil.getByte(AnalyzerConstants.MSG_KEEP_ALIVE, 0));
if (result.isSuccess()) {
DA_LOG.debug("keep alive message ack :" + result.getMessage());
private boolean isCorrectAck(int ackType, HostResult result) {
byte[] data = result.getRet();
int index = 0;
- int msgId = ByteUtils.toInt(data, index);
+ int msgId = ByteUtil.toInt(data, index);
index += INT_SIZE;
// int length = ByteUtils.toInt(data, index);
index += INT_SIZE;
- int retId = ByteUtils.toInt(data, index);
+ int retId = ByteUtil.toInt(data, index);
index += INT_SIZE;
if (ackType == msgId) {
int numberOfDevice = 0;
String deviceList = CommonConstants.EMPTY;
- systemMemorySize = ByteUtils.toLong(payload, index);
+ systemMemorySize = ByteUtil.toLong(payload, index);
index += LONG_SIZE;
- storageSize = ByteUtils.toLong(payload, index);
+ storageSize = ByteUtil.toLong(payload, index);
index += LONG_SIZE;
- bluetoothSupport = ByteUtils.toInt(payload, index);
+ bluetoothSupport = ByteUtil.toInt(payload, index);
index += INT_SIZE;
- gpsSupport = ByteUtils.toInt(payload, index);
+ gpsSupport = ByteUtil.toInt(payload, index);
index += INT_SIZE;
- wifiSupport = ByteUtils.toInt(payload, index);
+ wifiSupport = ByteUtil.toInt(payload, index);
index += INT_SIZE;
- cameraCount = ByteUtils.toInt(payload, index);
+ cameraCount = ByteUtil.toInt(payload, index);
index += INT_SIZE;
- networkType = ByteUtils.getString(payload, index);
- index += ByteUtils.getStringLength(payload, index);
- maxBrightness = ByteUtils.toInt(payload, index);
+ networkType = ByteUtil.getString(payload, index);
+ index += ByteUtil.getStringLength(payload, index);
+ maxBrightness = ByteUtil.toInt(payload, index);
index += INT_SIZE;
- numberOfCPU = ByteUtils.toInt(payload, index);
+ numberOfCPU = ByteUtil.toInt(payload, index);
index += INT_SIZE;
- numberOfDevice = ByteUtils.toInt(payload, index);
+ numberOfDevice = ByteUtil.toInt(payload, index);
index += INT_SIZE;
for (int i = 0; i < numberOfDevice; i++) {
private int getReturnId(byte[] data) {
int index = INT_SIZE * 2;
- return ByteUtils.toInt(data, index);
+ return ByteUtil.toInt(data, index);
}
private byte[] getMessagePayload(byte[] data) {
int index = INT_SIZE;
- int size = ByteUtils.toInt(data, index);
+ int size = ByteUtil.toInt(data, index);
index += INT_SIZE * 2;
size -= INT_SIZE;
byte[] payload = new byte[size];
byte[] test = new byte[1];
test[0] = 'n';
- ret = ByteUtils.getByte(ret, test);
+ ret = ByteUtil.getByte(ret, test);
return ret;
}
}
public HostResult sendScreenShotRequest() {
- byte[] msg = ByteUtils.getByte(AnalyzerConstants.MSG_GET_SCREENSHOT, 0);
+ byte[] msg = ByteUtil.getByte(AnalyzerConstants.MSG_GET_SCREENSHOT, 0);
HostResult result = HostResult.SUCCESS;
Socket controlSock = GlobalInformation.getCurrentDeviceInfo()
.getControlSock();
byte[] msg = new byte[0];
int count = settings.size();
int failedCount = 0;
- msg = ByteUtils.getByte(msg, messageId);
+ msg = ByteUtil.getByte(msg, messageId);
byte[] libInst = new byte[0];
for (int a = 0; a < count; a++) {
String binaryPath = settings.get(a).getBinaryPath();
// System.out.println();
}
size = size - exSize;
- libInst = ByteUtils.getByte(libInst, binaryPath, size);
+ libInst = ByteUtil.getByte(libInst, binaryPath, size);
for (int i = 0; i < size; i++) {
- libInst = ByteUtils.getByte(libInst, functionInstList.get(i)
- .getByteValue());
+ libInst = ByteUtil.getByte(libInst, functionInstList.get(i)
+ .toByteStream());
}
}
count = count - failedCount;
- libInst = ByteUtils.getByte(count, libInst);
+ libInst = ByteUtil.getByte(count, libInst);
int length = libInst.length;
- msg = ByteUtils.getByte(msg, length, libInst);
+ msg = ByteUtil.getByte(msg, length, libInst);
// ByteUtils.printByteArrayForStart(msg);
HostResult result = handleControlMessage(
int binCount = binPaths.size();
byte[] sendBin = new byte[0];
- sendBin = ByteUtils.getByte(binCount);
+ sendBin = ByteUtil.getByte(binCount);
for (int i = 0; i < binCount; i++) {
String targetPath = binPaths.get(i);
- sendBin = ByteUtils.getByte(sendBin, targetPath);
+ sendBin = ByteUtil.getByte(sendBin, targetPath);
}
int length = sendBin.length;
- byte[] msg = ByteUtils.getByte(AnalyzerConstants.MSG_BINARY_INFO,
+ byte[] msg = ByteUtil.getByte(AnalyzerConstants.MSG_BINARY_INFO,
length, sendBin);
HostResult result = handleControlMessage(
GlobalInformation.getCurrentDeviceInfo(), msg);
// parse binary info
byte[] payload = getMessagePayload(result.getRet());
int index = 0;
- int count = ByteUtils.toInt(payload, index);
+ int count = ByteUtil.toInt(payload, index);
index += INT_SIZE;
String localBinaryPath = null;
if (binCount != count) {
}
for (int i = 0; i < binCount; i++) {
BinaryInfo binInfo = binInfoList.get(i);
- int binaryType = ByteUtils.toInt(payload, index);
+ int binaryType = ByteUtil.toInt(payload, index);
index += INT_SIZE;
- localBinaryPath = ByteUtils.getString(payload, index).trim();
- index += ByteUtils.getStringLength(payload, index);
+ localBinaryPath = ByteUtil.getString(payload, index).trim();
+ index += ByteUtil.getStringLength(payload, index);
binInfo.setLocalBinaryPath(localBinaryPath);
binInfo.setTempBinaryPath(localBinaryPath);
String[] splitLocalBinaryPath = localBinaryPath
+ File.separator + getFileName(binPaths.get(i));
result = pullTheFile(binPaths.get(i), localBinaryPath);
if (result.isSuccess()) {
- String md5sum = ByteUtils.getString(payload, index);
- index += ByteUtils.getStringLength(payload, index);
+ String md5sum = ByteUtil.getString(payload, index);
+ index += ByteUtil.getStringLength(payload, index);
binInfo.setType(binaryType);
binInfo.setTempBinaryPath(localBinaryPath);
binInfo.setMd5sumValue(md5sum);
}
continue;
} else {
- String md5sum = ByteUtils.getString(payload, index);
- index += ByteUtils.getStringLength(payload, index);
+ String md5sum = ByteUtil.getString(payload, index);
+ index += ByteUtil.getStringLength(payload, index);
binInfo.setType(binaryType);
binInfo.setTempBinaryPath(localBinaryPath);
binInfo.setMd5sumValue(md5sum);
import java.util.HashMap;
import java.util.List;
-import org.tizen.dynamicanalyzer.model.Streamable;
+import org.tizen.dynamicanalyzer.model.StreamElement;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-public class LogPackage extends Streamable {
+public class LogPackage extends StreamElement {
private HashMap<Integer, Logs> logMap;
public void clear() {
import org.tizen.dynamicanalyzer.swap.channel.data.LibraryObject;
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
import org.tizen.dynamicanalyzer.ui.toolbar.StopLogProcessor;
import org.tizen.dynamicanalyzer.ui.toolbar.StopProcessManager;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.util.DALogger;
String commandLineName = null;
int index = MSG_HEADER_SIZE;
- pid = ByteUtils.toInt(data, index);
+ pid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- commandLineName = ByteUtils.getString(data, index);
- index += ByteUtils.getStringLength(data, index);
- ppid = ByteUtils.toInt(data, index);
+ commandLineName = ByteUtil.getString(data, index);
+ index += ByteUtil.getStringLength(data, index);
+ ppid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- int sec = ByteUtils.toInt(data, index);
+ int sec = ByteUtil.toInt(data, index);
index += INT_SIZE;
- int nano = ByteUtils.toInt(data, index);
+ int nano = ByteUtil.toInt(data, index);
index += INT_SIZE;
processStartTime.setSec(sec);
processStartTime.setNano(nano);
- lowAddr = ByteUtils.toLong(data, index);
+ lowAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- highAddr = ByteUtils.toLong(data, index);
+ highAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- targetBinaryPath = ByteUtils.getString(data, index);
- index += ByteUtils.getStringLength(data, index);
- dependantLibCount = ByteUtils.toInt(data, index);
+ targetBinaryPath = ByteUtil.getString(data, index);
+ index += ByteUtil.getStringLength(data, index);
+ dependantLibCount = ByteUtil.toInt(data, index);
index += INT_SIZE;
ProcessInfoPackage pInfoPack = processPkgMap.get(pid);
for (int i = 0; i < dependantLibCount; i++) {
LibraryObject libObj = new LibraryObject();
libObj.setPid(pid);
- long lowestAddr = ByteUtils.toLong(data, index);
+ long lowestAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- long highestAddr = ByteUtils.toLong(data, index);
+ long highestAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- String libPath = ByteUtils.getString(data, index);
+ String libPath = ByteUtil.getString(data, index);
// remove \0 char
// libPath = libPath.substring(0, libPath.length() - 1);
- index += ByteUtils.getStringLength(data, index);
+ index += ByteUtil.getStringLength(data, index);
libObj.setLowestAddress(lowestAddr);
libObj.setHighestAddress(highestAddr);
libObj.setLibPath(libPath);
/** parsing */
int index = 0;
- int id = ByteUtils.toInt(data, index);
+ int id = ByteUtil.toInt(data, index);
index += INT_SIZE;
// int seq = ByteUtils.toInt(data, index);
index += INT_SIZE;
DATime changeTime = new DATime();
- int sec = ByteUtils.toInt(data, index);
+ int sec = ByteUtil.toInt(data, index);
index += INT_SIZE;
- int nano = ByteUtils.toInt(data, index);
+ int nano = ByteUtil.toInt(data, index);
index += INT_SIZE;
changeTime.setSec(sec);
changeTime.setNano(nano);
// int length = ByteUtils.toInt(data, index);
index += INT_SIZE;
- int pid = ByteUtils.toInt(data, index);
+ int pid = ByteUtil.toInt(data, index);
index += INT_SIZE;
long lowAddr = 0;
long highAddr = 0;
if (id == DataChannelConstants.MSG_PROCESS_MAP) {
- lowAddr = ByteUtils.toLong(data, index);
+ lowAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- highAddr = ByteUtils.toLong(data, index);
+ highAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
}
String libPath = LogDataUtils.getString(index, data);
// System.out.println("header log");
// ByteUtils.printByteArrayForStart(header);
- int id = ByteUtils.toInt(header, 0);
+ int id = ByteUtil.toInt(header, 0);
/** for debug */
// int seq = ByteUtils.toInt(header, INT_SIZE);
// AnalyzerUtil.printHexdecimal(id);
// System.out.println();
- int payloadSize = ByteUtils.toInt(header,
+ int payloadSize = ByteUtil.toInt(header,
MSG_PAYLOAD_SIZE_INDEX);
byte[] payload = null;
payloadSize);
if(PRINT_DATA_LOG_TOFILE && printWriter != null) {
- printWriter.printf("%d %d %d %d %d :", id, ByteUtils.toInt(header, 4), ByteUtils.toInt(header, 8), ByteUtils.toInt(header, 12), payloadSize);
+ printWriter.printf("%d %d %d %d %d :", id, ByteUtil.toInt(header, 4), ByteUtil.toInt(header, 8), ByteUtil.toInt(header, 12), payloadSize);
for(int k = 0; k < payloadSize; k++)
printWriter.printf("%02x ", payload[k]);
printWriter.printf("\n");
}
private void processMessage(byte[] data) {
- int id = ByteUtils.toInt(data, 0);
+ int id = ByteUtil.toInt(data, 0);
LogData log = null;
switch (id) {
case DataChannelConstants.MSG_DATA_PROCESS_INFO:
{
// process command line name is changed (/proc/<pid>/cmdline)
int index = MSG_HEADER_SIZE;
- int pid = ByteUtils.toInt(data, index);
+ int pid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- String name = ByteUtils.getString(data, index);
- index += ByteUtils.getStringLength(data, index);
+ String name = ByteUtil.getString(data, index);
+ index += ByteUtil.getStringLength(data, index);
HashMap<Integer, ProcessInfoPackage> processPkgMap = AnalyzerManager
.getProject().getProcessInfoPackHash();
package org.tizen.dynamicanalyzer.swap.model;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class DATime {
private int sec;
}
public byte[] getByteValues() {
- return ByteUtils.getByte(sec, nano);
+ return ByteUtil.getByte(sec, nano);
}
@Override
import java.sql.SQLException;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class RecordEventObject extends LogData {
private DATime eventTime = new DATime();
}
public byte[] getByteValues() {
- return ByteUtils.getByte(eventTime.getByteValues(), eventId, eventType,
+ return ByteUtil.getByte(eventTime.getByteValues(), eventId, eventType,
eventCode, eventValue);
}
import java.sql.SQLException;
import org.tizen.dynamicanalyzer.swap.logparser.MessageParser;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class ContextSwitchData extends LogData {
super.makeData(data);
index = MessageParser.MSG_HEADER_SIZE;
- pcAddr = ByteUtils.toLong(data, index);
+ pcAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- pid = ByteUtils.toInt(data, index);
+ pid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- tid = ByteUtils.toInt(data, index);
+ tid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- cpuNum = ByteUtils.toInt(data, index);
+ cpuNum = ByteUtil.toInt(data, index);
index += INT_SIZE;
}
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class ControlData extends ProbeCommonData {
private String parentName = null;
parentClassName = new String(temp);
index += length;
- parentPointer = ByteUtils.toLong(data, index);
+ parentPointer = ByteUtil.toLong(data, index);
index += LONG_SIZE;
length = LogDataUtils.getStringLength(index, data);
childClassName = new String(temp);
index += length;
- childPointer = ByteUtils.toLong(data, index);
+ childPointer = ByteUtil.toLong(data, index);
}
public String getParentName() {
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class CustomData extends ProbeCommonData {
public void makeData(byte[] data) {
super.makeData(data);
- handle = ByteUtils.toInt(data, index);
+ handle = ByteUtil.toInt(data, index);
index += INT_SIZE;
- type = ByteUtils.toInt(data, index);
+ type = ByteUtil.toInt(data, index);
index += INT_SIZE;
int length = LogDataUtils.getStringLength(index, data);
name = new String(temp);
index += length;
- color = ByteUtils.toInt(data, index);
+ color = ByteUtil.toInt(data, index);
index += INT_SIZE;
- value = ByteUtils.toDouble(data, index);
+ value = ByteUtil.toDouble(data, index);
}
public int getHandle() {
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class FileData extends ProbeCommonData {
public void makeData(byte[] data) {
super.makeData(data);
- size = ByteUtils.toLong(data, index);
+ size = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- fdValue = ByteUtils.toLong(data, index);
+ fdValue = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- fdApiType = ByteUtils.toInt(data, index);
+ fdApiType = ByteUtil.toInt(data, index);
index += INT_SIZE;
- fileSize = ByteUtils.toLong(data, index);
+ fileSize = ByteUtil.toLong(data, index);
index += LONG_SIZE;
filePath = LogDataUtils.getString(index, data);
import java.sql.SQLException;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class GLES20LogData extends ProbeCommonData {
protected long glCurrentContextName = 0;
@Override
public void makeData(byte[] data) {
super.makeData(data);
- glCurrentContextName = ByteUtils.toLong(data, index);
+ glCurrentContextName = ByteUtil.toLong(data, index);
index += CommonConstants.LONG_SIZE;
- apiType = ByteUtils.toInt(data, index);
+ apiType = ByteUtil.toInt(data, index);
index += CommonConstants.INT_SIZE;
- elapsedTime = ByteUtils.toLong(data, index);
+ elapsedTime = ByteUtil.toLong(data, index);
index += CommonConstants.LONG_SIZE;
int length = LogDataUtils.getStringLength(index, data);
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.util.DALogger;
public abstract class LogData implements Cloneable {
public void makeData(byte[] data) {
isSWAP = DACommunicator.isSWAPVersion();
- id = ByteUtils.toInt(data, index);
+ id = ByteUtil.toInt(data, index);
index += INT_SIZE;
- seq = ByteUtils.toInt(data, index);
+ seq = ByteUtil.toInt(data, index);
index += INT_SIZE;
- long sec = ByteUtils.toInt(data, index);
+ long sec = ByteUtil.toInt(data, index);
index += INT_SIZE;
- long nano = ByteUtils.toInt(data, index);
+ long nano = ByteUtil.toInt(data, index);
index += INT_SIZE;
DATime startTime = AnalyzerManager.getProject().getProfileStartTime();
import java.util.List;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.format.ContextSwitchLogFormat;
import org.tizen.dynamicanalyzer.swap.model.format.ControlLogFormat;
import org.tizen.dynamicanalyzer.swap.model.format.CustomChartLogFormat;
import org.tizen.dynamicanalyzer.swap.model.format.ThreadLogFormat;
import org.tizen.dynamicanalyzer.swap.model.format.UIEventLogFormat;
import org.tizen.dynamicanalyzer.swap.model.format.UserFunctionLogFormat;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class LogDataFactory {
private static List<Integer> logList = new ArrayList<Integer>();
}
public static LogData createInstance(byte[] data) {
- int id = ByteUtils.toInt(data, 0);
+ int id = ByteUtil.toInt(data, 0);
LogData output = null;
switch (id) {
import static org.tizen.dynamicanalyzer.constant.CommonConstants.LONG_SIZE;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class LogDataUtils {
public static ArgsInfo parseArgs(byte[] payload, int index) {
ArgsInfo args = new ArgsInfo();
- int countOfArgs = ByteUtils.toInt(payload, index);
+ int countOfArgs = ByteUtil.toInt(payload, index);
index += INT_SIZE;
StringBuffer buffer = new StringBuffer();
for (int ii = 0; ii < countOfArgs; ii++) {
}
case 'd': {
- int iValue = ByteUtils.toInt(payload, index);
+ int iValue = ByteUtil.toInt(payload, index);
buffer.append(iValue);
index += Integer.SIZE / Byte.SIZE;
break;
}
case 'x': {
- long lValue = ByteUtils.toLong(payload, index);
+ long lValue = ByteUtil.toLong(payload, index);
buffer.append(lValue);
index += LONG_SIZE;
break;
}
case 'p': {
- long pValue = ByteUtils.toLong(payload, index);
+ long pValue = ByteUtil.toLong(payload, index);
buffer.append(AnalyzerUtil.toHexdecimal(pValue));
index += LONG_SIZE;
break;
}
case 'f': {
- float fValue = ByteUtils.toFloat(payload, index);
+ float fValue = ByteUtil.toFloat(payload, index);
buffer.append(fValue);
index += FLOAT_SIZE;
break;
}
case 'w': {
- double dValue = ByteUtils.toDouble(payload, index);
+ double dValue = ByteUtil.toDouble(payload, index);
buffer.append(dValue);
index += DOUBLE_SIZE;
break;
break;
}
case 'F': {
- long object = ByteUtils.toLong(payload, index);
+ long object = ByteUtil.toLong(payload, index);
buffer.append(AnalyzerUtil.toHexdecimal(object));
index += LONG_SIZE;
- int arrarySize = ByteUtils.toInt(payload, index);
+ int arrarySize = ByteUtil.toInt(payload, index);
index += INT_SIZE;
buffer.append(CommonConstants.OPEN_SQUARE_BRACKET);
for (int i = 0; i < arrarySize; i++) {
- float fValue = ByteUtils.toFloat(payload, index);
+ float fValue = ByteUtil.toFloat(payload, index);
buffer.append(fValue);
index += FLOAT_SIZE;
if (i != arrarySize - 1) {
index += 1;
break;
case 'd':
- int iValue = ByteUtils.toInt(payload, index);
+ int iValue = ByteUtil.toInt(payload, index);
buffer.append(iValue);
index += Integer.SIZE / Byte.SIZE;
break;
case 'x':
- long lValue = ByteUtils.toLong(payload, index);
+ long lValue = ByteUtil.toLong(payload, index);
buffer.append(lValue);
index += LONG_SIZE;
break;
case 'p':
- long pValue = ByteUtils.toLong(payload, index);
+ long pValue = ByteUtil.toLong(payload, index);
buffer.append(AnalyzerUtil.toHexdecimal(pValue));
index += LONG_SIZE;
break;
case 'f':
- float fValue = ByteUtils.toFloat(payload, index);
+ float fValue = ByteUtil.toFloat(payload, index);
buffer.append(fValue);
index += FLOAT_SIZE;
break;
case 'w':
- double dValue = ByteUtils.toDouble(payload, index);
+ double dValue = ByteUtil.toDouble(payload, index);
buffer.append(dValue);
index += DOUBLE_SIZE;
break;
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class MemoryData extends ProbeCommonData {
long size = 0;
public void makeData(byte[] data) {
super.makeData(data);
- size = ByteUtils.toInt(data, index);
+ size = ByteUtil.toInt(data, index);
index += LONG_SIZE;
- apiType = ByteUtils.toInt(data, index);
+ apiType = ByteUtil.toInt(data, index);
index += INT_SIZE;
- address = ByteUtils.toLong(data, index);
+ address = ByteUtil.toLong(data, index);
}
public long getSize() {
import java.sql.SQLException;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class NetworkData extends ProbeCommonData {
public void makeData(byte[] data) {
super.makeData(data);
- objectAddress = ByteUtils.toLong(data, index);
+ objectAddress = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- fdValue = ByteUtils.toLong(data, index);
+ fdValue = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- fdApiType = ByteUtils.toInt(data, index);
+ fdApiType = ByteUtil.toInt(data, index);
index += INT_SIZE;
- destinationIPAddress = ByteUtils.toInt(data, index);
+ destinationIPAddress = ByteUtil.toInt(data, index);
index += INT_SIZE;
- destinationPortAddress = ByteUtils.toInt(data, index);
+ destinationPortAddress = ByteUtil.toInt(data, index);
index += INT_SIZE;
- messageSize = ByteUtils.toInt(data, index);
+ messageSize = ByteUtil.toInt(data, index);
index += LONG_SIZE;
if (messageSize > 0) {
packetMessage = LogDataUtils.getString(index, data);
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
import org.tizen.dynamicanalyzer.swap.logparser.MessageParser;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class ProbeCommonData extends LogData {
super.makeData(data);
index = MessageParser.MSG_HEADER_SIZE;
- apiId = ByteUtils.toInt(data, index);
+ apiId = ByteUtil.toInt(data, index);
index += INT_SIZE;
- pid = ByteUtils.toInt(data, index);
+ pid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- tid = ByteUtils.toInt(data, index);
+ tid = ByteUtil.toInt(data, index);
index += INT_SIZE;
ArgsInfo argInfo = LogDataUtils.parseArgs(data, index);
ret = retInfo.getArgs();
index = retInfo.getLastIndex();
- errno = ByteUtils.toLong(data, index);
+ errno = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- internalCall = ByteUtils.toInt(data, index);
+ internalCall = ByteUtil.toInt(data, index);
index += INT_SIZE;
- callerAddress = ByteUtils.toLong(data, index);
+ callerAddress = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- reserved1 = ByteUtils.toInt(data, index);
+ reserved1 = ByteUtil.toInt(data, index);
index += INT_SIZE;
- reserved2 = ByteUtils.toInt(data, index);
+ reserved2 = ByteUtil.toInt(data, index);
index += INT_SIZE;
ProcessInfoPackage processInfoPkg = AnalyzerManager.getProject()
import org.tizen.dynamicanalyzer.swap.channel.control.BinaryInfo;
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class ProfileData extends LogData {
switch (id) {
case MSG_FUNCTION_ENTRY:
logCount++;
- pcAddr = ByteUtils.toLong(data, index);
+ pcAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- callerPcAddr = ByteUtils.toLong(data, index);
+ callerPcAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
byte[] temp = new byte[4];
System.arraycopy(data, index, temp, 0, 2);
- probeType = ByteUtils.toInt(temp, 0);
+ probeType = ByteUtil.toInt(temp, 0);
index += 2;
System.arraycopy(data, index, temp, 0, 2);
- probeSubType = ByteUtils.toInt(temp, 0);
+ probeSubType = ByteUtil.toInt(temp, 0);
index += 2;
- pid = ByteUtils.toInt(data, index);
+ pid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- tid = ByteUtils.toInt(data, index);
+ tid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- cpuNum = ByteUtils.toInt(data, index);
+ cpuNum = ByteUtil.toInt(data, index);
index += INT_SIZE;
ArgsInfo info = LogDataUtils.parseArgs(data, index);
args = info.getArgs();
break;
case MSG_FUNCTION_EXIT:
logCount++;
- pid = ByteUtils.toInt(data, index);
+ pid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- tid = ByteUtils.toInt(data, index);
+ tid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- pcAddr = ByteUtils.toLong(data, index);
+ pcAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- callerPcAddr = ByteUtils.toLong(data, index);
+ callerPcAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- cpuNum = ByteUtils.toInt(data, index);
+ cpuNum = ByteUtil.toInt(data, index);
index += INT_SIZE;
ArgsInfo retInfo = LogDataUtils.parseReturn(data, index);
ret = retInfo.getArgs();
break;
case MSG_CONTEXT_SWITCH_ENTRY:
case MSG_CONTEXT_SWITCH_EXIT:
- pcAddr = ByteUtils.toLong(data, index);
+ pcAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- pid = ByteUtils.toInt(data, index);
+ pid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- tid = ByteUtils.toInt(data, index);
+ tid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- cpuNum = ByteUtils.toInt(data, index);
+ cpuNum = ByteUtil.toInt(data, index);
index += INT_SIZE;
break;
case MSG_DATA_SAMPLE:
- pid = ByteUtils.toInt(data, index);
+ pid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- pcAddr = ByteUtils.toLong(data, index);
+ pcAddr = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- tid = ByteUtils.toInt(data, index);
+ tid = ByteUtil.toInt(data, index);
index += INT_SIZE;
- cpuNum = ByteUtils.toInt(data, index);
+ cpuNum = ByteUtil.toInt(data, index);
index += INT_SIZE;
break;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
-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.util.ByteUtil;
public class ReplayData extends LogData {
// super.makeData(data);
isSWAP = DACommunicator.isSWAPVersion();
- id = ByteUtils.toInt(data, index);
+ id = ByteUtil.toInt(data, index);
index += INT_SIZE;
- seq = ByteUtils.toInt(data, index);
+ seq = ByteUtil.toInt(data, index);
index += INT_SIZE;
- int sec = ByteUtils.toInt(data, index);
+ int sec = ByteUtil.toInt(data, index);
index += INT_SIZE;
- int nano = ByteUtils.toInt(data, index);
+ int nano = ByteUtil.toInt(data, index);
index += INT_SIZE;
DATime eventTime = new DATime();
eventTime.setSec(sec);
index += INT_SIZE; // payload length field offset
- int count = ByteUtils.toInt(data, index);
+ int count = ByteUtil.toInt(data, index);
index += INT_SIZE;
setObjectCount(count);
recordObj.setEventTime(eventTime);
// event id
- int value = ByteUtils.toInt(data, index);
+ int value = ByteUtil.toInt(data, index);
recordObj.setEventId(value);
index += INT_SIZE;
// event type
- value = ByteUtils.toInt(data, index);
+ value = ByteUtil.toInt(data, index);
recordObj.setEventType(value);
index += INT_SIZE;
// eventy code
- value = ByteUtils.toInt(data, index);
+ value = ByteUtil.toInt(data, index);
recordObj.setEventCode(value);
index += INT_SIZE;
- value = ByteUtils.toInt(data, index);
+ value = ByteUtil.toInt(data, index);
recordObj.setEventValue(value);
index += INT_SIZE;
// System.out.println("Sec : " + recordObj.getEventTime().getSec()
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class SceneData extends ProbeCommonData {
String sceneName = null;
formName = new String(temp);
index += length;
- formPointer = ByteUtils.toLong(data, index);
+ formPointer = ByteUtil.toLong(data, index);
index += LONG_SIZE;
length = LogDataUtils.getStringLength(index, data);
panelName = new String(temp);
index += length;
- panelPointer = ByteUtils.toLong(data, index);
+ panelPointer = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- transitionTime = ByteUtils.toInt(data, index);
+ transitionTime = ByteUtil.toInt(data, index);
index += INT_SIZE;
- userTransitionTime = ByteUtils.toInt(data, index);
+ userTransitionTime = ByteUtil.toInt(data, index);
}
public String getSceneName() {
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class ScreenShotData extends ProbeCommonData {
String imageFilePath = null;
imageFilePath = new String(temp);
index += length;
- orientation = ByteUtils.toInt(data, index);
+ orientation = ByteUtil.toInt(data, index);
}
public String getImageFilePath() {
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class SyncData extends ProbeCommonData {
long syncValue = 0;
public void makeData(byte[] data) {
super.makeData(data);
- syncValue = ByteUtils.toLong(data, index);
+ syncValue = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- syncType = ByteUtils.toInt(data, index);
+ syncType = ByteUtil.toInt(data, index);
index += INT_SIZE;
- apiType = ByteUtils.toInt(data, index);
+ apiType = ByteUtil.toInt(data, index);
}
public long getSyncValue() {
import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class SystemData extends LogData {
.getCpuCount();
int deviceCount = GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
.getDeviceCount();
- appCpuUsage = ByteUtils.toFloat(data, index);
+ appCpuUsage = ByteUtil.toFloat(data, index);
index += FLOAT_SIZE;
cpuFrequency = parseCpu(index, data);
cpuLoad = parseCpu(index, data);
index += (FLOAT_SIZE * coreCount);
- threadCount = ByteUtils.toInt(data, index);
+ threadCount = ByteUtil.toInt(data, index);
index += INT_SIZE;
threadLoad = parseLoad(index, data);
index += (threadCount * (INT_SIZE + FLOAT_SIZE));
- processCount = ByteUtils.toInt(data, index);
+ processCount = ByteUtil.toInt(data, index);
index += INT_SIZE;
processLoad = parseLoad(index, data);
index += (processCount * (INT_SIZE + FLOAT_SIZE));
- virtualMemory = ByteUtils.toInt(data, index);
+ virtualMemory = ByteUtil.toInt(data, index);
index += INT_SIZE;
- residentMemory = ByteUtils.toInt(data, index);
+ residentMemory = ByteUtil.toInt(data, index);
index += INT_SIZE;
- sharedMemory = ByteUtils.toInt(data, index);
+ sharedMemory = ByteUtil.toInt(data, index);
index += INT_SIZE;
- pssMemory = ByteUtils.toInt(data, index);
+ pssMemory = ByteUtil.toInt(data, index);
index += INT_SIZE;
- totalAllocSize = ByteUtils.toLong(data, index);
+ totalAllocSize = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- systemMemoryTotal = ByteUtils.toLong(data, index);
+ systemMemoryTotal = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- systemMemoryUsed = ByteUtils.toLong(data, index);
+ systemMemoryUsed = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- totalUsedDrive = ByteUtils.toInt(data, index);
+ totalUsedDrive = ByteUtil.toInt(data, index);
index += INT_SIZE;
- diskReadSize = ByteUtils.toInt(data, index);
+ diskReadSize = ByteUtil.toInt(data, index);
index += INT_SIZE;
- diskReadSectorCount = ByteUtils.toInt(data, index);
+ diskReadSectorCount = ByteUtil.toInt(data, index);
index += INT_SIZE;
- diskWriteSize = ByteUtils.toInt(data, index);
+ diskWriteSize = ByteUtil.toInt(data, index);
index += INT_SIZE;
- diskWrittenSectorCount = ByteUtils.toInt(data, index);
+ diskWrittenSectorCount = ByteUtil.toInt(data, index);
index += INT_SIZE;
- networkSendSize = ByteUtils.toInt(data, index);
+ networkSendSize = ByteUtil.toInt(data, index);
index += INT_SIZE;
- networkReceiveSize = ByteUtils.toInt(data, index);
+ networkReceiveSize = ByteUtil.toInt(data, index);
index += INT_SIZE;
- wifi = ByteUtils.toInt(data, index);
+ wifi = ByteUtil.toInt(data, index);
index += INT_SIZE;
- btStatus = ByteUtils.toInt(data, index);
+ btStatus = ByteUtil.toInt(data, index);
index += INT_SIZE;
- gpsStatus = ByteUtils.toInt(data, index);
+ gpsStatus = ByteUtil.toInt(data, index);
index += INT_SIZE;
- brightness = ByteUtils.toInt(data, index);
+ brightness = ByteUtil.toInt(data, index);
index += INT_SIZE;
- camera = ByteUtils.toInt(data, index);
+ camera = ByteUtil.toInt(data, index);
index += INT_SIZE;
- sound = ByteUtils.toInt(data, index);
+ sound = ByteUtil.toInt(data, index);
index += INT_SIZE;
- audio = ByteUtils.toInt(data, index);
+ audio = ByteUtil.toInt(data, index);
index += INT_SIZE;
- vibration = ByteUtils.toInt(data, index);
+ vibration = ByteUtil.toInt(data, index);
index += INT_SIZE;
- voltage = ByteUtils.toInt(data, index);
+ voltage = ByteUtil.toInt(data, index);
index += INT_SIZE;
- rssi = ByteUtils.toInt(data, index);
+ rssi = ByteUtil.toInt(data, index);
index += INT_SIZE;
- video = ByteUtils.toInt(data, index);
+ video = ByteUtil.toInt(data, index);
index += INT_SIZE;
- call = ByteUtils.toInt(data, index);
+ call = ByteUtil.toInt(data, index);
index += INT_SIZE;
- dnet = ByteUtils.toInt(data, index);
+ dnet = ByteUtil.toInt(data, index);
index += INT_SIZE;
- energyUsage = ByteUtils.toInt(data, index);
+ energyUsage = ByteUtil.toInt(data, index);
index += INT_SIZE;
deviceEnergyUsage = parseUsage(index, data);
private static String parseLoad(int start, byte[] payload) {
int pos = start;
int backPos = start - INT_SIZE;
- int count = ByteUtils.toInt(payload, backPos);
+ int count = ByteUtil.toInt(payload, backPos);
StringBuffer outBuf = new StringBuffer();
for (int ii = 0; ii < count; ii++) {
try {
- int tid = ByteUtils.toInt(payload, pos);
+ int tid = ByteUtil.toInt(payload, pos);
pos += INT_SIZE;
outBuf.append(tid).append(CommonConstants.COMMA);
- float f = ByteUtils.toFloat(payload, pos);
+ float f = ByteUtil.toFloat(payload, pos);
outBuf.append(f);
pos += FLOAT_SIZE;
if (ii + 1 != count) {
.getCpuCount();
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < coreCount; i++) {
- float value = ByteUtils.toFloat(payload, start);
+ float value = ByteUtil.toFloat(payload, start);
start += FLOAT_SIZE;
buffer.append(value);
if (i + 1 != coreCount) {
.getDeviceCount();
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < count; i++) {
- int value = ByteUtils.toInt(payload, start);
+ int value = ByteUtil.toInt(payload, start);
start += INT_SIZE;
buffer.append(value);
if (i + 1 != count) {
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class ThreadData extends ProbeCommonData {
long pThreadId = 0;
public void makeData(byte[] data) {
super.makeData(data);
- pThreadId = ByteUtils.toLong(data, index);
+ pThreadId = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- ospThreadId = ByteUtils.toLong(data, index);
+ ospThreadId = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- threadType = ByteUtils.toInt(data, index);
+ threadType = ByteUtil.toInt(data, index);
index += INT_SIZE;
- apiType = ByteUtils.toInt(data, index);
+ apiType = ByteUtil.toInt(data, index);
}
public long getPThreadId() {
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class UIEventData extends ProbeCommonData {
public void makeData(byte[] data) {
super.makeData(data);
- eventType = ByteUtils.toInt(data, index);
+ eventType = ByteUtil.toInt(data, index);
index += INT_SIZE;
- detailType = ByteUtils.toInt(data, index);
+ detailType = ByteUtil.toInt(data, index);
index += INT_SIZE;
- x = ByteUtils.toInt(data, index);
+ x = ByteUtil.toInt(data, index);
index += INT_SIZE;
- y = ByteUtils.toInt(data, index);
+ y = ByteUtil.toInt(data, index);
index += INT_SIZE;
- info1 = ByteUtils.getString(data, index);
- index += ByteUtils.getStringLength(data, index);
+ info1 = ByteUtil.getString(data, index);
+ index += ByteUtil.getStringLength(data, index);
- info2 = ByteUtils.toInt(data, index);
+ info2 = ByteUtil.toInt(data, index);
}
public int getEventType() {
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
+import org.tizen.dynamicanalyzer.util.ByteUtil;
public class UserFunctionData extends ProbeCommonData {
public void makeData(byte[] data) {
super.makeData(data);
- lowPc = ByteUtils.toLong(data, index);
+ lowPc = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- highPc = ByteUtils.toLong(data, index);
+ highPc = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- type = ByteUtils.toInt(data, index);
+ type = ByteUtil.toInt(data, index);
index += INT_SIZE;
- elapsedTime = ByteUtils.toLong(data, index);
+ elapsedTime = ByteUtil.toLong(data, index);
index += LONG_SIZE;
- pcAddr = ByteUtils.toLong(data, index);
+ pcAddr = ByteUtil.toLong(data, index);
}
public long getLowPc() {