[Title] process map change bug fixed
authorjooyoul_lee <jy.exe.lee@samsung.com>
Wed, 6 Nov 2013 01:20:50 +0000 (10:20 +0900)
committerjooyoul_lee <jy.exe.lee@samsung.com>
Wed, 6 Nov 2013 01:20:50 +0000 (10:20 +0900)
[Desc.]
[Issue]

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/channel/data/ProcessInfoPackage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java

index e53201a..884eeda 100644 (file)
@@ -67,9 +67,12 @@ public class ProcessInfoPackage {
 
                return (sec * 1000000 + nano / 1000);
        }
-       
-       public ProcessInfo getBaseProcessInfo()
-       {
-               return processSnapshots.get(0);
+
+       public ProcessInfo getLastProcessInfo() {
+               int size = processSnapshots.size();
+               if (size < 0) {
+                       return null;
+               }
+               return processSnapshots.get(size - 1);
        }
 }
index 0e25f73..25270a2 100755 (executable)
@@ -284,16 +284,16 @@ public class MessageParser {
                        // bug!!!
                        System.out.println("bug occurred!!");
                }
-               ProcessInfo baseProcessInfo = pInfoPack.getBaseProcessInfo();
+               ProcessInfo lastProcessInfo = pInfoPack.getLastProcessInfo();
                ProcessInfo pInfo = new ProcessInfo();
                pInfo.setPid(pid);
-               pInfo.setPpid(baseProcessInfo.getPpid());
-               pInfo.setStartTime(baseProcessInfo.getStartTime());
-               pInfo.setMainTargetBinaryPath(baseProcessInfo.getMainTargetBinaryPath());
-               pInfo.getLibObjs().addAll(baseProcessInfo.getLibObjs());
-               pInfo.getLibObjHash().putAll(baseProcessInfo.getLibObjHash());
-               pInfo.setLowestAddress(baseProcessInfo.getLowestAddress());
-               pInfo.setHighestAddress(baseProcessInfo.getHighestAddress());
+               pInfo.setPpid(lastProcessInfo.getPpid());
+               pInfo.setStartTime(changeTime);
+               pInfo.setMainTargetBinaryPath(lastProcessInfo.getMainTargetBinaryPath());
+               pInfo.getLibObjs().addAll(lastProcessInfo.getLibObjs());
+               pInfo.getLibObjHash().putAll(lastProcessInfo.getLibObjHash());
+               pInfo.setLowestAddress(lastProcessInfo.getLowestAddress());
+               pInfo.setHighestAddress(lastProcessInfo.getHighestAddress());
 
                pInfoPack.getProcessSnapshots().add(pInfo);
 
@@ -310,15 +310,15 @@ public class MessageParser {
                        pInfo.getLibObjHash().put(libPath, libObj);
 
                        // log
-                       System.out.println("MAP CHANGED  MAP  "
+                       System.out.println("MAP CHANGED    ADD  "
                                        + AnalyzerUtil.toHexdecimal(id) + "  libPath : " + libPath
                                        + "    low : " + AnalyzerUtil.toHexdecimal(lowAddr)
-                                       + "    high: " + AnalyzerUtil.toHexdecimal(highAddr));
+                                       + "    high: " + AnalyzerUtil.toHexdecimal(highAddr) + "  chage time : " + changeTime.getSaveFormat() + "  total count : " + pInfo.getLibObjs().size());
                } else {
-                       System.out.println("MAP CHANGED UNMAP  "
+                       System.out.println("MAP CHANGED REMOVE  "
                                        + AnalyzerUtil.toHexdecimal(id) + "  libPath : " + libPath
                                        + "  low : " + AnalyzerUtil.toHexdecimal(lowAddr)
-                                       + "    high: " + AnalyzerUtil.toHexdecimal(highAddr));
+                                       + "    high: " + AnalyzerUtil.toHexdecimal(highAddr) + "  chage time : " + changeTime.getSaveFormat()+ "  total count : " + pInfo.getDepLibCount());
 
                        int size = libObjs.size();
                        for (int i = 0; i < size; i++) {