During parsing LogData from target, if wrong data was found, then print error msg and drop the LogData.
Fix typo.
Change-Id: Iac5121378cccc44aee5182d175bc6951d26b1791
Signed-off-by: woojin <woojin2.jung@samsung.com>
return processCount;
}
- public static synchronized void increseProcessCount() {
+ public static synchronized void increaseProcessCount() {
processCount++;
}
switch (id) {
case DataChannelConstants.MSG_DATA_PROCESS_INFO:
// setting process info
- AnalyzerManager.increseProcessCount();
+ AnalyzerManager.increaseProcessCount();
processProcessInfo(data);
break;
case DataChannelConstants.MSG_PROCESS_MAP:
return log;
}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
index = MessageParser.MSG_HEADER_SIZE;
index += INT_SIZE;
cpuNum = ByteUtil.toInt(data, index);
index += INT_SIZE;
+
+ return true;
}
public long getPcAddr() {
public ControlData() {
}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
int length = LogDataUtils.getStringLength(index, data);
index += length;
childPointer = ByteUtil.toLong(data, index);
+
+ return true;
}
public String getParentName() {
public CustomData(){}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
handle = ByteUtil.toInt(data, index);
index += INT_SIZE;
value = ByteUtil.toDouble(data, index);
+
+ return true;
}
public int getHandle() {
public FileData() {
}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
size = ByteUtil.toLong(data, index);
index += LONG_SIZE;
filePath = LogDataUtils.getString(index, data);
+
+ return true;
}
@Override
String contextValue = "";
@Override
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
glCurrentContextName = ByteUtil.toLong(data, index);
index += CommonConstants.LONG_SIZE;
byte[] temp = new byte[length];
System.arraycopy(data, index, temp, 0, length);
contextValue = new String(temp);
+
+ return true;
}
public long getCurrentContextName() {
return log;
}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
isSWAP = DACommunicator.isSWAPVersion();
id = ByteUtil.toInt(data, index);
}
index += INT_SIZE; // payload length field offset
+
+ return true;
}
public int getKey() {
}
public static LogData createInstance(byte[] data) {
+ boolean result;
int id = ByteUtil.toInt(data, 0);
LogData output = null;
default:
return null;
}
- output.makeData(data);
- return output;
+ result = output.makeData(data);
+ if (result == true) {
+ return output;
+ } else { // error occurred during parse LogData
+ return null;
+ }
}
public static LogData createInstance(ResultSet rs) throws SQLException {
public MemoryData() {
}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
size = ByteUtil.toInt(data, index);
index += INT_SIZE;
address = ByteUtil.toLong(data, index);
+
+ return true;
}
public long getSize() {
public NetworkData() {
}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
objectAddress = ByteUtil.toLong(data, index);
if (messageSize > 0) {
packetMessage = LogDataUtils.getString(index, data);
}
+
+ return true;
}
public static String intToIp(int integerIP) {
}
@Override
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
index = MessageParser.MSG_HEADER_SIZE;
}
// System.out.println("lib name : " + libName);
}
+
+ return true;
}
public int getApiId() {
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
import org.tizen.dynamicanalyzer.util.ByteUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class ProfileData extends LogData {
-
+ private static final DALogger DA_LOG = DALogger.getInstance();
public static int logCount = 0;
long pcAddr = 0; // profiling common
long callerPcAddr = 0; // function entry specific
return log;
}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
switch (id) {
case MSG_FUNCTION_ENTRY:
ProcessInfoPackage processInfoPkg = AnalyzerManager.getProject()
.getProcessInfoPackage(pid);
+ if (null == processInfoPkg) {
+ DA_LOG.error("ProfileData of type: " + id + " is from wrong process: " + pid + "\n");
+ return false;
+ }
+ //TODO: handling negative time value in LogData.makeData
if (time > 0) {
ProcessInfo processInfo = processInfoPkg.getProcessInfo(time);
BinaryInfo binInfo = processInfo.getTargetBinary(pcAddr);
}
// System.out.println("plib name : " + libName);
}
+
+ return true;
}
public long getPcAddr() {
public ReplayData() {
}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
// super.makeData(data);
isSWAP = DACommunicator.isSWAPVersion();
getRecordEvent().add(recordObj);
}
+
+ return true;
}
public int getObjectCount() {
public SceneData(){}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
int length = LogDataUtils.getStringLength(index, data);
index += INT_SIZE;
userTransitionTime = ByteUtil.toInt(data, index);
+
+ return true;
}
public String getSceneName() {
int orientation = 0;
public ScreenShotData(){}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
imageFilePath = ByteUtil.getString(data, index);
index += ByteUtil.getStringLength(data, index);
orientation = ByteUtil.toInt(data, index);
+
+ return true;
}
public String getImageFilePath() {
public SyncData(){}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
syncValue = ByteUtil.toLong(data, index);
index += INT_SIZE;
apiType = ByteUtil.toInt(data, index);
+
+ return true;
}
public long getSyncValue() {
public SystemData() {
}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
// index = MessageParser.MSG_HEADER_SIZE;
int coreCount = AnalyzerManager.getProject().getDeviceStatusInfo()
applicationEnergyUsage = parseUsage(index, data);
index += (INT_SIZE * deviceCount);
-
+
+ return true;
}
private static String parseLoad(int start, byte[] payload) {
public ThreadData(){}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
pThreadId = ByteUtil.toLong(data, index);
index += INT_SIZE;
className = ByteUtil.getString(data, index);
+
+ return true;
}
public long getPThreadId() {
public UIEventData(){}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
eventType = ByteUtil.toInt(data, index);
index += ByteUtil.getStringLength(data, index);
info2 = ByteUtil.toInt(data, index);
+
+ return true;
}
public int getEventType() {
}
- public void makeData(byte[] data) {
+ public boolean makeData(byte[] data) {
super.makeData(data);
lowPc = ByteUtil.toLong(data, index);
index += LONG_SIZE;
index += LONG_SIZE;
pcAddr = ByteUtil.toLong(data, index);
+
+ return true;
}
public long getLowPc() {
+* 2.1.41
+- bug fix in communicator for windows, macos
+- drop LogData when it has corrupted data
+== woojin jung <woojin2.jung@samsung.com> 2014-07-07
* 2.1.40
- Source link support for CoreApp
- Remove apps within one package
Source:dynamic-analyzer
-Version:2.1.40
+Version:2.1.41
Maintainer:Jaewon Lim <jaewon81.lim@samsung.com>, Juyoung Kim <j0.kim@samsung.com>
Package:dynamic-analyzer-product