// possibility of extensions - network, efl, db, etc...
ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
.getProfileDataMakerByPid(pid);
- int seq = (Integer) profilingData.get(ProfilingDataDBTable.COLUMN.SEQ.index);
+ int profilingDataID = (Integer) profilingData.get(ProfilingDataDBTable.COLUMN.PROFILINGDATAID.index);
byte type = (Byte) profilingData.get(ProfilingDataDBTable.COLUMN.TYPE.index);
int exCount = (Integer) profilingData
.get(ProfilingDataDBTable.COLUMN.EXCOUNT.index);
.get(ProfilingDataDBTable.COLUMN.BINARYID.index);
bInfo = Global.getProject().getDeviceStatusInfo().getBinaryInfo(binaryId);
name = bInfo.getTargetBinaryPath();
- fupData = new ProfilingData(seq, name, exCount, inCount, callCount,
+ fupData = new ProfilingData(profilingDataID, name, exCount, inCount, callCount,
inElapsedTime, exElapsedTime, profiler);
break;
case ProfilingData.TYPE_FUNCTION:
int functionId = (Integer) profilingData
.get(ProfilingDataDBTable.COLUMN.FUNCTIONID.index);
name = Global.getFunctionName(functionId);
- fupData = new ProfilingData(seq, name, exCount, inCount, callCount,
+ fupData = new ProfilingData(profilingDataID, name, exCount, inCount, callCount,
inElapsedTime, exElapsedTime, profiler);
break;
default: // never goes here
profiler.setDependentLib(fupData);
}
- profiler.getProfilingDataMap().put(seq, fupData);
+ profiler.getProfilingDataMap().put(profilingDataID, fupData);
UIDataManager.getInstance().getfunctionProfilingDataChecker()
.addProfilingData(fupData);
// restore total sample count
} else {
for (int i = 0; i < profilingChilds.size(); i++) {
List<Object> data = profilingChilds.get(i);
- int parentSeq = (Integer) data.get(ProfilingChildDataDBTable.COLUMN.SEQ.index);
+ int parentID = (Integer) data.get(ProfilingChildDataDBTable.COLUMN.PROFILINGDATAID.index);
int pid = (Integer) data.get(ProfilingChildDataDBTable.COLUMN.PID.index);
- int childSeq = (Integer) data.get(ProfilingChildDataDBTable.COLUMN.CHILDSEQ.index);
+ int childID = (Integer) data.get(ProfilingChildDataDBTable.COLUMN.CHILDDATAID.index);
ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
.getProfileDataMakerByPid(pid);
- ProfilingData parent = profiler.getProfilingDataMap().get(parentSeq);
+ ProfilingData parent = profiler.getProfilingDataMap().get(parentID);
ProfilingChildData child = parent.getChildData();
- child.getChildren().add(childSeq);
+ child.getChildren().add(childID);
}
}
return isSuccess;
}
/**
- * key: symbol(child) or file path (parent) - value : sequence num of
+ * key: symbol(child) or file path (parent) - value : ID of
* profiling data. all parent and child data is in
*/
ProfilingData pData = pDataList.get(j);
try {
- insertRowData.add(new Integer(pData.getSequence()));
+ insertRowData.add(new Integer(pData.getProfilingDataID()));
String key = pData.getKey();
byte type;
if (key.equals(APPLICATION_KEY)) {
for (int k = 0; k < childCount; k++)
{
List<Object> insertRowData = new ArrayList<Object>();
- insertRowData.add(Integer.valueOf(data.getSeq()));
+ insertRowData.add(Integer.valueOf(data.getProfilingDataID()));
insertRowData.add(new Integer(data.getPid()));
insertRowData.add(new Integer(childList.get(k)));
insertData.add(insertRowData);
private int pid = 0;
/**
- * key: seq - value : function usage profiling data hash map all function
+ * key: ID - value : function usage profiling data hash map all function
* usage profiling data are in this hash map
**/
private ConcurrentHashMap<Integer, ProfilingData> profilingDataMap = null;
- private ConcurrentHashMap<String, String> symbolSeqHash = null;
+ private ConcurrentHashMap<String, String> symbolIDHash = null;
/**
- * key : seq - value : child seq list // all child lists are in this hash
+ * key : ID - value : child ID list // all child lists are in this hash
*/
private ConcurrentHashMap<String, ProfilingChildData> childListMap = null;
dependentLib = null;
appBinName = null;
totalSampleCount = 0;
- getSymbolSeqHash().clear();
+ getSymbolIDHash().clear();
callstackTreeByTidMap.clear();
}
}
public ProfilingData getProfilingDataByKey(String key) {
- Map<String, String> hash = getSymbolSeqHash();
- String seq = hash.get(key);
- if (null != seq) {
- return getProfilingDataMap().get(Integer.parseInt(seq));
+ Map<String, String> hash = getSymbolIDHash();
+ String profilingDataID = hash.get(key);
+ if (null != profilingDataID) {
+ return getProfilingDataMap().get(Integer.parseInt(profilingDataID));
}
return null;
}
return childListMap;
}
- public Map<String, String> getSymbolSeqHash() {
- if (null == symbolSeqHash) {
- symbolSeqHash = new ConcurrentHashMap<String, String>();
+ public Map<String, String> getSymbolIDHash() {
+ if (null == symbolIDHash) {
+ symbolIDHash = new ConcurrentHashMap<String, String>();
}
- return symbolSeqHash;
+ return symbolIDHash;
}
public CallstackTree getCurrentCallstackTree(int tid) {
boolean isParent) {
ProfilingData newProfilingData = new ProfilingData(inputData, isParent,
this);
- getProfilingDataMap().put(newProfilingData.getSequence(),
+ getProfilingDataMap().put(newProfilingData.getProfilingDataID(),
newProfilingData);
if (isParent) {
- getSymbolSeqHash().put(inputData.getPath(),
- Integer.toString(newProfilingData.getSequence()));
+ getSymbolIDHash().put(inputData.getPath(),
+ Integer.toString(newProfilingData.getProfilingDataID()));
} else {
- getSymbolSeqHash().put(inputData.getSymbol(),
- Integer.toString(newProfilingData.getSequence()));
+ getSymbolIDHash().put(inputData.getSymbol(),
+ Integer.toString(newProfilingData.getProfilingDataID()));
}
return newProfilingData;
}
import java.util.List;
public class ProfilingChildData {
- private String seq;
+ private String profilingDataID;
int pid;
private List<Integer> children;
- public ProfilingChildData(String seq, int pid) {
- this.seq = seq;
+ public ProfilingChildData(String profilingDataID, int pid) {
+ this.profilingDataID = profilingDataID;
this.pid = pid;
}
- public String getSeq() {
- return seq;
+ public String getProfilingDataID() {
+ return profilingDataID;
}
public int getPid() {
}
public boolean isEqual(ProfilingChildData input) {
- if (!input.getSeq().equals(seq)) {
+ if (!input.getProfilingDataID().equals(profilingDataID)) {
return false;
}
private static final String TABLENAME="ProfilingChildData";
// TODO: use Array type of DB
public enum COLUMN {
- SEQ(0, "SEQNUMBER"),
+ PROFILINGDATAID(0, "ProfilingDataID"),
PID(1, "PID"),
- CHILDSEQ(2, "CHILD_SEQNUMBER");
+ CHILDDATAID(2, "ChildDataID");
public final int index;
public final String name;
}
public ProfilingChildDataDBTable() {
- addColumn(new DBColumn(COLUMN.SEQ.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
+ addColumn(new DBColumn(COLUMN.PROFILINGDATAID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
addColumn(new DBColumn(COLUMN.PID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(COLUMN.CHILDSEQ.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
+ addColumn(new DBColumn(COLUMN.CHILDDATAID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
}
public List<List<Object>> getProfilingChildDataFromDB() {
isPrepared = false;
} else {
try {
- prep.setInt(COLUMN.SEQ.index + 1, (Integer) (rowData.get(COLUMN.SEQ.index)));
+ prep.setInt(COLUMN.PROFILINGDATAID.index + 1, (Integer) (rowData.get(COLUMN.PROFILINGDATAID.index)));
prep.setInt(COLUMN.PID.index + 1, (Integer) (rowData.get(COLUMN.PID.index)));
- prep.setInt(COLUMN.CHILDSEQ.index + 1, (Integer) (rowData.get(COLUMN.CHILDSEQ.index)));
+ prep.setInt(COLUMN.CHILDDATAID.index + 1, (Integer) (rowData.get(COLUMN.CHILDDATAID.index)));
} catch (SQLException e) {
e.printStackTrace();
isPrepared = false;
public static final byte TYPE_LIBRARY = 3;
private static int internalSeq = 0;
- private int seq = -1;
+ private int profilingDataID = -1;
private String name = null;
private int exCount = 0;
private int inCount = 0;
private long inElapsedTime = 0;
private long lastExeTime = 0;
private long exElapsedTime = 0;
- private int lastLogSeq = -1;
+ private int lastSampleID = -1;
private int functionId = -1;
private ProfileDataMaker profiler = null;
this.functionId = inputData.getFunctionId();
}
- seq = internalSeq++;
+ profilingDataID = internalSeq++;
this.key = inputData.getSymbol();
this.profiler = profiler;
}
public ProfilingChildData getChildData() {
if (null == children) {
- children = new ProfilingChildData(Integer.toString(seq)
+ children = new ProfilingChildData(Integer.toString(profilingDataID)
, profiler.getPid());
- profiler.getChildListMap().put(Integer.toString(seq), children);
+ profiler.getChildListMap().put(Integer.toString(profilingDataID), children);
}
return children;
}
/** using open trace **/
- public ProfilingData(int seq, String name, int exCount, int inCount, int callCount,
+ public ProfilingData(int profilingDataID, String name, int exCount, int inCount, int callCount,
long inElapsedTime, long exElapsedTime, ProfileDataMaker profiler) {
- this.seq = seq;
+ this.profilingDataID = profilingDataID;
this.name = name;
this.exCount = exCount;
this.inCount = inCount;
}
public void addChild(ProfilingData child) {
- int seq = child.getSequence();
- getChildData().getChildren().add(seq);
+ int childID = child.getProfilingDataID();
+ getChildData().getChildren().add(childID);
}
public ProfileDataMaker getProfileDataMaker() {
}
public int getExCount() {
- List<Integer> seqs = getChildData().getChildren();
- if (seqs.isEmpty()) {
+ List<Integer> childIDs = getChildData().getChildren();
+ if (childIDs.isEmpty()) {
return exCount;
}
- int size = seqs.size();
+ int size = childIDs.size();
int count = 0;
for (int i = 0; i < size; i++) {
ProfilingData data = profiler.getProfilingDataMap()
- .get(seqs.get(i));
+ .get(childIDs.get(i));
if (null != data) {
count += data.getExCount();
}
return inCount;
}
- public void addInCount(int seq) {
- if (seq == lastLogSeq) {
+ public void addInCount(int sampleID) {
+ if (sampleID == lastSampleID) {
return;
} else {
inCount++;
- lastLogSeq = seq;
+ lastSampleID = sampleID;
return;
}
}
return true;
}
- public int getSequence() {
- return seq;
+ public int getProfilingDataID() {
+ return profilingDataID;
}
public int getFunctionId() {
public List<ProfilingData> getChildList() {
List<ProfilingData> output = new ArrayList<ProfilingData>();
- List<Integer> seqs = getChildData().getChildren();
+ List<Integer> childIDs = getChildData().getChildren();
- for (int i = 0; i < seqs.size(); i++) {
+ for (int i = 0; i < childIDs.size(); i++) {
ProfilingData child = profiler.getProfilingDataMap().get(
- seqs.get(i));
+ childIDs.get(i));
if (null != child) {
output.add(child);
}
private static final String TABLENAME="ProfilingData";
public enum COLUMN {
- SEQ(0, "SEQNUMBER"),
+ PROFILINGDATAID(0, "ProfilingDataID"),
TYPE(1, "Type"),
FUNCTIONID(2, "FunctionId"),
BINARYID(3, "BinaryId"),
}
public ProfilingDataDBTable() {
- addColumn(new DBColumn(COLUMN.SEQ.name, DBConstants.PRIMARY_KEY, DBConstants.DBTYPE_INT4));
+ addColumn(new DBColumn(COLUMN.PROFILINGDATAID.name, DBConstants.PRIMARY_KEY, DBConstants.DBTYPE_INT4));
addColumn(new DBColumn(COLUMN.TYPE.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT1));
addColumn(new DBColumn(COLUMN.FUNCTIONID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
addColumn(new DBColumn(COLUMN.BINARYID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
isPrepared = false;
} else {
try {
- prep.setInt(COLUMN.SEQ.index + 1, (Integer) (rowData.get(COLUMN.SEQ.index)));
+ prep.setInt(COLUMN.PROFILINGDATAID.index + 1, (Integer) (rowData.get(COLUMN.PROFILINGDATAID.index)));
prep.setByte(COLUMN.TYPE.index + 1, (Byte) (rowData.get(COLUMN.TYPE.index)));
prep.setInt(COLUMN.FUNCTIONID.index + 1, (Integer) (rowData.get(COLUMN.FUNCTIONID.index)));
prep.setInt(COLUMN.BINARYID.index + 1, (Integer) (rowData.get(COLUMN.BINARYID.index)));
private TreeInput makeInput(ProfilingData input, int pid, int inputType) {
// table data
- DATableDataFormat tableData = new DATableDataFormat(input.getSequence());
+ DATableDataFormat tableData = new DATableDataFormat(input.getProfilingDataID());
// make input data
if(input.getName().equals(FunctionUsageProfiler.APPLICATION)
if (strProfilingAPIName.trim().contains(
"OnInitializing")) { //$NON-NLS-1$
getDataList().get(j).setInitializeTime(
- controlList.get(i).getExclEsapsedTime());
+ controlList.get(i).getExclElapsedTime());
} else if (strProfilingAPIName.trim().contains(
"OnTerminating")) { //$NON-NLS-1${
getDataList().get(j).setTerminateTime(
- controlList.get(i).getExclEsapsedTime());
+ controlList.get(i).getExclElapsedTime());
}
}
}
public static final int USER_INTERFACE_PROFILING_LIST_EXCL_ESAPSED_AVG_TIME = 8;
public static final int USER_INTERFACE_PROFILING_DATABLEDATAFORMAT_CLASSNAME_INDEX = 10;
- private String strCalssKeyName = null;
- private int strSequence = -1;
+ private String strClassKeyName = null;
+ private int strUIFunctionDataID = -1;
private int pid = -1;
private long longTime = -1;
private String strKey = null;
private String strAPIName = null;
private String strExclCPUTime = null;
private String strInclCPUTime = null;
- private String strInclEsapsedTime = null;
- private String strExclEsapsedTime = null;
+ private String strInclElapsedTime = null;
+ private String strExclElapsedTime = null;
private String strExclCPUAvgTime = null;
private String strInclCPUAvgTime = null;
- private String strInclEsapsedAvgTime = null;
- private String strExclEsapsedAvgTime = null;
+ private String strInclElapsedAvgTime = null;
+ private String strExclElapsedAvgTime = null;
private String strParent = null;
private String strTreeKey = null;
return data;
}
- public void setSequence(int data) {
- strSequence = data;
+ public void setUIFunctionDataID(int data) {
+ strUIFunctionDataID = data;
}
- public int getSequence() {
- return strSequence;
+ public int getUIFunctionDataID() {
+ return strUIFunctionDataID;
}
- public void setCalssKeyName(String data) {
- strCalssKeyName = data;
+ public void setClassKeyName(String data) {
+ strClassKeyName = data;
}
- public String getCalssKeyName() {
- if (strCalssKeyName == null) {
- strCalssKeyName = CommonConstants.EMPTY;
+ public String getClassKeyName() {
+ if (strClassKeyName == null) {
+ strClassKeyName = CommonConstants.EMPTY;
}
- return strCalssKeyName;
+ return strClassKeyName;
}
public void setKey(String data) {
return strInclCPUAvgTime;
}
- public void setInclEsapsedTime(String data) {
- strInclEsapsedTime = data;
+ public void setInclElapsedTime(String data) {
+ strInclElapsedTime = data;
}
- public String getInclEsapsedTime() {
- if (strInclEsapsedTime == null) {
- strInclEsapsedTime = CommonConstants.EMPTY;
+ public String getInclElapsedTime() {
+ if (strInclElapsedTime == null) {
+ strInclElapsedTime = CommonConstants.EMPTY;
}
- return strInclEsapsedTime;
+ return strInclElapsedTime;
}
- public void setInclEsapsedAvgTime(String data) {
- strInclEsapsedAvgTime = data;
+ public void setInclElapsedAvgTime(String data) {
+ strInclElapsedAvgTime = data;
}
- public String getInclEsapsedAvgTime() {
- if (strInclEsapsedAvgTime == null) {
- strInclEsapsedAvgTime = CommonConstants.EMPTY;
+ public String getInclElapsedAvgTime() {
+ if (strInclElapsedAvgTime == null) {
+ strInclElapsedAvgTime = CommonConstants.EMPTY;
}
- return strInclEsapsedAvgTime;
+ return strInclElapsedAvgTime;
}
- public void setExclEsapsedTime(String data) {
- strExclEsapsedTime = data;
+ public void setExclElapsedTime(String data) {
+ strExclElapsedTime = data;
}
- public String getExclEsapsedTime() {
- if (strExclEsapsedTime == null) {
- strExclEsapsedTime = CommonConstants.EMPTY;
+ public String getExclElapsedTime() {
+ if (strExclElapsedTime == null) {
+ strExclElapsedTime = CommonConstants.EMPTY;
}
- return strExclEsapsedTime;
+ return strExclElapsedTime;
}
- public void setExclEsapsedAvgTime(String data) {
- strExclEsapsedAvgTime = data;
+ public void setExclElapsedAvgTime(String data) {
+ strExclElapsedAvgTime = data;
}
- public String getExclEsapsedAvgTime() {
- if (strExclEsapsedAvgTime == null) {
- strExclEsapsedAvgTime = CommonConstants.EMPTY;
+ public String getExclElapsedAvgTime() {
+ if (strExclElapsedAvgTime == null) {
+ strExclElapsedAvgTime = CommonConstants.EMPTY;
}
- return strExclEsapsedAvgTime;
+ return strExclElapsedAvgTime;
}
public int getPid() {
}
pd.setPid(input.getProfileDataMaker().getPid());
- pd.setSequence(input.getSequence());
+ pd.setUIFunctionDataID(input.getProfilingDataID());
pd.setKey(input.getKey());
pd.setAPIName(input.getName());
pd.setExclCPUTime(exTime);
pd.setInclCPUTime(inTime);
- pd.setInclEsapsedTime(exeTime);
- pd.setExclEsapsedTime(inExeTime);
+ pd.setInclElapsedTime(exeTime);
+ pd.setExclElapsedTime(inExeTime);
pd.setExclCPUAvgTime(exAvgTime);
pd.setInclCPUAvgTime(inAvgTime);
- pd.setInclEsapsedAvgTime(exeAvgTime);
- pd.setExclEsapsedAvgTime(inExeAvgTime);
+ pd.setInclElapsedAvgTime(exeAvgTime);
+ pd.setExclElapsedAvgTime(inExeAvgTime);
pd.setParent(input.getParent());
//TODO: ProfilingData.getSaveData is deprecated, below code must be fixed.
// pd.setCalssKeyName(getClassName(input.getSaveData())); // index 10;
UIFunctionProfilingData pd = new UIFunctionProfilingData();
String exTime = CommonConstants.DASH, inTime = CommonConstants.DASH, exeTime = CommonConstants.DASH, inExeTime = CommonConstants.DASH, exAvgTime = CommonConstants.DASH, inAvgTime = CommonConstants.DASH, exeAvgTime = CommonConstants.DASH, inExeAvgTime = CommonConstants.DASH;
pd.setPid(input.getProfileDataMaker().getPid());
- pd.setSequence(0);
+ pd.setUIFunctionDataID(0);
pd.setKey(input.getKey());
pd.setAPIName(input.getParent());
pd.setParent(CommonConstants.EMPTY);
pd.setExclCPUTime(exTime);
pd.setInclCPUTime(inTime);
- pd.setInclEsapsedTime(exeTime);
- pd.setExclEsapsedTime(inExeTime);
+ pd.setInclElapsedTime(exeTime);
+ pd.setExclElapsedTime(inExeTime);
pd.setExclCPUAvgTime(exAvgTime);
pd.setInclCPUAvgTime(inAvgTime);
- pd.setInclEsapsedAvgTime(exeAvgTime);
- pd.setExclEsapsedAvgTime(inExeAvgTime);
+ pd.setInclElapsedAvgTime(exeAvgTime);
+ pd.setExclElapsedAvgTime(inExeAvgTime);
getDataList().add(pd);
}
private TreeInput makeInput(UIFunctionProfilingData input) {
- DATableDataFormat tableData = new DATableDataFormat(input.getSequence());
+ DATableDataFormat tableData = new DATableDataFormat(input.getUIFunctionDataID());
List<String> inputData = new ArrayList<String>();
// make input data
- inputData.add(Integer.toString(input.getSequence()));
+ inputData.add(Integer.toString(input.getUIFunctionDataID()));
inputData.add(input.getAPIName());
- inputData.add(input.getInclEsapsedTime());
- inputData.add(input.getInclEsapsedAvgTime());
- inputData.add(input.getExclEsapsedTime());
- inputData.add(input.getExclEsapsedAvgTime());
+ inputData.add(input.getInclElapsedTime());
+ inputData.add(input.getInclElapsedAvgTime());
+ inputData.add(input.getExclElapsedTime());
+ inputData.add(input.getExclElapsedAvgTime());
inputData.add(input.getInclCPUTime());
inputData.add(input.getInclCPUAvgTime());
inputData.add(input.getExclCPUTime());
inputData.add(input.getExclCPUAvgTime());
- inputData.add(input.getCalssKeyName());
+ inputData.add(input.getClassKeyName());
tableData.getData().addAll(inputData);
if (input.getParent().equals(CommonConstants.EMPTY)) {
List<String> text = new ArrayList<String>();
text.add(input.getAPIName());
- text.add(input.getInclEsapsedTime());
- text.add(input.getInclEsapsedAvgTime());
- text.add(input.getExclEsapsedTime());
- text.add(input.getExclEsapsedAvgTime());
+ text.add(input.getInclElapsedTime());
+ text.add(input.getInclElapsedAvgTime());
+ text.add(input.getExclElapsedTime());
+ text.add(input.getExclElapsedAvgTime());
text.add(input.getInclCPUTime());
text.add(input.getInclCPUAvgTime());
text.add(input.getExclCPUTime());
String strSelectedClassname = UIDataManager.getInstance()
.getTableSeleteClassName();
- if (strSelectedClassname.equals(input.getCalssKeyName())) {
+ if (strSelectedClassname.equals(input.getClassKeyName())) {
output.setSecondSelection(true);
}
return output;