From: jy.exe.lee Date: Tue, 26 Jun 2012 12:31:11 +0000 (+0900) Subject: [Title] Callstack unknown pressed X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01a42d119532671a4b9affa2caa1a4c3afe70be9;p=sdk%2Ftools%2Fdynamic-analyzer.git [Title] Callstack unknown pressed [Type] bug fix [Module] DynamicAnalyzer [Priority] major [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/LogSpliter.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/LogSpliter.java index 9f92e53..687df42 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/LogSpliter.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/LogSpliter.java @@ -229,11 +229,7 @@ public class LogSpliter { if (null == selfSymbol) { selfSymbol = SymbolManager.addr2func(binPath, selfAddr, isPieBuild, baseAddr); - // FIXME : demangling debug - String prevSelf = selfSymbol; selfSymbol = SymbolNameDemangler.nameDemangle(selfSymbol); - System.out.println("[Self] Demangling in makeCallstack : " - + prevSelf + " to " + selfSymbol); selfSymbol = getUserFunctionPosition() + AnalyzerConstants.CALLSTACK_API_TOKEN_STRING + selfSymbol; addrMap.put(self, new String(selfSymbol)); @@ -247,10 +243,7 @@ public class LogSpliter { if (null == callerSymbol) { callerSymbol = SymbolManager.addr2func(binPath, callerAddr, isPieBuild, baseAddr); - String prevCaller = callerSymbol; callerSymbol = SymbolNameDemangler.nameDemangle(callerSymbol); - System.out.println("[Caller] Demangling in makeCallstack : " - + prevCaller + " to " + callerSymbol); callerSymbol = getUserFunctionPosition() + AnalyzerConstants.CALLSTACK_API_TOKEN_STRING + callerSymbol; @@ -415,8 +408,13 @@ public class LogSpliter { CallStackData cd = new CallStackData(lastNum); HashMap addrMap = getCallStackApiByAddrMap(); List addrList = getCallStackApiList(); + + String prevPath = ""; //$NON-NLS-1$ + String currentPath = null; int size = callstackLog.size(); + System.out.println("new callstack :" + lastNum); for (int i = 1; i + 1 < size; i += 2) { + currentPath = null; if (callstackLog.get(i).equals(AnalyzerConstants.CALLSTACK_END) || callstackLog.get(i + 1).equals( AnalyzerConstants.CALLSTACK_END)) { @@ -432,36 +430,44 @@ public class LogSpliter { } catch (NumberFormatException e) { e.printStackTrace(); } - String funcName = addrMap.get(addr); + String symbolFullName = addrMap.get(addr); - if (null == funcName || funcName.isEmpty()) { - funcName = callstackLog.get(i + 1); - if (funcName.isEmpty()) { + if (null == symbolFullName || symbolFullName.isEmpty()) { + symbolFullName = callstackLog.get(i + 1); + if (symbolFullName.isEmpty()) { continue; } + } - String[] name = funcName - .split(AnalyzerConstants.CALLSTACK_API_OFFSET_TOKEN); - String fns[] = name[0].split("\\("); - String inputName = null; - if (fns.length > 1) { - String dmfn = SymbolNameDemangler.nameDemangle(fns[1]); - inputName = new String(fns[0] + "(" + dmfn); - } else { - inputName = new String(name[0]); + String[] pathOffset = symbolFullName + .split(AnalyzerConstants.CALLSTACK_API_OFFSET_TOKEN); + String pathFunc[] = pathOffset[0].split("\\("); + if (pathFunc.length < 2) { + currentPath = pathFunc[0]; + if (prevPath.equals(currentPath)) { + continue; } - addrMap.put(addr, inputName); - CallStackApi cas = new CallStackApi(addr, inputName); - addrList.add(cas); + prevPath = currentPath; } - if (checkUserCall(funcName) + String inputName = null; + if (pathFunc.length > 1) { + String dmfn = SymbolNameDemangler.nameDemangle(pathFunc[1]); + inputName = new String(pathFunc[0] + "(" + dmfn); + } else { + inputName = new String(pathOffset[0]); + } + addrMap.put(addr, inputName); + CallStackApi cas = new CallStackApi(addr, inputName); + addrList.add(cas); + + if (checkUserCall(symbolFullName) && (userFunctionBin == null || userFunctionBin.isEmpty())) { int appType = Integer.parseInt(AnalyzerManager.getProject() .getAppInfo().get(AnalyzerConstants.APP_INFO_APP_TYPE)); - String[] name = funcName + String[] dname = symbolFullName .split(AnalyzerConstants.CALLSTACK_API_OFFSET_TOKEN); - String input[] = name[0] + String input[] = dname[0] .split(AnalyzerConstants.CALLSTACK_API_TOKEN); if (appType != AnalyzerConstants.APP_TYPE_OSP) { userFunctionBin = new String(input[0]); @@ -471,7 +477,7 @@ public class LogSpliter { // System.out.println("set ufp " + userFunctionBin); //$NON-NLS-1$ } cd.getAddrs().add(addr); - } + }// end of callstack start-end getCallStackDataBySeqMap().put(lastNum, cd); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/tables/CallstackTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/tables/CallstackTable.java index 138c045..f891cc4 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/tables/CallstackTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/tables/CallstackTable.java @@ -147,7 +147,6 @@ public class CallstackTable extends DATableComposite { isPieBuild, baseAddr); fName = SymbolNameDemangler.nameDemangle(fName); } - System.out.println(fName + " " + path); } if (LogSpliter.checkUserCall(path)) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/UserProfileChecker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/UserProfileChecker.java index d25f505..1b5f7db 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/UserProfileChecker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/UserProfileChecker.java @@ -4,7 +4,6 @@ import java.util.HashMap; import org.tizen.dynamicanalyzer.model.UserProfileData; - public class UserProfileChecker { public final static double PROFILE_TIME = 0.01; HashMap data = null;