PROTOCOL: refactor debug print routine of data channel logs 71/39871/2
authorgreatim <jaewon81.lim@samsung.com>
Mon, 25 May 2015 13:40:09 +0000 (22:40 +0900)
committerJaewon Lim <jaewon81.lim@samsung.com>
Tue, 2 Jun 2015 15:46:57 +0000 (08:46 -0700)
refactor debug print routine of data channel logs
parse logs (process info, memory map, ...) in data model instead of MessageParser

Change-Id: Iad39372513c98b0b805a9c36b93707118af687de
Signed-off-by: greatim <jaewon81.lim@samsung.com>
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/CommunicatorUtils.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/ProcessMemoryMap.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/DebugLog.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/Protocol.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/LogParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/MemoryMapData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/ProcessAddInfoData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/ProcessInfoData.java

index 200efe6..f986663 100755 (executable)
@@ -178,6 +178,7 @@ public class CommunicatorUtils {
                        } catch (TimeoutException e) {
                                Logger.exception(e);
                        } catch (SdbCommandRejectedException e) {
+                               // unforward is not supported in 2.3 rev1
                                Logger.exception(e);
                        } catch (IOException e) {
                                Logger.exception(e);
index ddad4a0..855b62c 100644 (file)
@@ -54,7 +54,7 @@ public class ProcessMemoryMap {
        public long getCapturedTime() {
                return capturedTime;
        }
-       
+
        public void setCapturedTime(long time) {
                capturedTime = time;
        }
@@ -72,15 +72,24 @@ public class ProcessMemoryMap {
                long lowaddr = libobj.getLowestAddress();
                int binid = libobj.getBinaryID();
 
+               LibraryObject objByID = null;
+
+               synchronized (binaryByBinaryID) {
+                       objByID = binaryByBinaryID.put(Integer.valueOf(binid), libobj);
+               }
+
                synchronized (binaryByAddress) {
+                       if (objByID != null) {
+                               binaryByAddress.remove(Long.valueOf(objByID.getLowestAddress()));
+                       }
+
                        binaryByAddress.put(Long.valueOf(lowaddr), libobj);
                }
-               synchronized (binaryByBinaryID) {
-                       LibraryObject o = binaryByBinaryID.put(Integer.valueOf(binid), libobj);
-                       if(o == null) 
-                               return true;
-                       else
-                               return false;
+
+               if (objByID != null) {
+                       return false;
+               } else {
+                       return true;
                }
        }
 
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/DebugLog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/DebugLog.java
new file mode 100644 (file)
index 0000000..0c078f3
--- /dev/null
@@ -0,0 +1,74 @@
+package org.tizen.dynamicanalyzer.protocol;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import org.tizen.dynamicanalyzer.common.path.PathManager;
+import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.Logger;
+
+public class DebugLog {
+       private static boolean PRINT_DATA_LOG_TOFILE = true;
+
+       // for debugging
+       private static PrintWriter dataChannelWriter = null;
+
+       public static void openDataChannelWriter() {
+               dataChannelWriter = null;
+
+               if (PRINT_DATA_LOG_TOFILE) {
+                       File logPath = new File(PathManager.DA_DEBUG_DATA_CHANNEL_LOG_FILE);
+                       if (logPath.exists()) {
+                               logPath.delete();
+                       }
+
+                       try {
+                               dataChannelWriter = new PrintWriter(new BufferedWriter(new FileWriter(logPath)),
+                                               true);
+                       } catch (IOException e) {
+                               Logger.exception(e);
+                       }
+               }
+       }
+
+       public static void closeDataChannelWriter() {
+               if (dataChannelWriter != null) {
+                       CommonUtil.tryClose(dataChannelWriter);
+                       dataChannelWriter = null;
+               }
+       }
+
+       public static void printData(int indent, String format, Object... objects) {
+               if (dataChannelWriter != null) {
+                       switch (indent) {
+                       case 0:
+                               dataChannelWriter.printf(format, objects);
+                               break;
+                       case 1:
+                               dataChannelWriter.printf("\t" + format, objects);
+                               break;
+                       case 2:
+                               dataChannelWriter.printf("\t\t" + format, objects);
+                               break;
+                       default: // max indent is 2
+                               dataChannelWriter.printf("\t\t" + format, objects);
+                               break;
+                       }
+               }
+       }
+
+       public static void printData0(String format, Object... objects) {
+               printData(0, format, objects);
+       }
+
+       public static void printData1(String format, Object... objects) {
+               printData(1, format, objects);
+       }
+
+       public static void printData2(String format, Object... objects) {
+               printData(2, format, objects);
+       }
+}
index 6cdb884..d0d767f 100644 (file)
  */
 package org.tizen.dynamicanalyzer.protocol;
 
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.protocol.p30.ProtocolConfig30;
 import org.tizen.dynamicanalyzer.protocol.p40.ProtocolConfig40;
@@ -35,6 +39,46 @@ public class Protocol {
        // version names
        private static final String[] versions = { "3.0", "4.0" };
 
+       // data channel message name map for printing debug info
+       private static final Map<Integer, String> dataMsgNameMap;
+
+       static {
+               Map<Integer, String> tempMap = new HashMap<Integer, String>();
+
+               // data message id
+               tempMap.put(0x0001, "MSG_DATA_PROCESS_INFO");
+               tempMap.put(0x0002, "MSG_DATA_TERMINATE");
+               tempMap.put(0x0003, "MSG_DATA_ERROR");
+               tempMap.put(0x0004, "MSG_DATA_SAMPLE");
+               tempMap.put(0x0005, "MSG_DATA_SYSTEM");
+               tempMap.put(0x0006, "MSG_DATA_IMAGE");
+               tempMap.put(0x0007, "MSG_DATA_RECORD");
+               tempMap.put(0x0008, "MSG_FUNCTION_ENTRY");
+               tempMap.put(0x0009, "MSG_FUNCTION_EXIT");
+               tempMap.put(0x0010, "MSG_CONTEXT_SWITCH_ENTRY");
+               tempMap.put(0x0011, "MSG_CONTEXT_SWITCH_EXIT");
+               tempMap.put(0x0012, "MSG_PROCESS_MAP");
+               tempMap.put(0x0013, "MSG_PROCESS_UNMAP");
+               tempMap.put(0x0014, "MSG_PROCESS_COMM");
+
+               // data probe message id
+               tempMap.put(0x0101, "MSG_PROBE_MIN");
+               tempMap.put(0x0101, "MSG_PROBE_MEMORY");
+               tempMap.put(0x0102, "MSG_PROBE_UICONTROL");
+               tempMap.put(0x0103, "MSG_PROBE_UIEVENT");
+               tempMap.put(0x0104, "MSG_PROBE_FILE");
+               tempMap.put(0x0105, "MSG_PROBE_LIFECYCLE");
+               tempMap.put(0x0106, "MSG_PROBE_SCREENSHOT");
+               tempMap.put(0x0107, "MSG_PROBE_SCENE");
+               tempMap.put(0x0108, "MSG_PROBE_THREAD");
+               tempMap.put(0x0109, "MSG_PROBE_CUSTOM");
+               tempMap.put(0x0110, "MSG_PROBE_SYNC");
+               tempMap.put(0x0111, "MSG_PROBE_NETWORK");
+               tempMap.put(0x0112, "MSG_PROBE_GLES20");
+
+               dataMsgNameMap = Collections.unmodifiableMap(tempMap);
+       }
+
        // convert version string to specific integer value equal or greater than zero
        // return negative value if version string is not found
        public static int getVersionValue(String version) {
@@ -67,7 +111,16 @@ public class Protocol {
                } else { // unknown protocol
                        throw new UnknownProtocolException();
                }
-               
+
                return configs;
        }
+
+       public static String getDataMessageName(int msgid) {
+               String name = dataMsgNameMap.get(Integer.valueOf(msgid));
+               if (name == null) {
+                       return CommonConstants.EMPTY;
+               } else {
+                       return name;
+               }
+       }
 }
index f6fd1f9..eecba4f 100755 (executable)
@@ -35,7 +35,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.Global;
 import org.tizen.dynamicanalyzer.common.SymbolManager;
 import org.tizen.dynamicanalyzer.communicator.DeviceInfo;
@@ -169,22 +168,14 @@ public class LogParser extends DataThread<List<LogData>> {
                        int id = log.getMsgID();
                        boolean ret;
                        switch (id) {
-                       case ProtocolConstants.MSG_DATA_SAMPLE:
-                               if (!AnalyzerManager.isProcessInfoArrived()) {
-                                       break;
-                               }
-                               packLog(log, logPack);
-                               break;
                        case ProtocolConstants.MSG_FUNCTION_ENTRY:
                        case ProtocolConstants.MSG_FUNCTION_EXIT:
-                               if (!AnalyzerManager.isProcessInfoArrived()) {
-                                       break;
-                               }
                                ret = processFunctionData((ProfileData) log);
                                if (ret) {
                                        packLog(log, logPack);
                                }
                                break;
+                       case ProtocolConstants.MSG_DATA_SAMPLE:
                        case ProtocolConstants.MSG_DATA_SYSTEM:
                        case ProtocolConstants.MSG_DATA_RECORD:
                        case ProtocolConstants.MSG_CONTEXT_SWITCH_ENTRY:
index b57818c..092ae19 100755 (executable)
  */
 package org.tizen.dynamicanalyzer.swap.logparser;
 
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Timer;
@@ -41,25 +36,24 @@ import java.util.concurrent.locks.ReentrantLock;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.common.path.PathManager;
 import org.tizen.dynamicanalyzer.control.DataThread;
 import org.tizen.dynamicanalyzer.project.BinaryInfo;
 import org.tizen.dynamicanalyzer.project.LibraryObject;
 import org.tizen.dynamicanalyzer.project.ProcessInformation;
 import org.tizen.dynamicanalyzer.project.ProcessMemoryMap;
 import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.protocol.DebugLog;
 import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
-import org.tizen.dynamicanalyzer.swap.model.DATime;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.swap.model.data.MemoryMapData;
+import org.tizen.dynamicanalyzer.swap.model.data.ProcessAddInfoData;
+import org.tizen.dynamicanalyzer.swap.model.data.ProcessInfoData;
 import org.tizen.dynamicanalyzer.ui.thread.data.ThreadDataManager;
-import org.tizen.dynamicanalyzer.util.CommonUtil;
 import org.tizen.dynamicanalyzer.util.Logger;
 
 public class MessageParser extends DataThread<LogData> {
        private static MessageParser instance = new MessageParser();
 
-       private static boolean PRINT_DATA_LOG_TOFILE = false;
-
        /* Message Buffer max length */
        private static final int MSG_BUFFER_MAX = 5000;
        private static final int MSG_BUFFER_TIMER_DELAY = 5;
@@ -144,7 +138,7 @@ public class MessageParser extends DataThread<LogData> {
 
        @Override
        public void run() {
-               PrintWriter printWriter = getDebugWriter();
+               DebugLog.openDataChannelWriter();
                Thread curThread = Thread.currentThread();
 
                try {
@@ -168,8 +162,6 @@ public class MessageParser extends DataThread<LogData> {
                                        break;
                                }
 
-                               printLog(printWriter, log);
-
                                processMessage(log);
                        }
                } finally {
@@ -177,58 +169,32 @@ public class MessageParser extends DataThread<LogData> {
                        sendDataToLogParser();
                        pushEOQ();
 
-                       if (printWriter != null) {
-                               CommonUtil.tryClose(printWriter);
-                       }
-               }
-       }
-
-       private PrintWriter getDebugWriter() {
-               PrintWriter printWriter = null;
-
-               if (PRINT_DATA_LOG_TOFILE) {
-                       File logPath = new File(PathManager.DA_DEBUG_DATA_CHANNEL_LOG_FILE);
-                       if (logPath.exists()) {
-                               logPath.delete();
-                       }
-
-                       try {
-                               printWriter = new PrintWriter(new BufferedWriter(new FileWriter(logPath)), true);
-                       } catch (IOException e) {
-                               Logger.exception(e);
-                       }
-               }
-
-               return printWriter;
-       }
-
-       private void printLog(PrintWriter printWriter, LogData log) {
-               if (printWriter != null) {
-                       int payloadSize = log.getPayloadSize();
-                       byte[] payload = log.getPayload();
-                       printWriter.printf("%d %d %d %d :", log.getMsgID(), log.getSeq(), log.getTime(),
-                                       payloadSize);
-                       for (int i = 0; i < payloadSize; i++)
-                               printWriter.printf("%02x ", payload[i]);
-                       printWriter.printf("\n");
+                       DebugLog.closeDataChannelWriter();
                }
        }
 
        // return false if message id is unknown
        private boolean processMessage(LogData log) {
-               boolean bret = true;
+               boolean bret = log.parsePublic(Global.getProject().getProfilingStartTime());
                int id = log.getMsgID();
+
                switch (id) {
                case ProtocolConstants.MSG_DATA_PROCESS_INFO:
                        // setting process info
-                       processProcessInfo(log);
+                       if (bret) {
+                               processProcessInfo(log);
+                       }
                        break;
                case ProtocolConstants.MSG_PROCESS_MAP:
                case ProtocolConstants.MSG_PROCESS_UNMAP:
-                       memoryMapChanged(log);
+                       if (bret) {
+                               memoryMapChanged(log);
+                       }
                        break;
                case ProtocolConstants.MSG_DATA_TERMINATE:
-                       processTerminate();
+                       if (bret) {
+                               processTerminate();
+                       }
                        break;
                case ProtocolConstants.MSG_DATA_ERROR:
                        // process error message
@@ -240,24 +206,22 @@ public class MessageParser extends DataThread<LogData> {
                case ProtocolConstants.MSG_CONTEXT_SWITCH_ENTRY:
                case ProtocolConstants.MSG_CONTEXT_SWITCH_EXIT:
                case ProtocolConstants.MSG_DATA_RECORD:
-                       if (AnalyzerManager.isProcessInfoArrived()) {
-                               if (log.parsePublic(Global.getProject().getProfilingStartTime())) {
-                                       sendBuffer.add(log);
-                               }
+                       if (AnalyzerManager.isProcessInfoArrived() && bret) {
+                               sendBuffer.add(log);
                        }
                        break;
                case ProtocolConstants.MSG_PROCESS_COMM:
-                       processAddInfo(log);
+                       if (bret) {
+                               processAddInfo(log);
+                       }
                        break;
                case ProtocolConstants.MSG_DATA_IMAGE:
                        // process image message
                        break;
                default:
                        if (id >= ProtocolConstants.MSG_PROBE_MIN) { // MSG_PROBE
-                               if (AnalyzerManager.isProcessInfoArrived()) {
-                                       if (log.parsePublic(Global.getProject().getProfilingStartTime())) {
-                                               sendBuffer.add(log);
-                                       }
+                               if (AnalyzerManager.isProcessInfoArrived() && bret) {
+                                       sendBuffer.add(log);
                                }
                        } else {
                                // unknown message id
@@ -273,72 +237,53 @@ public class MessageParser extends DataThread<LogData> {
                return bret;
        }
 
-       private void processProcessInfo(LogData log) {
+       private void processProcessInfo(LogData plog) {
                Project project = Global.getProject();
+               ProcessInfoData log = (ProcessInfoData) plog;
 
-               int pid = log.getInt();
-               String commandLineName = log.getString();
-               int ppid = log.getInt();
-               int sec = log.getInt();
-               int nano = log.getInt();
-               long lowAddr = log.getLong();
-               long highAddr = log.getLong();
-               String targetBinaryPath = log.getString();
-               int dependentLibCount = log.getInt();
-
-               DATime capturedTime = new DATime(sec, nano);
-               DATime profileStartTime = project.getProfilingStartTime();
-               DATime subTime = capturedTime.subtract(profileStartTime);
+               int pid = log.getPid();
+               long starttime = log.getStartTime();
 
+               // get process info or make one if necessary
                ProcessInformation pinfo = project.getProcessInformation(pid);
                if (null == pinfo) {
                        pinfo = new ProcessInformation();
                        pinfo.setPid(pid);
-                       pinfo.setPpid(ppid);
-                       pinfo.setStartTime(subTime.getLongTime());
-                       pinfo.setProcessName(commandLineName);
+                       pinfo.setPpid(log.getPpid());
+                       pinfo.setStartTime(starttime);
+                       pinfo.setProcessName(log.getCmdname());
                        project.putProcessInformation(pinfo);
 
                        pinfo.setDropLog(true);
                }
                pinfo.setMappingState(true);
 
-               ProcessMemoryMap pMap = new ProcessMemoryMap(pinfo.getPid(), subTime.getLongTime());
+               // make process memory map of the moment
+               ProcessMemoryMap pMap = new ProcessMemoryMap(pinfo.getPid(), starttime);
                pinfo.addProcessMemoryMap(pMap);
 
+               List<LibraryObject> libObjects = log.getLibObjects();
+               int dependentLibCount = libObjects.size();
                for (int i = 0; i < dependentLibCount; i++) {
-                       long lowestAddr = log.getLong();
-                       long highestAddr = log.getLong();
-                       String libPath = log.getString();
-
-                       LibraryObject libObj = new LibraryObject(project.getDeviceStatusInfo()
-                                       .getBinaryInfo(libPath).getID(), lowestAddr, highestAddr);
-
-                       pMap.addLibraryMap(libObj);
+                       pMap.addLibraryMap(libObjects.get(i));
                }
 
-               Logger.debug("process info start time : " + capturedTime.getSec() + "  "
-                               + capturedTime.getNano());
-
+               // set main binary of process
                pMap.setMainBinary(new LibraryObject(project.getDeviceStatusInfo()
-                               .getBinaryInfo(targetBinaryPath).getID(), lowAddr, highAddr));
+                               .getBinaryInfo(log.getBinaryPath()).getID(), log.getLowAddr(), log.getHighAddr()));
 
                AnalyzerManager.setProcessInfoArrived(true);
 
+               // TODO : move this line to ThreadDataManager
                // make main thread in thread chart
                ThreadDataManager.getInstance().getThreadDataMaker().createMainThreadItem(pid);
        }
 
-       private void memoryMapChanged(LogData log) {
+       private void memoryMapChanged(LogData plog) {
                Project project = Global.getProject();
+               MemoryMapData log = (MemoryMapData) plog;
 
-               int msgID = log.getMsgID();
-
-               /** parsing */
-               int pid = log.getInt();
-               long lowAddr = log.getLong();
-               long highAddr = log.getLong();
-
+               int pid = log.getPid();
                ProcessInformation pinfo = project.getProcessInformation(pid);
                if (null == pinfo) {
                        // bug!!!
@@ -348,9 +293,13 @@ public class MessageParser extends DataThread<LogData> {
 
                ProcessMemoryMap lastMap = pinfo.getLastProcessMemoryMap();
                if (lastMap != null) {
+                       int msgID = log.getMsgID();
+                       long lowAddr = log.getLowAddr();
+                       long highAddr = log.getHighAddr();
+
                        if (msgID == ProtocolConstants.MSG_PROCESS_MAP) {
                                // update to last memory map
-                               String libPath = log.getString();
+                               String libPath = log.getLibPath();
 
                                BinaryInfo bininfo = project.getDeviceStatusInfo().getBinaryInfo(libPath);
                                LibraryObject libObj = new LibraryObject(bininfo.getID(), lowAddr, highAddr);
@@ -360,14 +309,9 @@ public class MessageParser extends DataThread<LogData> {
 
                                pinfo.setMappingState(true);
                        } else {
-                               DATime changeTime = new DATime(log.getSec(), log.getNano());
-                               DATime profileStartTime = project.getProfilingStartTime();
-                               DATime subTime = changeTime.subtract(profileStartTime);
-
                                if (pinfo.isMapping()) {
                                        // make new memory map
-                                       ProcessMemoryMap newMap = new ProcessMemoryMap(pinfo.getPid(),
-                                                       subTime.getLongTime());
+                                       ProcessMemoryMap newMap = new ProcessMemoryMap(pinfo.getPid(), log.getTime());
                                        pinfo.addProcessMemoryMap(newMap);
                                        newMap.copy(lastMap);
 
@@ -375,7 +319,7 @@ public class MessageParser extends DataThread<LogData> {
                                        newMap.removeLibrary(lowAddr, highAddr);
                                } else {
                                        // update captured time of last memory map
-                                       pinfo.updateProcessMemoryMap(lastMap, subTime.getLongTime());
+                                       pinfo.updateProcessMemoryMap(lastMap, log.getTime());
 
                                        // remove from map
                                        lastMap.removeLibrary(lowAddr, highAddr);
@@ -386,16 +330,15 @@ public class MessageParser extends DataThread<LogData> {
                }
        }
 
-       private void processAddInfo(LogData log) {
+       private void processAddInfo(LogData plog) {
                // process command line name is changed (/proc/<pid>/cmdline)
                Project project = Global.getProject();
+               ProcessAddInfoData log = (ProcessAddInfoData) plog;
 
-               int pid = log.getInt();
-               String name = log.getString();
-
+               int pid = log.getPid();
                ProcessInformation process = project.getProcessInformation(pid);
                if (null != process) {
-                       process.setProcessName(name);
+                       process.setProcessName(log.getCmdname());
                }
        }
 
index b3953f7..483233b 100644 (file)
@@ -27,6 +27,8 @@
 package org.tizen.dynamicanalyzer.swap.model.data;
 
 import org.tizen.dynamicanalyzer.communicator.ProtocolParser;
+import org.tizen.dynamicanalyzer.protocol.DebugLog;
+import org.tizen.dynamicanalyzer.protocol.Protocol;
 import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
 import org.tizen.dynamicanalyzer.swap.model.DATime;
 import org.tizen.dynamicanalyzer.util.ByteUtil;
@@ -85,6 +87,11 @@ public class LogData extends ProtocolParser implements Cloneable {
        }
 
        protected boolean parse(DATime startTime) {
+               // print message header
+               DebugLog.printData0("%s seq(%d) sec(%d) nano(%d) size(%d)\n",
+                               Protocol.getDataMessageName(getMsgID()), getSeq(), getSec(), getNano(),
+                               getPayloadSize());
+
                return true;
        }
 
index 6409317..8c98b01 100644 (file)
@@ -25,6 +25,7 @@
  */
 package org.tizen.dynamicanalyzer.swap.model.data;
 
+import org.tizen.dynamicanalyzer.protocol.DebugLog;
 import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
 import org.tizen.dynamicanalyzer.swap.model.DATime;
 
@@ -51,15 +52,20 @@ public class MemoryMapData extends LogData {
                lowAddr = getLong();
                highAddr = getLong();
 
+               DebugLog.printData1("pid(%d) lowAddr(%x) highAddr(%x) ", pid, lowAddr, highAddr);
+
                int msgid = getMsgID();
                if (msgid == ProtocolConstants.MSG_PROCESS_MAP) {
                        libPath = getString();
+                       DebugLog.printData0("libPath(%s)", libPath);
                }
+               DebugLog.printData0("\n");
                // end of protocol 3.0
 
                return true;
        }
 
+       @Override
        public int getPid() {
                return pid;
        }
index 0f16f22..dbb3a3f 100644 (file)
@@ -25,6 +25,7 @@
  */
 package org.tizen.dynamicanalyzer.swap.model.data;
 
+import org.tizen.dynamicanalyzer.protocol.DebugLog;
 import org.tizen.dynamicanalyzer.swap.model.DATime;
 
 public class ProcessAddInfoData extends LogData {
@@ -46,11 +47,14 @@ public class ProcessAddInfoData extends LogData {
                // start of protocol 3.0
                pid = getInt();
                cmdname = getString();
+
+               DebugLog.printData1("pid(%d) process(%s)\n", pid, cmdname);
                // end of protocol 3.0
 
                return true;
        }
 
+       @Override
        public int getPid() {
                return pid;
        }
index 2f4dc0d..b5e3e00 100644 (file)
@@ -32,6 +32,7 @@ import java.util.List;
 import org.tizen.dynamicanalyzer.common.Global;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.project.LibraryObject;
+import org.tizen.dynamicanalyzer.protocol.DebugLog;
 import org.tizen.dynamicanalyzer.swap.model.DATime;
 
 public class ProcessInfoData extends LogData {
@@ -66,11 +67,20 @@ public class ProcessInfoData extends LogData {
                highAddr = getLong();
                binaryPath = getString();
                int dependentLibCount = getInt();
+
+               DebugLog.printData1("pid(%d) cmd(%s) ppid(%d) sec(%d) nano(%d) ", pid, cmdname, ppid,
+                               second, nanosecond);
+               DebugLog.printData0("lowAddr(%x) highAddr(%x) path(%s) libcount(%d)\n", lowAddr, highAddr,
+                               binaryPath, dependentLibCount);
+
                for (int i = 0; i < dependentLibCount; i++) {
                        long lowestAddr = getLong();
                        long highestAddr = getLong();
                        String libPath = getString();
 
+                       DebugLog.printData2("lowAddr(%x) highAddr(%x) libPath(%s)\n", lowestAddr, highestAddr,
+                                       libPath);
+
                        LibraryObject libObj = new LibraryObject(Global.getProject().getDeviceStatusInfo()
                                        .getBinaryInfo(libPath).getID(), lowestAddr, highestAddr);
 
@@ -86,6 +96,7 @@ public class ProcessInfoData extends LogData {
                return true;
        }
 
+       @Override
        public int getPid() {
                return pid;
        }