}
protected ConcurrentHashMap<Integer, ConcurrentHashMap<Long, CallStackUnit>> callstackApiAddrByPidMap = new ConcurrentHashMap<Integer, ConcurrentHashMap<Long, CallStackUnit>>();
- protected ConcurrentHashMap<Integer, CallStackData> callstackDataBySeqMap = new ConcurrentHashMap<Integer, CallStackData>();
+ protected ConcurrentHashMap<Long, CallStackData> callstackDataBySeqMap = new ConcurrentHashMap<Long, CallStackData>();
protected String userFunctionBin = null;
protected HashMap<Integer, List<CallStackItem>> userCallstackByTidMap = new HashMap<Integer, List<CallStackItem>>();
protected HashMap<Integer, DuplicateUserCall> dupUserCallByTidMap = new HashMap<Integer, DuplicateUserCall>();
- protected ConcurrentHashMap<Integer, ConcurrentSkipListMap<Long, Integer>> seqTimeByTidMap = new ConcurrentHashMap<Integer, ConcurrentSkipListMap<Long, Integer>>();
+ protected ConcurrentHashMap<Integer, ConcurrentSkipListMap<Long, Long>> seqTimeByTidMap = new ConcurrentHashMap<Integer, ConcurrentSkipListMap<Long, Long>>();
protected CallStackInserter callstackInserter = null;
return callstackApiByAddrMap;
}
- public Map<Integer, CallStackData> getCallStackDataBySeqMap() {
+ public Map<Long, CallStackData> getCallStackDataBySeqMap() {
if (null == callstackDataBySeqMap) {
- callstackDataBySeqMap = new ConcurrentHashMap<Integer, CallStackData>();
+ callstackDataBySeqMap = new ConcurrentHashMap<Long, CallStackData>();
}
return callstackDataBySeqMap;
}
return dupUserCallByTidMap;
}
- public NavigableMap<Long, Integer> getSeqTimeByTidMap(int tid) {
+ public NavigableMap<Long, Long> getSeqTimeByTidMap(int tid) {
if (null == seqTimeByTidMap) {
- seqTimeByTidMap = new ConcurrentHashMap<Integer, ConcurrentSkipListMap<Long, Integer>>();
+ seqTimeByTidMap = new ConcurrentHashMap<Integer, ConcurrentSkipListMap<Long, Long>>();
}
- ConcurrentSkipListMap<Long, Integer> seqByTimeMap = seqTimeByTidMap.get(tid);
+ ConcurrentSkipListMap<Long, Long> seqByTimeMap = seqTimeByTidMap.get(tid);
if (null == seqByTimeMap) {
- seqByTimeMap = new ConcurrentSkipListMap<Long, Integer>();
+ seqByTimeMap = new ConcurrentSkipListMap<Long, Long>();
seqTimeByTidMap.put(tid, seqByTimeMap);
}
return seqByTimeMap;
Map<Long, CallStackUnit> addrMap = getCallStackApiAddrByPidMap(pid);
- int seq = log.getSeq();
+ long seq = log.getSeq();
int tid = log.getTid();
long selfAddr = log.getPcAddr();
List<CallStackItem> userCallstack = getUserCallstack(tid);
int size = userCallstack.size();
- NavigableMap<Long, Integer> seqByTimeMap = getSeqTimeByTidMap(tid);
+ NavigableMap<Long, Long> seqByTimeMap = getSeqTimeByTidMap(tid);
CallStackUnit callerCallstackUnit = addrMap.get(callerAddr);
if (null == callerCallstackUnit) {
Map<Long, CallStackUnit> addrMap = getCallStackApiAddrByPidMap(pid);
- int seq = log.getSeq();
+ long seq = log.getSeq();
int tid = log.getTid();
long callerAddr = log.getCallerPcAddr();
public ProfileData() {
}
+ /** make function entry/exit from Database **/
+ public ProfileData(int id, long seq, int pid, int tid, int apiId,
+ int binaryId, long time, long callerPcAddr, long pcAddr) {
+ this.id = id;
+ this.seq = seq;
+ this.pid = pid;
+ this.tid = tid;
+ this.apiId = apiId;
+ this.binaryId = binaryId;
+ this.time = time;
+ this.callerPcAddr = callerPcAddr;
+ this.pcAddr = pcAddr;
+ }
+
/** make function sample from Database **/
public ProfileData(long time, int pid, int tid, long pcAddr) {
this.id = MSG_DATA_SAMPLE;
import java.util.List;
public class CallStackData {
- protected int seq;
+ protected long seq;
protected List<Long> addrs;
- public CallStackData(int seqNum) {
+ public CallStackData(long seqNum) {
seq = seqNum;
}
- public int getSeq() {
+ public long getSeq() {
return seq;
}
addColumn(new DBColumn(COLUMN.PCADDR.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_LONG));
}
- public List<List<Object>> getCallStackAddrsFromDB(int seq) {
+ public List<List<Object>> getCallStackAddrsFromDB(long seq) {
String where = String.format(queryto_withSeq,
COLUMN.SEQ.name, seq);
DATableDataFormat tableData = (DATableDataFormat) items[0]
.getData();
- int seqNum = -1;
+ long seqNum = -1;
int pid = -1;
long time = -1;
if (tableData.getType() == AnalyzerConstants.TYPE_TABLE_FAILED) {
List<Object> failedData = tableData.getData();
- seqNum = (Integer) failedData.get(0);
+ seqNum = (Long) failedData.get(0);
pid = (Integer) failedData.get(7);
time = (Long) failedData.get(1);
} else if (tableData.getType() == AnalyzerConstants.TYPE_TABLE_LEAK) {
List<Object> leakData = tableData.getData();
- seqNum = (Integer) leakData.get(0);
+ seqNum = (Long) leakData.get(0);
pid = (Integer) leakData.get(2);
time = (Long) leakData.get(4);
} else if (tableData.getType() == AnalyzerConstants.TYPE_TABLE_CALLTRACE) {
List<Object> calltraceData = tableData.getData();
- seqNum = ((Long) calltraceData.get(FunctionEntryDBTable.COLUMN.SEQ.index)).intValue();
+ seqNum = (Long) calltraceData.get(FunctionEntryDBTable.COLUMN.SEQ.index);
pid = (Integer) calltraceData.get(FunctionEntryDBTable.COLUMN.PID.index);
time = (Long) calltraceData.get(FunctionEntryDBTable.COLUMN.STARTTIME.index);
} else { // in case table has LogData
time = logData.getTime();
}
- Map<Integer, CallStackData> cdMap = AnalyzerManager
+ Map<Long, CallStackData> cdMap = AnalyzerManager
.getCallstackManager().getCallStackDataBySeqMap();
Map<Long, CallStackUnit> addrMap = AnalyzerManager
.getCallstackManager().getCallStackApiAddrByPidMap(pid);
private ProfileData makeFunctionProfileData(int id, ResultSet rs) {
ProfileData profileData = null;
try {
- int seq = rs.getInt(Function.SEQ.index);
+ long seq = rs.getLong(Function.SEQ.index);
int pid = rs.getInt(Function.PID.index);
int tid = rs.getInt(Function.TID.index);
int functionId = rs.getInt(Function.FUNCTIONID.index);
getInstance().getProfileDataMakerByPid(
sample.get(i).getPid())
.makeFunctionUsageProfileData(sampleLog);
- Map<Integer, CallStackData> callstackDataMap = AnalyzerManager.getCallstackManager()
+ Map<Long, CallStackData> callstackDataMap = AnalyzerManager.getCallstackManager()
.getCallStackDataBySeqMap();
if (callstackDataMap.size() > CALLSTACKDATA_MAX) {
// remove unnecessary callstackdata from memory
- NavigableMap<Long, Integer> seqByTimeMap =
+ NavigableMap<Long, Long> seqByTimeMap =
AnalyzerManager.getCallstackManager()
.getSeqTimeByTidMap(sampleLog.getTid());
// find the time of callstackdata which was made
Long lastTime = seqByTimeMap
.floorKey(sampleLog.getTime());
if (null != lastTime) {
- SortedMap<Long, Integer> headMap =
+ SortedMap<Long, Long> headMap =
seqByTimeMap.headMap(lastTime);
- Iterator<Map.Entry<Long, Integer>> itr = headMap
+ Iterator<Map.Entry<Long, Long>> itr = headMap
.entrySet().iterator();
while (itr.hasNext()) {
- Map.Entry<Long, Integer> entry = itr.next();
+ Map.Entry<Long, Long> entry = itr.next();
callstackDataMap.remove(entry.getValue());
itr.remove();
}
}
} else { // sampling is off, callstackdata is not needed in memory
// need to maintain callstackdata until insertion to DB is finished
- Map<Integer, CallStackData> callstackDataMap = AnalyzerManager.getCallstackManager()
+ Map<Long, CallStackData> callstackDataMap = AnalyzerManager.getCallstackManager()
.getCallStackDataBySeqMap();
if (callstackDataMap.size() > CALLSTACKDATA_MAX) {
callstackDataMap.clear();
int pid = sampleLog.getPid();
if(DACommunicator.isSWAPVersion()) {
- int seq;
+ long seq;
int tid = sampleLog.getTid();
long sampleTime = sampleLog.getTime();
long callstackTime;
Long longTime = null;
CallStackData callstackData;
- NavigableMap<Long, Integer> seqByTimeMap = callstackManager.getSeqTimeByTidMap(tid);
+ NavigableMap<Long, Long> seqByTimeMap = callstackManager.getSeqTimeByTidMap(tid);
Map<Long, CallStackUnit> addrMap = callstackManager
.getCallStackApiAddrByPidMap(pid);
// create images
// create DATableDataFormat
- int seq = (Integer)idata.get(WarningDataDBTable.COLUMN_INDEX_SEQUENCE_NUMBER);
+ long seq = (Long)idata.get(WarningDataDBTable.COLUMN_INDEX_SEQUENCE_NUMBER);
DATableDataFormat tableData = new DATableDataFormat(seq);
ProbeCommonData probeData = new ProbeCommonData();
private ProbeCommonData makeProbeCommonData(ResultSet rs) {
ProbeCommonData pData = null;
try {
- int seq = rs.getInt(API.SEQ.index);
+ long seq = rs.getLong(API.SEQ.index);
long time = rs.getLong(API.APICALLTIME.index);
int apiID = rs.getInt(API.APIID.index);
int pid = rs.getInt(API.PID.index);
import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;