[Desc.] apply multi process filtering by pid 1. function profiling 2. function profiling of Tizen UI
[Issue]
AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NOT_FOUND };\r
\r
// user call check\r
- public final static String USER_BIN_POS = "/opt/apps/"; //$NON-NLS-1$\r
+ public final static String USER_BIN_POS = "/opt/usr/apps/"; //$NON-NLS-1$\r
public final static int USER_CALL = 2;\r
public final static int INTERNAL_CALL = 1;\r
public final static int USER_CALL_CHECK_ERROR = -1;\r
System.out.println("failed - loadProfilingData");\r
isSuccess = false;\r
} else {\r
- int sampleCount = 0;\r
- ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
- .getProfileDataMaker();\r
for (int i = 0; i < dbInfo.size(); i++) {\r
List<String> pInfo = dbInfo.get(i);\r
+ int pid = Integer.parseInt(pInfo.get(ProfilingData.PID_INDEX));\r
// possibility of extensions - network, efl, db, etc...\r
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
+ .getProfileDataMakerByPid(pid);\r
ProfilingData fupData = new ProfilingData(pInfo, profiler);\r
String seq = pInfo.get(ProfilingData.SEQUENCE_INDEX);\r
profiler.getProfilingDataMap().put(Integer.parseInt(seq),\r
profiler.getSymbolSeqHash().put(symbol, seq);\r
UIDataManager.getInstance().getfunctionProfilingDataChecker()\r
.addProfilingData(fupData);\r
- sampleCount += fupData.getExCount();\r
+ // restore total sample count \r
+ profiler.setTotalSampleCount(profiler.getTotalSampleCount()\r
+ + fupData.getExCount());\r
}\r
\r
- ProfilingData ab = profiler\r
- .getProfilingDataByKey(FunctionUsageProfiler.APPLICATION_KEY);\r
- profiler.setAppBin(ab);\r
- ProfilingData dl = profiler\r
- .getProfilingDataByKey(FunctionUsageProfiler.DEPENDENT_LIB_KEY);\r
- profiler.setDependentLib(dl);\r
-\r
- // restore total sample count \r
- profiler.setTotalSampleCount(sampleCount);\r
+ List<Integer> pids = FunctionUsageProfiler.getInstance()\r
+ .getPidsOfProfileDataMakerMap();\r
+ for(int i = 0; i < pids.size(); i++)\r
+ {\r
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
+ .getProfileDataMakerByPid(pids.get(i)); \r
+ ProfilingData ab = profiler\r
+ .getProfilingDataByKey(FunctionUsageProfiler.APPLICATION_KEY);\r
+ profiler.setAppBin(ab);\r
+ ProfilingData dl = profiler\r
+ .getProfilingDataByKey(FunctionUsageProfiler.DEPENDENT_LIB_KEY);\r
+ profiler.setDependentLib(dl);\r
+ }\r
}\r
return isSuccess;\r
}\r
System.out.println("failed - loadProfilingChildData");\r
isSuccess = false;\r
} else {\r
- ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
- .getProfileDataMaker();\r
for (int i = 0; i < dbInfo.size(); i++) {\r
List<String> data = dbInfo.get(i);\r
- if (data.size() < 2) {\r
+ if (data.size() < 2) { // why?\r
continue;\r
}\r
- String seqs = data.get(1);\r
+ int pid = Integer.parseInt(data.get(1)); // 1 == PID_INDEX\r
+ String seqs = data.get(2); // 2 == CHILDLIST_INDEX\r
String[] splitSeqs = seqs.split(CommonConstants.SLASH);\r
List<Integer> childData = new ArrayList<Integer>();\r
for (int ii = 0; ii < splitSeqs.length; ii++) {\r
childData.add(Integer.parseInt(splitSeqs[ii]));\r
}\r
int key = Integer.parseInt(data.get(0));\r
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
+ .getProfileDataMakerByPid(pid);\r
ProfilingData parent = profiler.getProfilingDataMap().get(key);\r
ProfilingChildData child = parent.getChildData();\r
child.getChildren().addAll(childData);\r
ProcessInfo processInfo = pInfoPack.getProcessInfo(time);
return processInfo.getHighestAddress();
}
-
+/*
public void setTotalProfilingSampleCount(int count) {
FunctionUsageProfiler.getInstance().getProfileDataMaker()
.setTotalSampleCount(count);
return FunctionUsageProfiler.getInstance().getProfileDataMaker()
.getTotalSampleCount();
}
-
+*/
public byte[] getReplayEvent() {
return replayEvent;
}
public static final String CUSTOM_COLUMN_ADDR = "addr";//$NON-NLS-1$
public static final String CUSTOM_COLUMN_SEQ = "SeqNumber";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_PID = "Pid";//$NON-NLS-1$
public static final String CUSTOM_COLUMN_API = "api";//$NON-NLS-1$
public static final String CUSTOM_COLUMN_CALLSTACK = "callstack";//$NON-NLS-1$
public static final String CUSTOM_COLUMN_NAME = "name";//$NON-NLS-1$
// "profiling data" table info block
{
- String[] names = { CUSTOM_COLUMN_SEQ, CUSTOM_COLUMN_NAME,
- CUSTOM_COLUMN_EXCOUNT, CUSTOM_COLUMN_INCOUNT,
- CUSTOM_COLUMN_CALL_COUNT, CUSTOM_COLUMN_PARENT,
- CUSTOM_COLUMN_KEY, CUSTOM_COLUMN_INCL_EXETIME,
- CUSTOM_COLUMN_EXCL_EXETIME };
- String[] options = { NOT_NULL, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY,
- EMPTY, EMPTY, EMPTY };
- String[] types = { TEXT, "VARCHAR(512)", TEXT, TEXT, TEXT,
+ String[] names = { CUSTOM_COLUMN_SEQ, CUSTOM_COLUMN_PID,
+ CUSTOM_COLUMN_NAME, CUSTOM_COLUMN_EXCOUNT,
+ CUSTOM_COLUMN_INCOUNT, CUSTOM_COLUMN_CALL_COUNT,
+ CUSTOM_COLUMN_PARENT, CUSTOM_COLUMN_KEY,
+ CUSTOM_COLUMN_INCL_EXETIME, CUSTOM_COLUMN_EXCL_EXETIME };
+ String[] options = { NOT_NULL, NOT_NULL, EMPTY, EMPTY, EMPTY, EMPTY,
+ EMPTY, EMPTY, EMPTY, EMPTY };
+ String[] types = { TEXT, TEXT, "VARCHAR(512)", TEXT, TEXT, TEXT,
"VARCHAR(512)", "VARCHAR(512)", TEXT, TEXT };
DBTableInfo profilingDataTableInfo = new DBTableInfo(
TABLE_NAME_PROFILING_DATA, names, options, types);
// "profiling child data" table info block
{
- String[] names = { CUSTOM_COLUMN_SEQ, CUSTOM_COLUMN_CHILD_LIST };
- String[] options = { NOT_NULL, EMPTY };
- String[] types = { TEXT, "VARCHAR(1024)" };
+ String[] names = { CUSTOM_COLUMN_SEQ, CUSTOM_COLUMN_PID,
+ CUSTOM_COLUMN_CHILD_LIST };
+ String[] options = { NOT_NULL, NOT_NULL, EMPTY };
+ String[] types = { TEXT, TEXT, "VARCHAR(1024)" };
DBTableInfo profilingChildTableInfo = new DBTableInfo(
TABLE_NAME_PROFILING_CHILD_DATA, names, options, types);
tableInfos.set(TABLE_INDEX_PROFILING_CHILD_DATA,
}
public void saveProfilingData() {
- ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
- .getProfileDataMaker();
- HashMap<Integer, ProfilingData> profilingDataMap = profiler
- .getProfilingDataMap();
- List<ProfilingData> pDataList = new ArrayList<ProfilingData>();
- pDataList.addAll(profilingDataMap.values());
-
- DBTableInfo profilingData = DBTableManager.getInstance().getTableInfo(
- DBTableManager.TABLE_INDEX_PROFILING_DATA);
- String insertQuery = profilingData.insertQuery();
-
- List<List<String>> insetData = new ArrayList<List<String>>();
- int size = profilingData.getColumnNames().length;
- int count = pDataList.size();
- for (int i = 0; i < count; i++) {
- List<String> input = pDataList.get(i).getSaveData();
- List<String> insetRowData = new ArrayList<String>();
- int dataSize = input.size();
- for (int ii = 0; ii < size; ii++) {
- if (ii >= dataSize) {
- insetRowData.add(CommonConstants.EMPTY);
- } else {
- insetRowData.add(input.get(ii));
+ List<Integer> pids = FunctionUsageProfiler.getInstance()
+ .getPidsOfProfileDataMakerMap();
+ for(int i = 0; i < pids.size(); i++)
+ {
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+ .getProfileDataMakerByPid(pids.get(i));
+ HashMap<Integer, ProfilingData> profilingDataMap = profiler
+ .getProfilingDataMap();
+ List<ProfilingData> pDataList = new ArrayList<ProfilingData>();
+ pDataList.addAll(profilingDataMap.values());
+
+ DBTableInfo profilingData = DBTableManager.getInstance().getTableInfo(
+ DBTableManager.TABLE_INDEX_PROFILING_DATA);
+ String insertQuery = profilingData.insertQuery();
+
+ List<List<String>> insetData = new ArrayList<List<String>>();
+ int size = profilingData.getColumnNames().length;
+ int count = pDataList.size();
+ for (int j = 0; j < count; j++) {
+ List<String> input = pDataList.get(j).getSaveData();
+ List<String> insetRowData = new ArrayList<String>();
+ int dataSize = input.size();
+ for (int ii = 0; ii < size; ii++) {
+ if (ii >= dataSize) {
+ insetRowData.add(CommonConstants.EMPTY);
+ } else {
+ insetRowData.add(input.get(ii));
+ }
}
+ insetData.add(insetRowData);
}
- insetData.add(insetRowData);
+ insertQuery(insertQuery, insetData);
}
- insertQuery(insertQuery, insetData);
}
public void saveProfilingChildData() {
- ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
- .getProfileDataMaker();
- HashMap<String, ProfilingChildData> profilingDataMap = profiler
- .getChildListMap();
- List<ProfilingChildData> pDataList = new ArrayList<ProfilingChildData>();
- pDataList.addAll(profilingDataMap.values());
-
- DBTableInfo profilingChildData = DBTableManager.getInstance()
- .getTableInfo(DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA);
-
- List<List<String>> insetData = new ArrayList<List<String>>();
- int count = pDataList.size();
- for (int i = 0; i < count; i++) {
- ProfilingChildData data = pDataList.get(i);
- String seqStr = makeLoadFormat(data.getChildren());
- List<String> insetRowData = new ArrayList<String>();
- if (null == seqStr || seqStr.isEmpty()) {
- continue;
+ List<Integer> pids = FunctionUsageProfiler.getInstance()
+ .getPidsOfProfileDataMakerMap();
+ for(int i = 0; i < pids.size(); i++)
+ {
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+ .getProfileDataMakerByPid(pids.get(i));
+ HashMap<String, ProfilingChildData> profilingDataMap = profiler
+ .getChildListMap();
+ List<ProfilingChildData> pDataList = new ArrayList<ProfilingChildData>();
+ pDataList.addAll(profilingDataMap.values());
+
+ DBTableInfo profilingChildData = DBTableManager.getInstance()
+ .getTableInfo(DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA);
+
+ List<List<String>> insetData = new ArrayList<List<String>>();
+ int count = pDataList.size();
+ for (int j = 0; j < count; j++) {
+ ProfilingChildData data = pDataList.get(j);
+ String seqStr = makeLoadFormat(data.getChildren());
+ List<String> insetRowData = new ArrayList<String>();
+ if (null == seqStr || seqStr.isEmpty()) {
+ continue;
+ }
+ insetRowData.add(data.getSeq());
+ insetRowData.add(Integer.toString(data.getPid()));
+ insetRowData.add(seqStr);
+ insetData.add(insetRowData);
}
- insetRowData.add(data.getSeq());
- insetRowData.add(seqStr);
- insetData.add(insetRowData);
+ insertQuery(profilingChildData.insertQuery(), insetData);
}
- insertQuery(profilingChildData.insertQuery(), insetData);
}
/**
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.project.AppInfo;
+import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
+import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
}
return userFunctionBin;
}
+
+ public String getUserFunctionPosition(int pid, long time) {
+ if (userFunctionBin == null || userFunctionBin.isEmpty()) {
+ ProcessInfoPackage processInfoPkg = AnalyzerManager
+ .getProject().getProcessInfo(pid);
+ ProcessInfo processInfo = processInfoPkg.getProcessInfo(time);
+
+ userFunctionBin = new String(processInfo
+ .getMainTargetBinaryPath());
+ }
+ return userFunctionBin;
+ }
public List<CallStackItem> getUserCallstack(int tid) {
if (null == userCallstackByTidMap) {
if (null == selfCallstackUnit) {
String strSelfFuncName = SymbolManager.addr2func(sourceBinPath,
strSelfAddr, isPieBuild, baseAddr);
- String strSelfSymbol = getUserFunctionPosition()
+ String strSelfSymbol = getUserFunctionPosition(pid, time)
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ strSelfFuncName;
selfCallstackUnit = new CallStackUnit(selfAddr, strSelfSymbol, log);
if (null == callerCallstackUnit) {
String strCallerFuncName = SymbolManager.addr2func(sourceBinPath,
strCallerAddr, isPieBuild, baseAddr);
- String strCallerSymbol = getUserFunctionPosition()
+ String strCallerSymbol = getUserFunctionPosition(pid, time)
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ strCallerFuncName;
callerCallstackUnit = new CallStackUnit(callerAddr,
if (null == callerCallstackUnit) {
String strCallerFuncName = SymbolManager.addr2func(sourceBinPath,
strCallerAddr, isPieBuild, baseAddr);
- String strCallerSymbol = getUserFunctionPosition()
+ String strCallerSymbol = getUserFunctionPosition(pid, time)
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ strCallerFuncName;
callerCallstackUnit = new CallStackUnit(callerAddr,
if (null == selfCallstackUnit) {
String strSelfFuncName = SymbolManager.addr2func(sourceBinPath,
strSelfAddr, isPieBuild, baseAddr);
- String strSelfSymbol = getUserFunctionPosition()
+ String strSelfSymbol = getUserFunctionPosition(
+ input.getPid(), input.getTime())
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ strSelfFuncName;
selfCallstackUnit = new CallStackUnit(selfAddr, strSelfSymbol, log);
&& pcAddr <= processInfo.getHighestAddress()) {
/* user callstack create by entry and exit */
AnalyzerManager.getCallstackManager()
- .makeUserCallstack(
- pData,
+ .makeUserCallstack(pData,
FunctionUsageProfiler.getInstance()
- .getProfileDataMaker());
+ .getProfileDataMakerByPid(pData.getPid()));
} else {
AnalyzerManager.getCallstackManager()
.makeCallstackWithoutBacktrace(pData);
private int timeLineFileChartFDCount = 0;
private FailedChecker failedChecker = null;
private WarningChecker warningChecker = null;
- private int preSelectionPId = 1;
+ private int preSelectionPId = -1;
public FileDataMaker(FailedChecker failedChecker,
LeakDetector leakDetector, WarningChecker warningChecker) {
if (null == selfCallstackUnit) {
String strSelfFuncName = SymbolManager.addr2func(binPath,
strSelfAddr, isPieBuild, baseAddr);
- String strSelfSymbol = getUserFunctionPosition()
+ String strSelfSymbol = getUserFunctionPosition(
+ log.getPid(), log.getTime())
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ strSelfFuncName;
selfCallstackUnit = new CallStackUnit(selfAddr, strSelfSymbol, log);
if (null == callerCallstackUnit) {
String strCallerFuncName = SymbolManager.addr2func(binPath,
strCallerAddr, isPieBuild, baseAddr);
- String strCallerSymbol = getUserFunctionPosition()
+ String strCallerSymbol = getUserFunctionPosition(
+ log.getPid(), log.getTime())
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ strCallerFuncName;
callerCallstackUnit = new CallStackUnit(callerAddr,
if (null == callerCallstackUnit) {
String strCallerFuncName = SymbolManager.addr2func(binPath,
strCallerAddr, isPieBuild, baseAddr);
- String strCallerSymbol = getUserFunctionPosition()
+ String strCallerSymbol = getUserFunctionPosition(
+ inputData.getPid(), inputData.getTime())
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ strCallerFuncName;
callerCallstackUnit = new CallStackUnit(callerAddr,
if (null == selfCallstackUnit) {
String strSelfFuncName = SymbolManager.addr2func(binPath,
strSelfAddr, isPieBuild, baseAddr);
- String strSelfSymbol = getUserFunctionPosition()
+ String strSelfSymbol = getUserFunctionPosition(
+ input.getPid(), input.getTime())
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ strSelfFuncName;
selfCallstackUnit = new CallStackUnit(selfAddr, strSelfSymbol,
package org.tizen.dynamicanalyzer.ui.range;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import org.eclipse.swt.SWT;
private LeakDetector leakDetector = null;
private WarningChecker warningChecker = null;
// private FileDataMaker fileDataMaker = null;
- private ProfileDataMaker profileDataMaker = null;
- private ProfileDataMaker swapProfileDataMaker = null;
+ private HashMap<Integer, ProfileDataMaker> profileDataMakerMap = null;
+ private HashMap<Integer, ProfileDataMaker> swapProfileDataMakerMap = null;
private BaseCallstackManager callstackManager = null;
private BaseCallstackManager swapCallstackManager = null;
warningChecker = new WarningChecker();
callstackManager = new CallStackManager();
swapCallstackManager = new SWAPCallStackManager();
- profileDataMaker = new ProfileDataMaker(callstackManager);
- swapProfileDataMaker = new ProfileDataMaker(swapCallstackManager);
// fileDataMaker = new FileDataMaker(failedChecker, leakDetector,
// warningChecker);
failedChecker.clear();
leakDetector.clear();
warningChecker.clear();
- profileDataMaker.clear();
callstackManager.clear();
+ swapCallstackManager.clear();
+ if(profileDataMakerMap != null)
+ profileDataMakerMap.clear();
+ if(swapProfileDataMakerMap != null)
+ swapProfileDataMakerMap.clear();
}
public void initRange() {
return instance;
}
+ public List<Integer> getPidsOfProfileDataMakerMap() {
+ ArrayList<Integer> pids = new ArrayList<Integer>();
+ if (DACommunicator.isSWAPVersion()) {
+ pids.addAll(swapProfileDataMakerMap.keySet());
+ } else {
+ pids.addAll(profileDataMakerMap.keySet());
+ }
+
+ return pids;
+ }
+
+ public ProfileDataMaker getProfileDataMakerByPid(int pid) {
+ ProfileDataMaker profileDataMaker = null;
+ if (DACommunicator.isSWAPVersion()) {
+ if(null == profileDataMakerMap) {
+ profileDataMakerMap = new HashMap<Integer, ProfileDataMaker>();
+ }
+ profileDataMaker = profileDataMakerMap.get(pid);
+ if(null == profileDataMaker) {
+ profileDataMaker = new ProfileDataMaker(callstackManager);
+ profileDataMaker.setPid(pid);
+ profileDataMakerMap.put(pid, profileDataMaker);
+ }
+ } else {
+ if(null == swapProfileDataMakerMap) {
+ swapProfileDataMakerMap = new HashMap<Integer, ProfileDataMaker>();
+ }
+ profileDataMaker = swapProfileDataMakerMap.get(pid);
+ if(null == profileDataMaker) {
+ profileDataMaker = new ProfileDataMaker(swapCallstackManager);
+ profileDataMaker.setPid(pid);
+ swapProfileDataMakerMap.put(pid, profileDataMaker);
+ }
+ }
+ return profileDataMaker;
+ }
+
public FailedChecker getFailedChecker() {
return failedChecker;
}
this.leakDetector = leakDetector;
}
- public ProfileDataMaker getProfileDataMaker() {
- if (DACommunicator.isSWAPVersion()) {
- return swapProfileDataMaker;
- }
- return profileDataMaker;
- }
-
- public void setProfileDataMaker(ProfileDataMaker profileDataMaker) {
- if (DACommunicator.isSWAPVersion()) {
- {
- this.swapProfileDataMaker = profileDataMaker;
- return;
- }
- }
- this.profileDataMaker = profileDataMaker;
- }
-
public WarningChecker getWarningChecker() {
return warningChecker;
}
int size = profileData.size();
for (int i = 0; i < size; i++) {
ProfileData input = (ProfileData) profileData.get(i);
+ ProfileDataMaker profileDataMaker = getProfileDataMakerByPid(input.getPid());
if (input.getId() != DataChannelConstants.MSG_DATA_SAMPLE) {
ProcessInfoPackage processInfoPkg = AnalyzerManager
.getProject().getProcessInfo(input.getPid());
if (pcAddr >= processInfo.getLowestAddress()
&& pcAddr <= processInfo.getHighestAddress()) {
/* user callstack create by entry and exit */
- swapCallstackManager.makeUserCallstack(input,
- swapProfileDataMaker);
+ swapCallstackManager.makeUserCallstack(input,
+ profileDataMaker);
} else {
swapCallstackManager
.makeCallstackWithoutBacktrace(input);
}
} else {
- swapProfileDataMaker
- .makeFunctionUsageProfileData(input);
+ profileDataMaker.makeFunctionUsageProfileData(input);
}
}
package org.tizen.dynamicanalyzer.ui.summary.profiling;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
private static FunctionUsageProfiler instance = null;
- private ProfileDataMaker profileDataMaker = null;
+ private HashMap<Integer, ProfileDataMaker> profileDataMakerMap = null;
/**
* key: symbol(child) or file path (parent) - value : sequence num of
* profiling data. all parent and child data is in
private List<List<LogData>> sampleInputs = null;
private static Thread profiler = null;
- public FunctionUsageProfiler() {
- profileDataMaker = new ProfileDataMaker(
- AnalyzerManager.getCallstackManager());
+ public List<Integer> getPidsOfProfileDataMakerMap() {
+ ArrayList<Integer> pids = new ArrayList<Integer>();
+ pids.addAll(profileDataMakerMap.keySet());
+
+ return pids;
}
-
- public ProfileDataMaker getProfileDataMaker() {
+
+ public ProfileDataMaker getProfileDataMakerByPid(int pid) {
+ if(null == profileDataMakerMap) {
+ profileDataMakerMap = new HashMap<Integer, ProfileDataMaker>();
+ }
+ ProfileDataMaker profileDataMaker = profileDataMakerMap.get(pid);
+ if(null == profileDataMaker) {
+ profileDataMaker = new ProfileDataMaker(
+ AnalyzerManager.getCallstackManager());
+ profileDataMaker.setPid(pid);
+ profileDataMakerMap.put(pid, profileDataMaker);
+ }
return profileDataMaker;
}
}
int size = sample.size();
for (int i = 0; i < size; i++) {
- getInstance().getProfileDataMaker()
+ getInstance().getProfileDataMakerByPid(sample.get(i).getPid())
.makeFunctionUsageProfileData((ProfileData) sample.get(i));
}
}
private HashMap<Integer, CallstackTree> callstackTreeByTidMap = new HashMap<Integer, CallstackTree>();
private int totalSampleCount = 0;
private BaseCallstackManager callstackManager = null;
-
+ private int pid = 0;
+
/**
* key: seq - value : function usage profiling data hash map all function
* usage profiling data are in this hash map
return callstackManager;
}
+ public int getPid() {
+ return pid;
+ }
+
+ public void setPid(int pid) {
+ this.pid = pid;
+ }
+
public String getAppBinName() {
return appBinName;
}
// ApiNameManager.getApiId(functionName);
}
// need to be checked again - in case pid is not main application
- symbol = callstackManager.getUserFunctionPosition()
+ symbol = callstackManager.getUserFunctionPosition(
+ sampleLog.getPid(), sampleLog.getTime())
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ functionName;
} else {
public class ProfilingChildData {
private String seq;
+ int pid;
private List<Integer> children;
- public ProfilingChildData(String seq) {
+ public ProfilingChildData(String seq, int pid) {
this.seq = seq;
+ this.pid = pid;
}
public String getSeq() {
return seq;
}
+ public int getPid() {
+ return pid;
+ }
+
public List<Integer> getChildren() {
if (null == children) {
children = new ArrayList<Integer>();
return children;
}
- public boolean isEualsl(ProfilingChildData input) {
+ public boolean isEqual(ProfilingChildData input) {
if (!input.getSeq().equals(seq)) {
return false;
}
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
public class ProfilingData {
- public static final int DATA_FIELD_SIZE = 9;
+ public static final int DATA_FIELD_SIZE = 10;
public static final int SEQUENCE_INDEX = 0;
- public static final int NAME_INDEX = 1;
- public static final int EXCOUNT_INDEX = 2;
- public static final int INCOUNT_INDEX = 3;
- public static final int CALLCOUNT_INDEX = 4;
- public static final int PARENT_INDEX = 5;
- public static final int KEY_INDEX = 6;
- public static final int INCL_ELAPSED_TIME_INDEX = 7;
- public static final int EXCL_ELAPSED_TIME_INDEX = 8;
+ public static final int PID_INDEX = 1;
+ public static final int NAME_INDEX = 2;
+ public static final int EXCOUNT_INDEX = 3;
+ public static final int INCOUNT_INDEX = 4;
+ public static final int CALLCOUNT_INDEX = 5;
+ public static final int PARENT_INDEX = 6;
+ public static final int KEY_INDEX = 7;
+ public static final int INCL_ELAPSED_TIME_INDEX = 8;
+ public static final int EXCL_ELAPSED_TIME_INDEX = 9;
private static int internalSeq = 0;
private int seq = -1;
public ProfilingChildData getChildData() {
if (null == children) {
- children = new ProfilingChildData(Integer.toString(seq));
+ children = new ProfilingChildData(Integer.toString(seq)
+ , profiler.getPid());
profiler.getChildListMap().put(Integer.toString(seq), children);
}
return children;
output.add(CommonConstants.EMPTY);
}
output.set(SEQUENCE_INDEX, Integer.toString(seq));
+ output.set(PID_INDEX, Integer.toString(profiler.getPid()));
output.set(NAME_INDEX, name);
output.set(EXCOUNT_INDEX, Integer.toString(exCount));
output.set(INCOUNT_INDEX, Integer.toString(inCount));
getChildData().getChildren().add(seq);
}
+ public ProfileDataMaker getProfileDataMaker() {
+ return profiler;
+ }
+
public String getKey() {
return key;
}
import org.tizen.dynamicanalyzer.model.TreeInput;
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
import org.tizen.dynamicanalyzer.ui.range.RangeProfilingView;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
}
}
- private ProfileDataMaker getProfileDataMaker() {
+ private List<Integer> getPidsOfProfileDataMakerMap() {
if (isRange) {
- return RangeDataManager.getInstance().getProfileDataMaker();
+ return RangeDataManager.getInstance()
+ .getPidsOfProfileDataMakerMap();
} else {
- return FunctionUsageProfiler.getInstance().getProfileDataMaker();
+ return FunctionUsageProfiler.getInstance()
+ .getPidsOfProfileDataMakerMap();
+ }
+ }
+
+ private ProfileDataMaker getProfileDataMakerByPid(int pid) {
+ if (isRange) {
+ return RangeDataManager.getInstance()
+ .getProfileDataMakerByPid(pid);
+ } else {
+ return FunctionUsageProfiler.getInstance()
+ .getProfileDataMakerByPid(pid);
}
}
}
}
- private TreeInput makeInput(ProfilingData input, int inputType) {
+ private TreeInput makeInput(ProfilingData input, int pid, int inputType) {
// table data
DATableDataFormat tableData = new DATableDataFormat(input.getSequence());
// make input data
- tableData.setObject(input.getName());
- ProfileDataMaker profiler = getProfileDataMaker();
+ if(input.getName().equals(FunctionUsageProfiler.APPLICATION)
+ || input.getName()
+ .equals(FunctionUsageProfiler.DEPENDENT_LIB)) {
+ tableData.setObject(input.getName() +
+ CommonConstants.SPACE + CommonConstants.OPEN_BRACKET
+ + pid + CommonConstants.CLOSE_BRACKET);
+ } else {
+ tableData.setObject(input.getName());
+ }
+
+ ProfileDataMaker profiler = getProfileDataMakerByPid(pid);
String exTime = "0", exRate = "0.00", inTime = "0", inRate = "0.00", callCount = "0", exeTime = "0", inExeTime = "0"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
try {
// !! recursive!!
public void makeChildTree(List<ProfilingData> children, TreeInput parent,
- String parentName, int type) {
+ String parentName, int pid, int type) {
if (!children.isEmpty()) {
int size = children.size();
for (int i = 0; i < size; i++) {
ProfilingData data = children.get(i);
- TreeInput input = makeInput(data, type);
+ TreeInput input = makeInput(data, pid, type);
if (!data.getChildList().isEmpty()) {
makeChildTree(data.getChildList(), input, data.getName(),
- type);
+ pid, type);
}
parent.getChildren().add(input);
input.setParent(parentName);
@Override
public List<TreeInput> makeTreeInput() {
+ int selectedPid = ToolbarArea.getInstance().getSelectedPid();
List<TreeInput> output = new ArrayList<TreeInput>();
- ProfileDataMaker profiler = getProfileDataMaker();
-
- ProfilingData appBin = profiler.getAppBin();
- if (null != appBin) {
- TreeInput appBinInput = makeInput(appBin,
- AnalyzerConstants.FUPD_APPLICATION);
- {
- List<ProfilingData> children = appBin.getChildList();
- makeChildTree(children, appBinInput, appBin.getName(),
+
+ List<Integer> pids = getPidsOfProfileDataMakerMap();
+ for(int i = 0; i < pids.size(); i++)
+ {
+ int pid = pids.get(i);
+ if(selectedPid != 0 && selectedPid != pid) {
+ continue;
+ }
+ ProfileDataMaker profiler = getProfileDataMakerByPid(pid);
+
+ ProfilingData appBin = profiler.getAppBin();
+ if (null != appBin) {
+ TreeInput appBinInput = makeInput(appBin, pid,
AnalyzerConstants.FUPD_APPLICATION);
+ {
+ List<ProfilingData> children = appBin.getChildList();
+ makeChildTree(children, appBinInput, appBin.getName(),
+ pid, AnalyzerConstants.FUPD_APPLICATION);
+ }
+ output.add(appBinInput);
}
- output.add(appBinInput);
- }
-
- ProfilingData depLib = profiler.getDependentLib();
- if (null != depLib) {
- TreeInput depLibInput = makeInput(depLib,
- AnalyzerConstants.FUPD_DEPENDENT_LIB);
- {
- List<ProfilingData> children = depLib.getChildList();
- makeChildTree(children, depLibInput, depLib.getName(),
+
+ ProfilingData depLib = profiler.getDependentLib();
+ if (null != depLib) {
+ TreeInput depLibInput = makeInput(depLib, pid,
AnalyzerConstants.FUPD_DEPENDENT_LIB);
+ {
+ List<ProfilingData> children = depLib.getChildList();
+ makeChildTree(children, depLibInput, depLib.getName(),
+ pid, AnalyzerConstants.FUPD_DEPENDENT_LIB);
+ }
+ output.add(depLibInput);
}
- output.add(depLibInput);
}
-
return output;
}
}
private String strCalssKeyName = null;
private int strSequence = -1;
+ private int pid = -1;
private long longTime = -1;
private String strKey = null;
private String strInclCPUAvgTime = null;
private String strInclEsapsedAvgTime = null;
private String strExclEsapsedAvgTime = null;
- private String strPId = null;
private String strParent = null;
private String strTreeKey = null;
return strTreeKey;
}
- public void setAPINamee(String data) {
+ public void setAPIName(String data) {
strAPIName = data;
}
return strExclEsapsedAvgTime;
}
- public String getPId() {
- return strPId;
+ public int getPid() {
+ return pid;
}
- public void setPId(String strPId) {
- this.strPId = strPId;
+ public void setPid(int pid) {
+ this.pid = pid;
}
}
}
UIFunctionProfilingData pd = new UIFunctionProfilingData();
+ int pid = input.getProfileDataMaker().getPid();
ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
- .getProfileDataMaker();
+ .getProfileDataMakerByPid(pid);
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;
try {
exTime = profiler.getCpuTime(input, true);
e.printStackTrace();
}
+ pd.setPid(input.getProfileDataMaker().getPid());
pd.setSequence(input.getSequence());
pd.setKey(input.getKey());
- pd.setAPINamee(input.getName());
+ pd.setAPIName(input.getName());
pd.setExclCPUTime(exTime);
pd.setInclCPUTime(inTime);
pd.setInclEsapsedTime(exeTime);
}
public void updateUIApiTreeSet() {
-
- ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
- .getProfileDataMaker();
- if (profiler.getAppBin() == null) {
- return;
- }
- List<ProfilingData> children = profiler.getAppBin().getChildList()
- .get(0).getChildList();
- int size = children.size();
- getUIApiListFile();
- for (int i = 0; i < size; i++) {
- if (i >= isUiApiCheckList.size()) {
- isUiApiCheckList.add(i, UI_API_TRUE);
+ List<Integer> pids = FunctionUsageProfiler.getInstance()
+ .getPidsOfProfileDataMakerMap();
+ for(int i = 0; i < pids.size(); i++)
+ {
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+ .getProfileDataMakerByPid(pids.get(i));
+ if (profiler.getAppBin() == null) {
+ return;
}
- if (isUiApiCheckList.get(i).equals(UI_API_TRUE)) {
- ProfilingData data = children.get(i);
- if (addProfilingData(data)) {
- isUiApiCheckList.add(i, UI_API_TRUE);
- } else {
- isUiApiCheckList.add(i, UI_API_FALSE);
+ List<ProfilingData> children = profiler.getAppBin().getChildList()
+ .get(0).getChildList();
+ int size = children.size();
+ getUIApiListFile();
+ for (int j = 0; j < size; j++) {
+ if (j >= isUiApiCheckList.size()) {
+ isUiApiCheckList.add(j, UI_API_TRUE);
+ }
+ if (isUiApiCheckList.get(j).equals(UI_API_TRUE)) {
+ ProfilingData data = children.get(j);
+ if (addProfilingData(data)) {
+ isUiApiCheckList.add(j, UI_API_TRUE);
+ } else {
+ isUiApiCheckList.add(j, UI_API_FALSE);
+ }
}
}
+ UIDataManager tManager = UIDataManager.getInstance();
+ tManager.getControlDataChecker()
+ .notificationFromUserInterfaceFunctionProfilingDataChecker();
}
- UIDataManager tManager = UIDataManager.getInstance();
- tManager.getControlDataChecker()
- .notificationFromUserInterfaceFunctionProfilingDataChecker();
}
public void cleanUIProfilingMemberData() {
}
public boolean existRootData(ProfilingData input) {
- boolean exitRootData = false;
+ boolean existRootData = false;
for (UIFunctionProfilingData data : getDataList()) {
if (data.getAPIName().equals(input.getParent())) {
- exitRootData = true;
+ existRootData = true;
break;
}
}
- return exitRootData;
+ return existRootData;
}
private void makeRootParentData(ProfilingData input) {
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.setKey(input.getKey());
- pd.setAPINamee(input.getParent());
+ pd.setAPIName(input.getParent());
pd.setParent(CommonConstants.EMPTY);
pd.setExclCPUTime(exTime);
pd.setInclCPUTime(inTime);
inputData.add(input.getCalssKeyName());
tableData.getData().addAll(inputData);
- tableData.setObject(input.getAPIName());
+ if(input.getParent().equals(CommonConstants.EMPTY)) {
+ tableData.setObject(input.getAPIName() + CommonConstants.SPACE
+ + CommonConstants.OPEN_BRACKET + input.getPid()
+ + CommonConstants.CLOSE_BRACKET);
+ } else {
+ tableData.setObject(input.getAPIName());
+ }
List<String> text = new ArrayList<String>();
text.add(input.getAPIName());
int size = controlList.size();
int nNodeDepth = 0;
for (int i = 0; i < size; i++) {
-
int selectedPid = ToolbarArea.getInstance().getSelectedPid();
if (selectedPid != 0) {
- String parentName = controlList.get(i).getParent();
- String apiName = controlList.get(i).getAPIName();
- System.out.println("getParent : " + parentName + " apiName : "
- + apiName);
- if (!parentName.contains(Integer.toString(selectedPid))) {
- continue;
- }
- if (parentName.equals(CommonConstants.EMPTY)
- && !apiName.contains(Integer.toString(selectedPid))) {
+ int pid = controlList.get(i).getPid();
+
+ if(pid != selectedPid) {
continue;
}
}