int seq = log.getSeq();
int tid = log.getTid();
- long time = log.getTime();
+ long time = log.getTime();
long selfAddr = log.getPcAddr();
long callerAddr = log.getCallerPcAddr();
List<CallStackItem> userCallstack = getUserCallstack(tid);
int size = userCallstack.size();
TreeMap<Long, Integer> seqByTimeMap = getSeqTimeByTidMap(tid);
-
+
CallStackUnit callerCallstackUnit = addrMap.get(callerAddr);
if (null == callerCallstackUnit) {
String strCallerFuncName = SymbolManager.addr2func(sourceBinPath,
} else {
CallStackUnit callerCsa = addrMap.get(callerAddr);
if (null == callerCsa) {
- callerCsa = userCallstack.get(size - 1)
- .getCallStackUnit();
+ callerCsa = userCallstack.get(size - 1).getCallStackUnit();
callerCsa.setFunctionStartAddr(callerCsa.getAddr());
callerCsa.setAddr(callerAddr);
} else {
- callerCsa.setFunctionStartAddr(userCallstack
- .get(size - 1).getCallStackUnit().getAddr());
- userCallstack.set(size - 1,
- new CallStackItem(callerCsa));
+ CallStackItem topCallstackItem = userCallstack.get(
+ size - 1);
+ callerCsa.setFunctionStartAddr(topCallstackItem.getCallStackUnit().getAddr());
+ userCallstack.set(size - 1, new CallStackItem(callerCsa, topCallstackItem.getStartTime()));
}
}
userCallstack.add(new CallStackItem(selfCallstackUnit, time));
}
size = userCallstack.size();
for (int i = size - 1; i >= 0; i--) {
- callstackData.getAddrs().add(
- userCallstack.get(i).getCallStackUnit().getAddr());
+ callstackData.getAddrs().add(userCallstack.get(i).getCallStackUnit().getAddr());
}
getCallStackDataBySeqMap().put(seq, callstackData);
- seqByTimeMap.put(time, seq);
+ seqByTimeMap.put(time, seq);
} else if (eventType == MSG_FUNCTION_EXIT) {
if (size == 0) {
// this case only range profiling, other time is bug
return;
}
- CallStackUnit removeCallStackUnit = userCallstack.get(size - 1)
- .getCallStackUnit();
+ CallStackUnit removeCallStackUnit = userCallstack.get(size - 1).getCallStackUnit();
if (selfCallstackUnit.getFunctionName().equals(
removeCallStackUnit.getFunctionName())) {
userCallstack.remove(size - 1);
if (callerCallstackUnit.getFunctionName().contains(
AnalyzerConstants.VIRTUAL_THUNK)) {
if (callerCallstackUnit.getFunctionName().equals(
- userCallstack.get(size - 2).getCallStackUnit()
- .getFunctionName())) {
+ userCallstack.get(size - 2).getCallStackUnit().getFunctionName())) {
userCallstack.remove(size - 2);
} else {
System.out
}
size = userCallstack.size();
if (size - 1 > 0) {
- CallStackUnit checkCallStackUnit = userCallstack.get(
- size - 1).getCallStackUnit();
+ CallStackUnit checkCallStackUnit = userCallstack
+ .get(size - 1).getCallStackUnit();
if (checkCallStackUnit.getFunctionName().equals(
LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC)) {
userCallstack.remove(size - 1);
}
size = userCallstack.size();
if (size > 0) {
- CallStackUnit prevCallstackUnit = userCallstack.get(
- size - 1).getCallStackUnit();
- long prevSelfAddr = prevCallstackUnit
+ CallStackItem prevCallstackItem = userCallstack
+ .get(size - 1);
+ long prevSelfAddr = prevCallstackItem.getCallStackUnit()
.getFunctionStartAddr();
CallStackUnit callerCsa = addrMap.get(prevSelfAddr);
if (null == callerCsa) {
- prevCallstackUnit.setAddr(prevSelfAddr);
+ prevCallstackItem.getCallStackUnit().setAddr(prevSelfAddr);
} else {
- userCallstack.set(size - 1,
- new CallStackItem(callerCsa));
+ userCallstack.set(size - 1, new CallStackItem(callerCsa, prevCallstackItem.getStartTime()));
}
}
for (int i = size - 1; i >= 0; i--) {
- callstackData.getAddrs().add(
- userCallstack.get(i).getCallStackUnit().getAddr());
+ callstackData.getAddrs().add(userCallstack.get(i).getCallStackUnit().getAddr());
}
getCallStackDataBySeqMap().put(seq, callstackData);
- seqByTimeMap.put(time, seq);
+ seqByTimeMap.put(time, seq);
} else {
System.out
.println("makeUserCallstack : EXIT self is not the same as top of user callstack");
}
if (AnalyzerManager.isOsp()) {
- // String apiName = input[LogCenterConstants.APINAME_INDEX];
+ // String apiName = input[LogCenterConstants.APINAME_INDEX];
String apiName = log.getApiName();
if (apiName.equals("OspMain")) { //$NON-NLS-1$
SWAPLogParser.setDropCallTraceLog(true);
addrMap.put(callerAddr, callerCallstackUnit);
}
- CallStackUnit topUserCallstack = probeCallstack.get(size - 1)
- .getCallStackUnit();
+ CallStackUnit topUserCallstack = probeCallstack.get(size - 1).getCallStackUnit();
if (callerCallstackUnit.getFunctionName().equals(
topUserCallstack.getFunctionName())) {
- probeCallstack.set(size - 1, new CallStackItem(
- callerCallstackUnit));
+ probeCallstack.set(size - 1, new CallStackItem(callerCallstackUnit));
} else {
System.out
.println("bug : probe caller is not the same as top of user callstack"); //$NON-NLS-1$
size = probeCallstack.size();
for (int i = size - 1; i >= 0; i--) {
- callstackData.getAddrs().add(
- probeCallstack.get(i).getCallStackUnit().getAddr());
+ callstackData.getAddrs().add(probeCallstack.get(i).getCallStackUnit().getAddr());
}
getCallStackDataBySeqMap().put(seq, callstackData);
int eventType = input.getId();
if (size > 0) {
if (eventType == MSG_FUNCTION_ENTRY) {
- CallStackUnit topCallstackUnit = userCallstack.get(size - 1)
- .getCallStackUnit();
+ CallStackUnit topCallstackUnit = userCallstack.get(size - 1).getCallStackUnit();
if (topCallstackUnit.equals(selfCallstackUnit)) {
DuplicateUserCall dupUserCall = dupUserCallMap.get(tid);
if (null == dupUserCall) {