[Title] fix callstack for Libinst log, change naming
authorwoojin <woojin2.jung@samsung.com>
Tue, 5 Nov 2013 07:30:28 +0000 (16:30 +0900)
committerwoojin <woojin2.jung@samsung.com>
Tue, 5 Nov 2013 07:30:28 +0000 (16:30 +0900)
[Desc.] 1. callstack of Libinst log is made by callstack routine for probe log 2. naming change function usage profiling -> function profiling, thread API -> api name
[Issue]

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/SummaryLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ThreadPageLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/SWAPCallStackManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java

index a807385..30f744f 100644 (file)
@@ -11,7 +11,7 @@ FAILED_API_LIST_VIEW_ERROR_DESCRIPTION=Error description
 FUNCTION_USAGE_PROFILER_APPLICATION=Application
 FUNCTION_USAGE_PROFILER_DEPENDENT_LIB=Dependent library
 
-FUNCTION_USER_PROFILING_VIEW_TITLE=Function Usage Profiling
+FUNCTION_USER_PROFILING_VIEW_TITLE=Function Profiling
 FUNCTION_USER_PROFILING_VIEW_NAME=Library/function name
 FUNCTION_USER_PROFILING_VIEW_CPU_RATE=CPU rate
 FUNCTION_USER_PROFILING_VIEW_CPU_TIME=CPU time
index 7f6cd3d..693a0d4 100644 (file)
@@ -53,7 +53,7 @@ THREAD_API_LIST_VEIW_TITLE=Thread API List
 THREAD_API_LIST_VIEW_INDEX=#
 THREAD_API_LIST_VIEW_TIME=Time
 THREAD_API_LIST_VIEW_PID=PID
-THREAD_API_LIST_VIEW_NAME=Thread API
+THREAD_API_LIST_VIEW_NAME=API name
 THREAD_API_LIST_VIEW_PARAMETER=Parameter
 THREAD_API_LIST_VIEW_THREAD_ID=TID
 THREAD_API_LIST_VIEW_RETURN=Return
index 23d75e3..96c69f5 100644 (file)
@@ -230,21 +230,51 @@ public class SWAPCallStackManager extends BaseCallstackManager {
        }
 
        public void makeCallstackWithoutBacktrace(LogData inputData) {
-               ProbeCommonData log = (ProbeCommonData) inputData;
+               boolean isProfileData = false;
+               ProbeCommonData log = null;
+               ProfileData pData = null;
+               if (inputData instanceof ProfileData) {
+                       pData = (ProfileData) inputData;
+                       isProfileData = true;
+               } else {
+                       log = (ProbeCommonData) inputData;                      
+               }
+               
                HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();
-               boolean isPieBuild = AnalyzerUtil.isPieBuild(log.getPid(),
-                               log.getTime());
-               String baseAddr = Long.toString(AnalyzerManager.getProject()
-                               .getBaseAddress(log.getPid(), log.getTime()));
-               String binPath = AnalyzerUtil.getProcessLocalBinaryPath(log.getPid(),
-                               log.getTime());
+               boolean isPieBuild;
+               String baseAddr, binPath;
+               if(isProfileData) {
+                       isPieBuild = AnalyzerUtil.isPieBuild(pData.getPid(),
+                                       pData.getTime());
+                       baseAddr = Long.toString(AnalyzerManager.getProject()
+                                       .getBaseAddress(pData.getPid(), pData.getTime()));
+                       binPath = AnalyzerUtil.getProcessLocalBinaryPath(pData.getPid(),
+                                       pData.getTime());
+                       
+               } else {
+                       isPieBuild = AnalyzerUtil.isPieBuild(log.getPid(),
+                                       log.getTime());
+                       baseAddr = Long.toString(AnalyzerManager.getProject()
+                                       .getBaseAddress(log.getPid(), log.getTime()));
+                       binPath = AnalyzerUtil.getProcessLocalBinaryPath(log.getPid(),
+                                       log.getTime());
+               }
+
                if (null == binPath || binPath.isEmpty()) {
                        return;
                }
 
-               int seq = log.getSeq();
-               int tid = log.getTid();
-               long callerAddr = log.getCallerPcAddr();
+               int seq = inputData.getSeq();
+               int tid;
+               long callerAddr;
+               if(isProfileData) {
+                       tid = pData.getTid();
+                       callerAddr = pData.getCallerPcAddr();                   
+               } else {
+                       tid = log.getTid();
+                       callerAddr = log.getCallerPcAddr();                     
+               }
+
                // if (!strCallerAddr.isEmpty()) {
                // callerAddr = Long.parseLong(strCallerAddr);
                // } else {
@@ -271,14 +301,14 @@ public class SWAPCallStackManager extends BaseCallstackManager {
                if ((size == 0) || (!AnalyzerManager.isInBinaryRange(callerAddr))) {
                        CallStackUnit callbackApi = new CallStackUnit(
                                        LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
-                                       LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL, log);
+                                       LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL, inputData);
                        probeCallstack.add(new CallStackItem(callbackApi));
                        if (addrMap
                                        .get(LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR) == null) {
                                CallStackUnit defaultCallstackUnit = new CallStackUnit(
                                                LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
                                                LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL,
-                                               log);
+                                               inputData);
                                addrMap.put(
                                                LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
                                                defaultCallstackUnit);
@@ -292,7 +322,7 @@ public class SWAPCallStackManager extends BaseCallstackManager {
                                                + AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
                                                + strCallerFuncName;
                                callerCallstackUnit = new CallStackUnit(callerAddr,
-                                               strCallerSymbol, log);
+                                               strCallerSymbol, inputData);
                                addrMap.put(callerAddr, callerCallstackUnit);
                        }
 
index d8b6c9a..72bd378 100755 (executable)
@@ -36,6 +36,8 @@ import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.logparser.LogInserter;
 import org.tizen.dynamicanalyzer.model.ImageInfo;
 import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
+import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
+import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
 import org.tizen.dynamicanalyzer.swap.model.data.ContextSwitchData;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
@@ -156,6 +158,7 @@ public class SWAPLogParser implements Runnable {
 
                                if (id != DataChannelConstants.MSG_DATA_SAMPLE) {
                                        ProfileData pData = (ProfileData) log;
+                                       long pcAddr = pData.getPcAddr();
                                        String apiName = pData.getApiName();
                                        if (null == apiName || apiName.isEmpty()
                                                        || apiName.equals("_end")) { //$NON-NLS-1$
@@ -183,10 +186,10 @@ public class SWAPLogParser implements Runnable {
                                                continue;
                                        }
 
-//                                     ProcessInfoPackage processInfoPkg = AnalyzerManager
-//                                                     .getProject().getProcessInfo(pData.getPid());
-//                                     ProcessInfo processInfo = processInfoPkg
-//                                                     .getProcessInfo(pData.getTime());
+                                       ProcessInfoPackage processInfoPkg = AnalyzerManager
+                                                       .getProject().getProcessInfo(pData.getPid());
+                                       ProcessInfo processInfo = processInfoPkg
+                                                       .getProcessInfo(pData.getTime());
 
                                        // for debug
                                        // System.out.println(" PROFILE LOG DEBUG = ID: "
@@ -201,11 +204,19 @@ public class SWAPLogParser implements Runnable {
                                        // + AnalyzerUtil.toHexdecimal(processInfo
                                        // .getLowestAddress()));
                                        pushLog(log, logPack);
+                                       
+                                       if(pcAddr >= processInfo.getLowestAddress()
+                                                       && pcAddr <= processInfo.getHighestAddress())
+                                       {
                                        /* user callstack create by entry and exit */
-                                       AnalyzerManager.getCallstackManager().makeUserCallstack(
-                                                       pData,
-                                                       FunctionUsageProfiler.getInstance()
-                                                                       .getProfileDataMaker());
+                                               AnalyzerManager.getCallstackManager().makeUserCallstack(
+                                                               pData,
+                                                               FunctionUsageProfiler.getInstance()
+                                                                               .getProfileDataMaker());
+                                       } else {
+                                               AnalyzerManager.getCallstackManager()
+                                               .makeCallstackWithoutBacktrace(pData);                                          
+                                       }
                                } else {
                                        pushLog(log, logPack);
                                }