public void makeUserCallstack(LogData input, ProfileDataMaker profiler) {
ProfileData log = (ProfileData) input;
+ int pid = log.getPid();
+ long time = log.getTime();
+
HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();
- boolean isPieBuild = AnalyzerUtil.isPieBuild(log.getPid(),
- log.getTime());
+ boolean isPieBuild = AnalyzerUtil.isPieBuild(pid, time);
String baseAddr = Long.toString(AnalyzerManager.getProject()
- .getBaseAddress(log.getPid(), log.getTime()));
- String sourceBinPath = AnalyzerUtil.getBinarySourcePath(input.getPid(),
- input.getTime());
+ .getBaseAddress(pid, time));
+ String sourceBinPath = AnalyzerUtil.getBinarySourcePath(pid, time);
if (null == sourceBinPath || sourceBinPath.isEmpty()) {
return;
}
- String strSelfAddr = Long.toString(log.getPcAddr());
- String strCallerAddr = Long.toString(log.getCallerPcAddr());
int seq = log.getSeq();
int tid = log.getTid();
- long time = log.getTime();
long selfAddr = log.getPcAddr();
long callerAddr = log.getCallerPcAddr();
+
+ String strSelfAddr = Long.toString(selfAddr);
+ String strCallerAddr = Long.toString(callerAddr);
CallStackData callstackData = new CallStackData(seq);
CallStackUnit selfCallstackUnit = addrMap.get(selfAddr);
if (size == 0) {
userCallstack.add(new CallStackItem(selfCallstackUnit, time));
} else {
- if (!AnalyzerUtil.isAddrInBinaryRange(log.getPid(), log.getTime(), callerAddr)) {
+ if (!AnalyzerUtil.isAddrInBinaryRange(pid, time, callerAddr)) {
CallStackUnit callbackApi = new CallStackUnit(
LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL,
}
HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();
+ int pid;
+ long time;
boolean isPieBuild;
- String baseAddr, binPath;
+ String baseAddr, sourceBinPath;
if(isProfileData) {
- isPieBuild = AnalyzerUtil.isPieBuild(pData.getPid(),
- pData.getTime());
+ pid = pData.getPid();
+ time = pData.getTime();
+ isPieBuild = AnalyzerUtil.isPieBuild(pid, time);
baseAddr = Long.toString(AnalyzerManager.getProject()
- .getBaseAddress(pData.getPid(), pData.getTime()));
- binPath = AnalyzerUtil.getProcessLocalBinaryPath(pData.getPid(),
- pData.getTime());
-
+ .getBaseAddress(pid, time));
+ sourceBinPath = AnalyzerUtil.getBinarySourcePath(pid, time);
} else {
- isPieBuild = AnalyzerUtil.isPieBuild(log.getPid(),
- log.getTime());
+ pid = log.getPid();
+ time = log.getTime();
+ isPieBuild = AnalyzerUtil.isPieBuild(pid, time);
baseAddr = Long.toString(AnalyzerManager.getProject()
- .getBaseAddress(log.getPid(), log.getTime()));
- binPath = AnalyzerUtil.getProcessLocalBinaryPath(log.getPid(),
- log.getTime());
+ .getBaseAddress(pid, time));
+ sourceBinPath = AnalyzerUtil.getBinarySourcePath(pid, time);
}
- if (null == binPath || binPath.isEmpty()) {
+ if (null == sourceBinPath || sourceBinPath.isEmpty()) {
return;
}
CallStackData callstackData = new CallStackData(seq);
if ((size == 0) ||
- (!AnalyzerUtil.isAddrInBinaryRange(log.getPid(), log.getTime(), callerAddr))) {
+ (!AnalyzerUtil.isAddrInBinaryRange(pid, time, callerAddr))) {
CallStackUnit callbackApi = new CallStackUnit(
LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL, inputData);
} else {
CallStackUnit callerCallstackUnit = addrMap.get(callerAddr);
if (null == callerCallstackUnit) {
- String strCallerFuncName = SymbolManager.addr2func(binPath,
+ String strCallerFuncName = SymbolManager.addr2func(sourceBinPath,
strCallerAddr, isPieBuild, baseAddr);
String strCallerSymbol = getUserFunctionPosition()
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING