[Title] profile data format fixed
authorjooyoul_lee <jy.exe.lee@samsung.com>
Fri, 1 Nov 2013 07:58:44 +0000 (16:58 +0900)
committerjooyoul_lee <jy.exe.lee@samsung.com>
Fri, 1 Nov 2013 07:58:44 +0000 (16:58 +0900)
[Desc.]
[Issue]

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/ProfileData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ProfilingLogFormat.java

index c41ba9e..e4fe826 100755 (executable)
@@ -57,9 +57,9 @@ import org.tizen.sdblib.service.SyncResult;
 public class SWAPLogParser implements Runnable {
        private final String OSP_MAIN = "OspMain"; //$NON-NLS-1$
        private static Thread logParser = null;
-// default false, turn on when Tizen C++ app   
-//     private static boolean dropCallTraceLog = true;
-       private static boolean dropCallTraceLog = false;        
+       // default false, turn on when Tizen C++ app
+       // private static boolean dropCallTraceLog = true;
+       private static boolean dropCallTraceLog = false;
        private static LogQueue logQueue = null;
 
        private int SMALL_IMG_WIDTH = 40;
@@ -88,8 +88,8 @@ public class SWAPLogParser implements Runnable {
 
        public static void startLogParser() {
                getLogQueue().clear();
-//             why here?
-//             dropCallTraceLog = true;
+               // why here?
+               // dropCallTraceLog = true;
                if (null == logParser || !logParser.isAlive()) {
                        logParser = new Thread(null, new SWAPLogParser(),
                                        AnalyzerConstants.LOG_QUEUE_OBSERVING_THREAD);
@@ -172,7 +172,7 @@ public class SWAPLogParser implements Runnable {
                                if (!AnalyzerManager.isProcessInfoArrived()) {
                                        continue;
                                }
-                               
+
                                if (id != DataChannelConstants.MSG_DATA_SAMPLE) {
                                        ProfileData pData = (ProfileData) log;
                                        String apiName = pData.getApiName();
@@ -181,13 +181,13 @@ public class SWAPLogParser implements Runnable {
                                                // setFuncName(pData);
                                                apiName = AnalyzerUtil.getFuncName(pData);
                                                if (apiName.equals("<unknown function>")) {
-// necessary?                          pData.setApiName(apiName);
+                                                       // necessary? pData.setApiName(apiName);
                                                        continue;
                                                } else {
                                                        pData.setApiName(apiName);
                                                }
                                        }
-       
+
                                        if (isDropCallTraceLog()) {
                                                apiName = pData.getApiName();
                                                if (apiName.contains(OSP_MAIN)) {
@@ -196,36 +196,37 @@ public class SWAPLogParser implements Runnable {
                                                        continue;
                                                }
                                        }
-       // irregular call check still necessary?
-                                       if (AnalyzerManager.getCallstackManager().isIrregularUserCall(
-                                                       pData)) {
+                                       // irregular call check still necessary?
+                                       if (AnalyzerManager.getCallstackManager()
+                                                       .isIrregularUserCall(pData)) {
                                                continue;
                                        }
-       
+
                                        ProcessInfoPackage processInfoPkg = AnalyzerManager
                                                        .getProject().getProcessInfo(pData.getPid());
-                                       ProcessInfo processInfo = processInfoPkg.getProcessInfo(pData
-                                                       .getTime());
-       
-                                       System.out.println(" PROFILE LOG DEBUG = ID: "
-                                                       + pData.getId()
-                                                       + " PC : "
-                                                       + AnalyzerUtil.toHexdecimal(pData.getPcAddr())
-                                                       + " Api : "
-                                                       + pData.getApiName()
-                                                       + " caller :  "
-                                                       + AnalyzerUtil.toHexdecimal(pData.getCallerPcAddr())
-                                                       + "   base addr : "
-                                                       + AnalyzerUtil.toHexdecimal(processInfo
-                                                                       .getLowestAddress()));
+                                       ProcessInfo processInfo = processInfoPkg
+                                                       .getProcessInfo(pData.getTime());
+
+                                       // for debug
+                                       // System.out.println(" PROFILE LOG DEBUG = ID: "
+                                       // + pData.getId()
+                                       // + " PC : "
+                                       // + AnalyzerUtil.toHexdecimal(pData.getPcAddr())
+                                       // + " Api : "
+                                       // + pData.getApiName()
+                                       // + " caller :  "
+                                       // + AnalyzerUtil.toHexdecimal(pData.getCallerPcAddr())
+                                       // + "   base addr : "
+                                       // + AnalyzerUtil.toHexdecimal(processInfo
+                                       // .getLowestAddress()));
                                        pushLog(log, logPack);
                                        /* user callstack create by entry and exit */
                                        AnalyzerManager.getCallstackManager().makeUserCallstack(
                                                        pData,
                                                        FunctionUsageProfiler.getInstance()
-                                                       .getProfileDataMaker());
+                                                                       .getProfileDataMaker());
                                } else {
-                                       pushLog(log, logPack);                                  
+                                       pushLog(log, logPack);
                                }
                        } else if (log instanceof ReplayData) {
                                pushLog(log, logPack);
@@ -256,7 +257,7 @@ public class SWAPLogParser implements Runnable {
                                }
                                pushLog(log, logPack);
                                AnalyzerManager.getCallstackManager()
-                                       .makeCallstackWithoutBacktrace(log);
+                                               .makeCallstackWithoutBacktrace(log);
                                if (id == DataChannelConstants.MSG_PROBE_FILE
                                                || id == DataChannelConstants.MSG_PROBE_MEMORY) {
                                        AnalyzerManager.getLeakDetector().runLeakDectect(log);
index 8aab479..78bc681 100644 (file)
@@ -274,6 +274,7 @@ public class ProfileData extends LogData {
                ret = rs.getLong(index++);
                args = rs.getString(index++);
                apiName = rs.getString(index++);
+               libName = rs.getString(index++);
                callstack = rs.getString(index++);
        }
 
index 7a292fd..f11fb6c 100644 (file)
@@ -43,20 +43,20 @@ public class ProfilingLogFormat extends LogFormat {
                setName(NAME);
 
                String[] dcn = { "PCAddr", "CallerPcAddr", "ProbeType", "ProbeSubType",
-                               "Pid", "Tid", "CpuNum", "Args", "Ret", "ApiName", "CallStack" };
+                               "Pid", "Tid", "CpuNum", "Args", "Ret", "ApiName", "LibName", "CallStack" };
                dbColumnNames = HeaderColumns.getDBColumnNames();
                dbColumnNames.addAll(Arrays.asList(dcn));
 
-               Integer[] dct = { L, L, I, I, I, I, I, T, L, T, T };
+               Integer[] dct = { L, L, I, I, I, I, I, T, L, T, T, T };
                dbColumnTypes = HeaderColumns.getDBColumntypes();
                dbColumnTypes.addAll(Arrays.asList(dct));
 
                String[] tcn = { "PCAddr", "CallerPcAddr", "ProbeType", "ProbeSubType",
-                               "Pid", "Tid", "CpuNum", "Args", "Ret", "ApiName", "CallStack" };
+                               "Pid", "Tid", "CpuNum", "Args", "Ret", "ApiName", "LibName", "CallStack" };
                tableColumnNames = HeaderColumns.getTableColumnNames();
                tableColumnNames.addAll(Arrays.asList(tcn));
 
-               Integer[] types = { L, L, I, I, I, I, I, S, L, S, S };
+               Integer[] types = { L, L, I, I, I, I, I, S, L, S, S, S };
                logColumnTypes = HeaderColumns.getLogColumnTypes();
                logColumnTypes.addAll(Arrays.asList(types));
        }