#Plugin name\r
-pluginName=bada Application Performance Analyzer Workbench Splash\r
+pluginName=Tizen Dynamic Analyzer splash\r
#Provider name\r
providerName=Samsung Electronics\r
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
-<product name="%DynamicAnalyzer" uid="org.tizen.dynamicanalyzer.workbench.product" id="org.tizen.dynamicanalyzer.workbench.product" application="org.tizen.dynamicanalyzer.workbench.application" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="false">
+<product name="%DynamicAnalyzer" uid="org.tizen.dynamicanalyzer.workbench.product" id="org.tizen.dynamicanalyzer.workbench.product" application="org.tizen.dynamicanalyzer.workbench.application" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">
<configIni use="default">
</configIni>
<launcherArgs>
+ <programArgs>-data @noDefault</programArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
<vmArgsWin>-XX:MaxHeapFreeRatio=70
-XX:MinHeapFreeRatio=40
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
+import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
@Override
public Object start(IApplicationContext context) throws Exception {
Display display = PlatformUI.createDisplay();
+
+ Location instanceLoc = Platform.getInstanceLocation();
+ String path = WorkbenchUtils.DYNAMIC_ANALYZER_INSTALL_PATH
+ + File.separator;
+ instanceLoc.set(new URL("file", null, path), false);
+
SimpleDateFormat format = new SimpleDateFormat("yyyy_MM_dd_HH-mm-ss", //$NON-NLS-1$
Locale.KOREA);
Date date = new Date();
elf = new Elf(path);
elf.loadSymbols();
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
return false;
}
public static void setSelectedApp(AppInfo app) {
selectedApp = app;
- if (null != communicator) {
+ if (null != app && null != communicator) {
communicator.setSelectedApp(app);
}
}
System.out.println("device disconnected : "
+ device.getSerialNumber());
DeviceInfo deviceInfo = getDeviceByName(device.getSerialNumber());
+ DeviceInfo selectedDevice = getSelectedDevice();
if (null != devices && !devices.isEmpty()) {
devices.remove(deviceInfo);
if (!AnalyzerManager.isRunning()) {
checkDevices();
}
if (isRunning()) {
- System.out.println("Disconnected while DA is running."); //$NON-NLS-1$
- UIRecorderTool.getInstance().stop();
- DACommunicator.setRunning(false);
+ if (selectedDevice.getIDevice().getSerialNumber()
+ .equals(deviceInfo.getIDevice().getSerialNumber())) {
+ System.out.println("Disconnected while DA is running."); //$NON-NLS-1$
+ UIRecorderTool.getInstance().stop();
+ DACommunicator.setRunning(false);
+ }
}
}
}
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
-import java.util.List;
import java.util.Locale;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.swap.model.control.TargetInfo;
import org.tizen.dynamicanalyzer.swap.model.data.ProcessInfo;
-import org.tizen.dynamicanalyzer.swap.model.probe2.LogDataFactory;
import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
public class Project {
if (null != dbFilePath) {
closeConnection();
}
-
}
return dbInfo;
}
}
ProbeCommonData log = (ProbeCommonData) inputData;
- // String strSeq = input[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
- // String strTid = input[LogCenterConstants.THREAD_ID_INDEX];
- // String strCallerAddr = input[LogCenterConstants.CALLER_PCADDR_INDEX];
-
- // int seq = Integer.parseInt(strSeq);
- // int tid = Integer.parseInt(strTid);
int seq = log.getSeq();
int tid = log.getTid();
- // long callerAddr = 0;
long callerAddr = log.getCallerPcAddr();
// if (!strCallerAddr.isEmpty()) {
// callerAddr = Long.parseLong(strCallerAddr);
}
String strCallerAddr = Long.toString(callerAddr);
+ System.out.println("tid :" + tid);
List<CallStackUnit> probeCallstack = new ArrayList<CallStackUnit>(
getUserCallstack(tid));
+// List<CallStackUnit> probeCallstack =
+// getUserCallstack(tid);
int size = probeCallstack.size();
CallStackData callstackData = new CallStackData(seq);
// return HostResult.ERR_BIN_INFO_GET_FAIL;
binaryPath = CommonConstants.EMPTY;
}
+
StringBuffer strBuf = new StringBuffer();
strBuf.append(binaryDir).append(File.separator)
.append(selectedApp.getExecFileName(appInfo.getAppType()));
binaryPath = strBuf.toString();
binInfo.setType(binaryType);
+ binInfo.setPath(binaryPath);
// host has no binary file - pull binary file from target
// change binary file path of host
private void logSlicing(List<LogData> logLumb) {
int size = logLumb.size();
LogPackage logPack = new LogPackage();
-// System.out.println(" log lumb size " + size);
+ // System.out.println(" log lumb size " + size);
for (int i = 0; i < size; i++) {
if (null == logLumb.get(i)) {
continue;
BaseView bv = (BaseView) AnalyzerUtil.getViewPart(BaseView.ID);
bv.getMainTab().updateLog(logPack);
- // System.out.println("view update!!");
+ // System.out.println("view update!!");
}
private void setFuncName(ProfileData input) {
.getType() == 1) ? true : false;
String baseAddr = Long.toString(AnalyzerManager.getProject()
.getBaseAddress());
- // String path = AnalyzerManager.getProject().getBinaryPath();
+ String highAddr = Long.toString(AnalyzerManager.getProject()
+ .getHighestAddress());
String path = DACommunicator.getSelectedApp().getBinInfo().getPath();
- // String path = DACommunicator.getSelectedApp().getBinInfo().getPath();
String pcAddr = Long.toString(input.getPcAddr());
String functionName = SymbolManager.addr2func(path, pcAddr, isPieBuild,
baseAddr);
+ System.out.println("function name : " + functionName + "[ low :"
+ + baseAddr + " high : " + highAddr + " pcAddr : " + pcAddr + " ]");
if (null == functionName || functionName.isEmpty()
|| functionName.equals("_end")) { //$NON-NLS-1$
functionName = InformationViewLabels.CALLSTACK_TABLE_UNKNOWN_FUNCTION;
.demanglingFunctionName(prevFunctionName);
ApiNameManager.getApiId(functionName);
}
-
input.setApiName(functionName);
}
return temp;
}
+ @SuppressWarnings({ "unused", "unchecked" })
public static byte[] getByte(final Object... objects) {
if (null == objects) {
return null;
int line = 0;
for (int i = 0; i < input.length; i++, line++) {
String b = String.format("%2x", input[i]);
- // System.out.print(b + " ");
+ System.out.print(b + " ");
if (line == 9) {
- // System.out.print(" ");
+ System.out.print(" ");
}
if (line == 19) {
- // System.out.println();
+ System.out.println();
line = -1;
}
}
AnalyzerConstants.SORT_TYPE_STRING,
AnalyzerConstants.SORT_TYPE_STRING,
AnalyzerConstants.SORT_TYPE_STRING,
- AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID };
+ AnalyzerConstants.SORT_TYPE_STRING, AnalyzerConstants.SORT_TYPE_STRING };
protected int[] sourceColumns = { LogCenterConstants.SEQUENCE_NUMBER_INDEX,
LogCenterConstants.TIME_INDEX, LogCenterConstants.APINAME_INDEX,
LogCenterConstants.INPUTPARM_INDEX,
for (int i = 0; i < size; i++) {
// create text
List<String> text = new ArrayList<String>();
+ List<String> data = new ArrayList<String>();
+
FailedData2 failedData = failedList.get(i);
text.add(Integer.toString(failedData.getSeq()));
String time = Formatter.toTimeFormat(failedData.getTime());
text.add(time);
+ data.add(time);
text.add(failedData.getName());
+ data.add(failedData.getName());
text.add(failedData.getArgs());
+ data.add(failedData.getArgs());
text.add(Long.toString(failedData.getReturn()));
+ data.add(Long.toString(failedData.getReturn()));
+
String errCode = ErrorCodeManager.getInatance()
.getErrorCode(failedData.getErrorCode()).name();
if (null == errCode) {
errCode = "undefined error number"; //$NON-NLS-1$
}
text.add(errCode);
+ data.add(Long.toString(failedData.getErrorCode()));
String errMsg = ErrorCodeManager.getInatance().getErrorDescription(
failedData.getErrorCode());
errMsg = "undefined error number"; //$NON-NLS-1$
}
text.add(errMsg);
+ data.add(Long.toString(failedData.getErrorCode()));
// create images
failedData.getSeq());
tableData.setObject(failedData);
tableData.setLogData(failedData.getData());
+ tableData.getData().addAll(data);
TableInput tableInput = new TableInput();
tableInput.setText(text);
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.summary.leaks;
+
+import java.util.HashMap;
+
+public class LeakCheckList {
+ private static HashMap<String, LeakInfo> leakCheckList = null;
+
+ public static HashMap<String, LeakInfo> getLeakCheckList() {
+ if (null == leakCheckList) {
+ init();
+ }
+ return leakCheckList;
+ }
+
+ private static void init() {
+ leakCheckList = new HashMap<String, LeakInfo>();
+
+ /** memory leak check list */
+ LeakInfo info = new LeakInfo("malloc", LeakDetector.API_TYPE_OPEN, true);
+ leakCheckList.put("malloc", info);
+
+ info = new LeakInfo("free", LeakDetector.API_TYPE_CLOSE, true);
+ leakCheckList.put("free", info);
+
+ info = new LeakInfo("realloc", LeakDetector.API_TYPE_REALLOC, true);
+ leakCheckList.put("realloc", info);
+
+ info = new LeakInfo("calloc", LeakDetector.API_TYPE_OPEN, true);
+ leakCheckList.put("calloc", info);
+
+ /** file leak check list */
+ info = new LeakInfo("open", LeakDetector.API_TYPE_OPEN, true);
+ leakCheckList.put("open", info);
+
+ info = new LeakInfo("close", LeakDetector.API_TYPE_CLOSE, true);
+ leakCheckList.put("close", info);
+
+ info = new LeakInfo("fopen", LeakDetector.API_TYPE_OPEN, true);
+ leakCheckList.put("fopen", info);
+
+ info = new LeakInfo("fclose", LeakDetector.API_TYPE_CLOSE, true);
+ leakCheckList.put("fclose", info);
+
+ info = new LeakInfo("File::Construct", LeakDetector.API_TYPE_OPEN,
+ false);
+ leakCheckList.put("File::Construct", info);
+
+ info = new LeakInfo("File::~File", LeakDetector.API_TYPE_CLOSE, false);
+ leakCheckList.put("File::~File", info);
+
+ /** new - delete */
+ info = new LeakInfo("new", LeakDetector.API_TYPE_OPEN, true);
+ leakCheckList.put("new", info);
+
+ info = new LeakInfo("delete", LeakDetector.API_TYPE_CLOSE, true);
+ leakCheckList.put("delete", info);
+
+ /** etc.. */
+ info = new LeakInfo("app_get_name", LeakDetector.API_TYPE_OPEN, false);
+ leakCheckList.put("app_get_name", info);
+
+ info = new LeakInfo("app_get_data_directory",
+ LeakDetector.API_TYPE_OPEN, false);
+ leakCheckList.put("app_get_data_directory", info);
+
+ info = new LeakInfo("app_get_package", LeakDetector.API_TYPE_OPEN,
+ false);
+ leakCheckList.put("app_get_package", info);
+
+ info = new LeakInfo("app_get_version", LeakDetector.API_TYPE_OPEN,
+ false);
+ leakCheckList.put("app_get_version", info);
+
+ }
+}
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.model.Check;
-import org.tizen.dynamicanalyzer.model.LeakCheckList;
import org.tizen.dynamicanalyzer.swap.model.probe2.LeakData2;
import org.tizen.dynamicanalyzer.swap.model.probe2.LogData;
import org.tizen.dynamicanalyzer.swap.model.probe2.ProbeCommonData;
private int leakSeq = 0;
public LeakDetector() {
- LeakCheckList leakCheckList = AnalyzerManager.getLeakCheckList();
- if (leakCheckList != null) {
- leakCheckHash = new HashMap<String, Check>();
-
- List<Check> checks = leakCheckList.getChecks();
- int size = checks.size();
- for (int i = 0; i < size; i++) {
- leakCheckHash.put(checks.get(i).getName(), checks.get(i));
- }
- }
+ // LeakCheckList leakCheckList = AnalyzerManager.getLeakCheckList();
+ // if (leakCheckList != null) {
+ // leakCheckHash = new HashMap<String, Check>();
+ //
+ // List<Check> checks = leakCheckList.getChecks();
+ // int size = checks.size();
+ // for (int i = 0; i < size; i++) {
+ // leakCheckHash.put(checks.get(i).getName(), checks.get(i));
+ // }
+ // }
}
public List<LeakData2> getLeakDataList() {
return childHash;
}
- public HashMap<String, Check> getLeakCheckHash() {
- if (null == leakCheckHash) {
- leakCheckHash = new HashMap<String, Check>();
- LeakCheckList leakCheckList = AnalyzerManager.getLeakCheckList();
- if (null != leakCheckList) {
- List<Check> checks = leakCheckList.getChecks();
- if (null != checks) {
- int size = checks.size();
- for (int i = 0; i < size; i++) {
- leakCheckHash.put(checks.get(i).getName(),
- checks.get(i));
- }
- }
- }
- }
- return leakCheckHash;
- }
+ // public HashMap<String, Check> getLeakCheckHash() {
+ // if (null == leakCheckHash) {
+ // leakCheckHash = new HashMap<String, Check>();
+ // LeakCheckList leakCheckList = AnalyzerManager.getLeakCheckList();
+ // if (null != leakCheckList) {
+ // List<Check> checks = leakCheckList.getChecks();
+ // if (null != checks) {
+ // int size = checks.size();
+ // for (int i = 0; i < size; i++) {
+ // leakCheckHash.put(checks.get(i).getName(),
+ // checks.get(i));
+ // }
+ // }
+ // }
+ // }
+ // return leakCheckHash;
+ // }
public void runLeakDectect(LogData logData) {
ProbeCommonData log = (ProbeCommonData) logData;
}
// step 1 : check "open" or "close"
- Check chk; // 0: open , 1: close
- if (null == getLeakCheckHash().get(apiName)) {
+ // Check chk; // 0: open , 1: close
+ // if (null == getLeakCheckHash().get(apiName)) {
+ // return;
+ // } else {
+ // chk = getLeakCheckHash().get(apiName);
+ // }
+
+ LeakInfo chk = null;
+ if (null == LeakCheckList.getLeakCheckList().get(apiName)) {
return;
} else {
- chk = getLeakCheckHash().get(apiName);
+ chk = LeakCheckList.getLeakCheckList().get(apiName);
}
HashMap<Integer, LeakData2> leaks = getLeakHash();
- if (chk.getType() == API_TYPE_OPEN) {
+ if (chk.getApiType() == API_TYPE_OPEN) {
if (chk.isCheckUserCall()) {
checkUserFuncLeakData(logData, chk);
} else {
LeakData2 newLeak = new LeakData2(logData, this);
leaks.put(logData.getKey(), newLeak);
}
- } else if (chk.getType() == API_TYPE_CLOSE) {
+ } else if (chk.getApiType() == API_TYPE_CLOSE) {
int key = log.getKey();
LeakData2 freeData = getChildHash().get(key);
if (null != freeData) {
leaks.remove(key);
}
- } else if (chk.getType() == API_TYPE_REALLOC) {
+ } else if (chk.getApiType() == API_TYPE_REALLOC) {
// System.out.println("realloc!! " + input);
// free index = input param 1st
-// String inputParam = input[LogCenterConstants.INPUTPARM_INDEX];
- String inputParam = ((ProbeCommonData)log).getArgs();
+ // String inputParam = input[LogCenterConstants.INPUTPARM_INDEX];
+ String inputParam = ((ProbeCommonData) log).getArgs();
String[] splitInputParam = inputParam.split("\\,"); //$NON-NLS-1$
int rmKey = Integer.parseInt(splitInputParam[0]);
leaks.remove(rmKey);
if (chk.isCheckUserCall()) {
checkUserFuncLeakData(log, chk);
} else {
-// String key = input[chk.getKeyIndex()];
-// leaks.put(key, new LeakData(key, input, this));
+ // String key = input[chk.getKeyIndex()];
+ // leaks.put(key, new LeakData(key, input, this));
int key = log.getKey();
leaks.put(key, new LeakData2(log, this));
}
}
}
- private void checkUserFuncLeakData(LogData log, Check chk) {
+ private void checkUserFuncLeakData(LogData log, LeakInfo chk) {
HashMap<Integer, CallStackData> cdMap = AnalyzerManager
.getCallstackManager().getCallStackDataBySeqMap();
// HashMap<Long, String> apiMap = LogSpliter.getCallStackApiByAddrMap();
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.summary.leaks;
+
+public class LeakInfo {
+ private String apiName = null;
+ private int apiType = -1;
+ private boolean checkUserCall = false;
+
+ public LeakInfo(String name, int type, boolean usercall) {
+ apiName = name;
+ apiType = type;
+ checkUserCall = usercall;
+ }
+
+ public String getApiName() {
+ return apiName;
+ }
+
+ public int getApiType() {
+ return apiType;
+ }
+
+ public boolean isCheckUserCall() {
+ return checkUserCall;
+ }
+
+}
} else {
LogParser.stopLogParser();
}
- percent += 10;
+ percent += 5;
StopProcessManager.getInstance().setValue(percent);
- LogInserter.stopInsertLogThread();
- percent += 10;
- StopProcessManager.getInstance().setValue(percent);
FileChartManager.getInstance().stopUpdateLogThread();
- percent += 10;
+ percent += 5;
StopProcessManager.getInstance().setValue(percent);
ThreadChartManager.getInstance().stopUpdateLogThread();
FunctionUsageProfiler.stopProfiler();
- percent += 10;
+ percent += 5;
StopProcessManager.getInstance().setValue(percent);
UIDataManager.getInstance().stopUpdateLogThread();
- percent += 10;
+ percent += 5;
StopProcessManager.getInstance().setValue(percent);
UpdateViewTimer.stop();
- percent += 10;
+ percent += 5;
StopProcessManager.getInstance().setValue(percent);
LogInserter.stopInsertLogThread();
- percent += 10;
+ percent += 5;
StopProcessManager.getInstance().setValue(percent);
UIRecorderTool.getInstance().stop();
- percent += 10;
+ percent += 5;
StopProcessManager.getInstance().setValue(percent);
/* save Project */