}
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 {
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);
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ strCallerFuncName;
callerCallstackUnit = new CallStackUnit(callerAddr,
- strCallerSymbol, log);
+ strCallerSymbol, inputData);
addrMap.put(callerAddr, callerCallstackUnit);
}
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;
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$
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: "
// + 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);
}