import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
-import org.tizen.dynamicanalyzer.utils.InternalLogManager;
import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
import org.tizen.dynamicanalyzer.workbench.SingletonFocusManager;
DA_LOG.debug("auto start : " + appid);
DeviceInfo device = DACommunicator.getDeviceByName(deviceName);
- DACommunicator.setSelectedDevice(device);
+ GlobalInformation.setCurrentDeviceInfo(device);
- List<AppInfo> appList = DACommunicator.getSelectedDevice().getAppInfoList();
+ List<AppInfo> appList = device.getAppInfoList();
AppInfo appInfo = null;
for (int i = 0; i < appList.size(); i++) {
public abstract void closeSock();
- public void setSelectedApp(AppInfo app) {
+ public void onAppSelected(AppInfo app) {
}
}
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.HostResult;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.model.DeviceInfo;
isArm = 1;
}
- DeviceInfo device = DACommunicator.getSelectedDevice();
+ DeviceInfo device = GlobalInformation.getCurrentDeviceInfo();
if (null != device
&& device.getIDevice().getSerialNumber()
.startsWith(CommonConstants.EMULATOR)) {
isEmul = 1;
}
- if (null == DACommunicator.getSelectedApp()) {
+ if (null == GlobalInformation.getCurrentApplication()) {
return HostResult.ERR_SELECTED_APP_IS_NULL;
}
- String rearMessage = CommonConstants.EMPTY + res + isEmul + isArm
+ String rearMessage = CommonConstants.EMPTY
+ + res
+ + isEmul
+ + isArm
+ CommonConstants.CMD_SPLIT
+ ConfigureManager.getInstance().getConfiguration(device)
+ CommonConstants.CMD_SPLIT
- + DACommunicator.getSelectedApp().getInfo(AppInfo.EXEC_INDEX);
+ + GlobalInformation.getCurrentApplication().getInfo(
+ AppInfo.EXEC_INDEX);
String message = AnalyzerConstants.MSG_START
+ CommonConstants.CMD_SPLIT + rearMessage.length()
controlWriter.flush();
}
- DA_LOG.debug("wait for ack... [send message : " + message+ " ]");
+ DA_LOG.debug("wait for ack... [send message : " + message + " ]");
while (DACommunicator.isRunning()) {
char cbuf[] = new char[64];
blocked = true;
.execCommand(AnalyzerShellCommands.DACOMMAND_RUN_MANAGER);
// step 3. get remote port from /tmp/port.da in device or emul
- remotePort = CommunicatorUtils.getRemotePort(DACommunicator
- .getSelectedDevice().getIDevice());
+ remotePort = CommunicatorUtils.getRemotePort(GlobalInformation
+ .getCurrentDeviceInfo().getIDevice());
if (remotePort < 0) {
return HostResult.ERR_REMOTE_PORT_GET_FAILED;
}
import org.tizen.common.sdb.command.SdbCommand;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.HostResult;
import org.tizen.dynamicanalyzer.common.path.PathConstants;
import org.tizen.dynamicanalyzer.common.path.PathManager;
public class CommunicatorUtils {
private static final DALogger DA_LOG = DALogger.getInstance();
-
+
private static List<String> uploadDataResult = new ArrayList<String>();
private static boolean isArch = false;
private static final int PORT_WAIT_TIME = 5 * 1000 * 2; // ms
return HostResult.ERR_FILE_IS_NOT_EXISTS;
}
- result = uploadFile(DACommunicator.getSelectedDevice().getIDevice(),
- source, PathConstants.DA_REMOTE_PATH
- + AnalyzerConstants.READELF_BIN);
+ result = uploadFile(GlobalInformation.getCurrentDeviceInfo()
+ .getIDevice(), source, PathConstants.DA_REMOTE_PATH
+ + AnalyzerConstants.READELF_BIN);
if (!result.isSuccess()) {
return result;
}
public static void execShellCommand(String command,
IShellOutputReceiver receiver) {
- DeviceInfo currentDevice = DACommunicator.getSelectedDevice();
+ DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo();
if (null != currentDevice && isOnline(currentDevice.getIDevice())) {
try {
currentDevice.getIDevice().executeShellCommand(command,
public static SyncResult pull(String remote, String local,
ISyncProgressMonitor monitor) {
SyncResult result = null;
- DeviceInfo currentDevice = DACommunicator.getSelectedDevice();
+ DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo();
if (null != currentDevice && isOnline(currentDevice.getIDevice())) {
FileOutputStream fileOut = null;
try {
String line = portLines.get(0);
try {
remotePort = Integer.parseInt(line);
- DA_LOG.debug(" !! \nport get success!! : "
- + remotePort);
+ DA_LOG.debug(" !! \nport get success!! : " + remotePort);
break;
} catch (NumberFormatException e) {
System.out.print("=");
}
public static HostResult foward(int local, int remote) {
- DeviceInfo currentDevice = DACommunicator.getSelectedDevice();
+ DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo();
return foward(currentDevice.getIDevice(), local, remote);
}
public static void unfoward(int local, int remote) {
- DeviceInfo currentDevice = DACommunicator.getSelectedDevice();
+ DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo();
unfoward(currentDevice.getIDevice(), local, remote);
}
}
public static void removeCommand(String path) {
- DeviceInfo currentDevice = DACommunicator.getSelectedDevice();
+ DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo();
if (null != currentDevice && isOnline(currentDevice.getIDevice())) {
try {
currentDevice.getIDevice().executeShellCommand(
public static void execHostCommand(String command,
IShellOutputReceiver receiver) {
- DeviceInfo currentDevice = DACommunicator.getSelectedDevice();
+ DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo();
if (null != currentDevice && isOnline(currentDevice.getIDevice())) {
try {
currentDevice.getIDevice()
}
public static Process execCommand(String command) {
- DeviceInfo currentDevice = DACommunicator.getSelectedDevice();
+ DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo();
if (null != currentDevice) {
return execCommand(currentDevice.getIDevice(), command);
}
import org.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.HostResult;
import org.tizen.dynamicanalyzer.common.path.PathConstants;
import org.tizen.dynamicanalyzer.common.path.PathManager;
public class DACommunicator {
private static final DALogger DA_LOG = DALogger.getInstance();
-
+
public static int MSG_TYPE_CONFIG = 0;
public static int MSG_TYPE_SWAP_INST = 1;
public static int READ_BUFFER_SIZE = 1024;
private static List<String> packageInfoMultiLines = new ArrayList<String>();
- private static AppInfo selectedApp = null;
-
private static List<DeviceInfo> devices = null;
- private static DeviceInfo currentDevice = null;
private static List<String> filterMultiLines = new ArrayList<String>();
private static List<String> unittestList = new ArrayList<String>();
}
public static HostResult startTrace() {
- return currentDevice.getCommunicator().startTrace();
+ return GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .startTrace();
}
public static HostResult sendRuntimeMessage(int type, String message) {
- return currentDevice.sendRuntimeMessage(type, message);
+ return GlobalInformation.getCurrentDeviceInfo().sendRuntimeMessage(
+ type, message);
}
public static HostResult stopTrace() {
- return currentDevice.getCommunicator().stopTrace();
+ return GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .stopTrace();
}
public static void exit() {
- currentDevice.getCommunicator().exit();
+ GlobalInformation.getCurrentDeviceInfo().getCommunicator().exit();
}
public static void reload() {
setNewBridge();
- selectedApp = null;
- currentDevice = null;
isRunning = false;
devices = null;
packageInfoMultiLines.clear();
return null;
}
- public static DeviceInfo getSelectedDevice() {
- return currentDevice;
- }
-
- public static void setSelectedDevice(DeviceInfo device) {
- currentDevice = device;
- }
-
- public static AppInfo getSelectedApp() {
- return selectedApp;
- }
-
public static PackageInfo getSelectedPackage() {
- return getSelectedDevice().getPackageInfoHash().get(
- selectedApp.getPackageId());
- }
-
- public static void setSelectedApp(AppInfo app) {
- selectedApp = app;
- if (null != app && null != currentDevice) {
- currentDevice.getCommunicator().setSelectedApp(app);
- }
+ return GlobalInformation.getCurrentDeviceInfo().getPackageInfoHash()
+ .get(GlobalInformation.getCurrentApplication().getPackageId());
}
public static void setNewBridge() {
if (!devs.isEmpty()) {
init(devs);
if (!getDevices().isEmpty()) {
- setSelectedDevice(devs.get(0));
+ GlobalInformation.setCurrentDeviceInfo(devs.get(0));
}
}
} else {
}
public static List<AppInfo> getAppListFromTarget() {
- if (null == currentDevice) {
+ if (null == GlobalInformation.getCurrentDeviceInfo()) {
return null;
}
- List<AppInfo> appInfoList = currentDevice.getAppInfoList();
- HashMap<String, AppInfo> appInfoHash = currentDevice.getAppInfoHash();
+ List<AppInfo> appInfoList = GlobalInformation.getCurrentDeviceInfo()
+ .getAppInfoList();
+ HashMap<String, AppInfo> appInfoHash = GlobalInformation
+ .getCurrentDeviceInfo().getAppInfoHash();
List<AppInfo> backList = new ArrayList<AppInfo>();
backList.addAll(appInfoHash.values());
}
lines.add(packageInfoMultiLines.get(ii + i));
}
- AppInfo appInfo = makePackageInfo(currentDevice, lines);
+ AppInfo appInfo = makePackageInfo(
+ GlobalInformation.getCurrentDeviceInfo(), lines);
if (null != appInfo
&& (appInfo.getInfo(AppInfo.APPTYPE_INDEX).contains(
- AppInfo.APPTYPE_CPP) || appInfo.getInfo(
- AppInfo.APPTYPE_INDEX).contains(
- AppInfo.APPTYPE_WEB))
+ AppInfo.APPTYPE_CPP)
+ || appInfo.getInfo(AppInfo.APPTYPE_INDEX)
+ .contains(AppInfo.APPTYPE_WEB) || appInfo
+ .getInfo(AppInfo.APPTYPE_INDEX).contains(
+ AppInfo.APPTYPE_CAPP))
&& appInfo.getInfo(AppInfo.MULTIPLE_INDEX).equals(
AppInfo.FLAG_ZERO)
&& appInfo.getInfo(AppInfo.NODISPLAY_INDEX).equals(
private static void checkUnittest() {
unittestList.clear();
- if (null == currentDevice) {
+ if (null == GlobalInformation.getCurrentDeviceInfo()) {
return;
}
- String appInstallPath = currentDevice.getIDevice().getAppInstallPath();
+ String appInstallPath = GlobalInformation.getCurrentDeviceInfo()
+ .getIDevice().getAppInstallPath();
filterMultiLines.clear();
CommunicatorUtils.execHostCommand(
private static void checkIME() {
imeList.clear();
- if (null == currentDevice) {
+ if (null == GlobalInformation.getCurrentDeviceInfo()) {
return;
}
}
public static AppInfo getPkgInfoByName(String appLabel) {
- if (null != currentDevice) {
- int size = currentDevice.getAppInfoList().size();
+ if (null != GlobalInformation.getCurrentDeviceInfo()) {
+ int size = GlobalInformation.getCurrentDeviceInfo()
+ .getAppInfoList().size();
for (int i = 0; i < size; i++) {
- AppInfo pkgInfo = currentDevice.getAppInfoList().get(i);
+ AppInfo pkgInfo = GlobalInformation.getCurrentDeviceInfo()
+ .getAppInfoList().get(i);
if (pkgInfo.getInfo(AppInfo.LABEL_INDEX).equals(appLabel)) {
return pkgInfo;
}
}
public static AppInfo getPkgInfoByAppPkgId(String pkgid) {
- if (null != currentDevice) {
- int size = currentDevice.getAppInfoList().size();
+ if (null != GlobalInformation.getCurrentDeviceInfo()) {
+ int size = GlobalInformation.getCurrentDeviceInfo()
+ .getAppInfoList().size();
for (int i = 0; i < size; i++) {
- AppInfo ai = currentDevice.getAppInfoList().get(i);
+ AppInfo ai = GlobalInformation.getCurrentDeviceInfo()
+ .getAppInfoList().get(i);
if (ai.getInfo(AppInfo.PACKAGE_INDEX).equals(pkgid)) {
return ai;
}
}
public static boolean isTargetEmulator() {
- DeviceInfo device = getSelectedDevice();
+ DeviceInfo device = GlobalInformation.getCurrentDeviceInfo();
if (device != null) {
if (device.getIDevice().getSerialNumber()
.contains(CommonConstants.EMULATOR)) {
@Override
public void onDisconnected(IDevice device) {
// called : each device disconnected time
- DA_LOG.debug("device disconnected : "
- + device.getSerialNumber());
+ DA_LOG.debug("device disconnected : " + device.getSerialNumber());
DeviceInfo deviceInfo = getDeviceByName(device.getSerialNumber());
- DeviceInfo selectedDevice = getSelectedDevice();
+ DeviceInfo selectedDevice = GlobalInformation
+ .getCurrentDeviceInfo();
if (null != devices && !devices.isEmpty()) {
devices.remove(deviceInfo);
if (!AnalyzerManager.isRunning()) {
updateToolbarDevice();
}
}
- if (null != getSelectedDevice() && null != getSelectedApp()) {
+ if (null != GlobalInformation.getCurrentDeviceInfo()
+ && null != GlobalInformation.getCurrentApplication()) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
public void onChanged(IDevice device, int changeMask) {
// called : device added - already dynamic-analyzer running (not
// tracing)
- DA_LOG.debug("device changed : " + device.getSerialNumber()
- + " " + changeMask);
+ DA_LOG.debug("device changed : " + device.getSerialNumber() + " "
+ + changeMask);
if (1 == changeMask) {
if (!AnalyzerManager.isRunning()) {
DeviceInfo devInfo = new DeviceInfo(device);
updateToolbarDevice();
}
}
- if (null != getSelectedDevice() && null != getSelectedApp()) {
+ if (null != GlobalInformation.getCurrentDeviceInfo()
+ && null != GlobalInformation.getCurrentApplication()) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
@Override
public void run() {
List<String> deviceSerials = new ArrayList<String>();
- String selectedDevice = ToolbarArea.getInstance()
- .getSelectedDevice();
+ String selectedDevice = null;
+ DeviceInfo selDev = GlobalInformation.getCurrentDeviceInfo();
+ if (selDev != null)
+ selectedDevice = selDev.getIDevice().getSerialNumber();
int size = getDevices().size();
int selIndex = 0;
for (int i = 0; i < size; i++) {
}
}
if (!devices.isEmpty()) {
- setSelectedDevice(devices.get(selIndex));
+ GlobalInformation.setCurrentDeviceInfo(devices
+ .get(selIndex));
} else {
clearDeviceAppInfo();
}
}
private static void clearDeviceAppInfo() {
- setSelectedDevice(null);
- setSelectedApp(null);
+ GlobalInformation.setCurrentDeviceInfo(null);
+ GlobalInformation.setCurrentApplication(null);
packageInfoMultiLines.clear();
}
- public static void setSelectedDeviceBySerial(String serial) {
+ public static DeviceInfo setSelectedDeviceBySerial(String serial) {
+ DeviceInfo dev = null;
if (null == serial || serial.isEmpty()) {
- setSelectedDevice(null);
+ GlobalInformation.setCurrentDeviceInfo(null);
} else {
int size = getDevices().size();
for (int i = 0; i < size; i++) {
IDevice idev = devices.get(i).getIDevice();
if (null != idev) {
if (serial.equals(idev.getSerialNumber())) {
- setSelectedDevice(devices.get(i));
+ dev = devices.get(i);
+ GlobalInformation.setCurrentDeviceInfo(dev);
break;
}
}
}
}
+
+ return dev;
}
public static void pullDaemonLog() {
// }
public static boolean isWaitControlMessage() {
- return currentDevice.getCommunicator().isBlocked();
+ return GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .isBlocked();
}
public static BufferedReader getSockBufferedReader() {
- return currentDevice.getCommunicator().getDataBufferedReader();
+ return GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .getDataBufferedReader();
}
public static void closeAll() {
- currentDevice.getCommunicator().clear();
+ GlobalInformation.getCurrentDeviceInfo().getCommunicator().clear();
}
public static void closeSock() {
- currentDevice.getCommunicator().closeSock();
+ GlobalInformation.getCurrentDeviceInfo().getCommunicator().closeSock();
}
public static HostResult handleControlMessage(String msg) {
- return currentDevice.getCommunicator().handleControlMessage(msg);
+ return GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .handleControlMessage(msg);
}
public static HostResult sendBinaryInfoMessageForLib(
List<BinarySettingData> input) {
if (isSWAPVersion()) {
- return ((Communicator30) currentDevice.getCommunicator())
- .sendBinaryInfoMessageForLib(input);
+ return ((Communicator30) GlobalInformation.getCurrentDeviceInfo()
+ .getCommunicator()).sendBinaryInfoMessageForLib(input);
}
return null;
}
public static HostResult sendSWAPMessage(int messageId,
List<BinarySettingData> input) {
if (isSWAPVersion()) {
- return ((Communicator30) currentDevice.getCommunicator())
- .sendSWAPMessage(messageId, input);
+ return ((Communicator30) GlobalInformation.getCurrentDeviceInfo()
+ .getCommunicator()).sendSWAPMessage(messageId, input);
}
return null;
}
public static HostResult sendScreenShotMessage() {
if (isSWAPVersion()) {
- return ((Communicator30) currentDevice.getCommunicator())
- .sendScreenShotRequest();
+ return ((Communicator30) GlobalInformation.getCurrentDeviceInfo()
+ .getCommunicator()).sendScreenShotRequest();
}
return null;
}
}
public static Socket getDataSocket() {
- return currentDevice.getCommunicator().getDataSocket();
+ return GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .getDataSocket();
}
public static String getTargetVersion(DeviceInfo device) {
}
public static boolean isSWAPVersion() {
- if (currentDevice.getTargetVersion().contains("3.0")) {
+ if (GlobalInformation.getCurrentDeviceInfo().getTargetVersion()
+ .contains("3.0")) {
return true;
} else {
return false;
import org.eclipse.swt.widgets.Shell;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.model.DeviceInfo;
DA_LOG.debug("auto start : " + appid);
DeviceInfo device = DACommunicator.getDeviceByName(deviceName);
- DACommunicator.setSelectedDevice(device);
+ GlobalInformation.setCurrentDeviceInfo(device);
DACommunicator.getAppListFromTarget();
AppInfo appInfo = DACommunicator.getPkgInfoByAppPkgId(appid);
private String name;
private String option;
private String type;
+ private int string_size;
public DBColumn(String name, String option, String type) {
this.name = name;
this.option = option;
this.type = type;
+ this.string_size = 0;
+ }
+
+ public DBColumn(String name, String option, String type, int size) {
+ this.name = name;
+ this.option = option;
+ this.type = type;
+ this.string_size = size;
}
public String getName() {
return type;
}
+ public int getStringSize() {
+ return string_size;
+ }
+
public String getColumnString() {
- return name + CommonConstants.SPACE + type + CommonConstants.SPACE
- + option;
+ if (DBConstants.VARCHAR.equals(type)) {
+ return name + CommonConstants.SPACE + type + "(" + string_size
+ + ")" + CommonConstants.SPACE + option;
+ } else {
+ return name + CommonConstants.SPACE + type + CommonConstants.SPACE
+ + option;
+ }
}
}
public static final String EMPTY = CommonConstants.EMPTY;
public static final String PRIMARY_KEY = "PRIMARY KEY NOT NULL";//$NON-NLS-1$
public static final String NOT_NULL = "not null";//$NON-NLS-1$
+
+ // length of common string column
+ public static final int FUNCNAME_LEN = 256;
+ public static final int FILENAME_LEN = 256;
+ public static final int FILEPATH_LEN = 1024;
// length of string type column
public static final int TEXT_LEN = 256;
import java.util.ArrayList;
import java.util.List;
-
import org.tizen.dynamicanalyzer.constant.CommonConstants;
-public abstract class DBTable {
+public abstract class DBTable implements IPreparedStatement {
private List<DBColumn> columns = new ArrayList<DBColumn>();
public abstract String getTableName();
columns.add(col);
}
+ protected final String clipString(String colstr, int str_len, String key) {
+ String retstr = colstr;
+ if (colstr.length() > str_len) {
+ retstr = colstr.substring(0, str_len);
+ RemainingDataManager.addRemainingData(getTableName(), key,
+ colstr.substring(str_len, colstr.length()));
+ }
+
+ return retstr;
+ }
+
public final void createTable() {
StringBuffer query = new StringBuffer();
query.append("create table ");
public final void insertData(List<List<Object>> data) {
if (data.size() > 0) {
- List<String> columnType = new ArrayList<String>();
StringBuffer query = new StringBuffer();
query.append("insert into ").append(getTableName())
.append(" values( ");
int columnsize = columns.size();
for (int i = 0; i < columnsize; i++) {
- columnType.add(columns.get(i).getType());
-
if (i == columnsize - 1) {
query.append(" ? )");
} else {
query.append(CommonConstants.SEMICOLON);
// execute prepared with data
- SqlConnectionManager.executePrepared(query.toString(), data,
- columnType);
+ SqlConnectionManager.executePreparedWithInterface(query.toString(),
+ data, this);
}
}
--- /dev/null
+package org.tizen.dynamicanalyzer.database;
+
+import java.sql.PreparedStatement;
+import java.util.List;
+
+public interface IPreparedStatement {
+ public boolean prepare(PreparedStatement prep, List<Object> rowData);
+}
--- /dev/null
+package org.tizen.dynamicanalyzer.database;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class RemainingDataManager {
+ private static Map<String, Map<String, String>> remainingDataMap = new ConcurrentHashMap<String, Map<String, String>>();
+
+ // return null if add is succeed
+ // return not null else (already exist)
+ public static String addRemainingData(String category, String key,
+ String data) {
+ Map<String, String> dataMap = remainingDataMap.get(category);
+ if (dataMap == null) {
+ dataMap = new ConcurrentHashMap<String, String>();
+ remainingDataMap.put(category, dataMap);
+ }
+
+ return dataMap.put(key, data);
+ }
+}
connection = DriverManager.getConnection(dbUrl, "SA", "");
SQLWarning warning = connection.getWarnings();
while (warning != null) {
- DA_LOG.debug("[DB] Message: "
- + warning.getMessage());
- DA_LOG.debug("[DB] SQL state: "
- + warning.getSQLState());
+ DA_LOG.debug("[DB] Message: " + warning.getMessage());
+ DA_LOG.debug("[DB] SQL state: " + warning.getSQLState());
DA_LOG.debug("[DB] Vendor code: "
+ warning.getErrorCode());
warning = warning.getNextWarning();
}
}
- public static void executePrepared(String query, List<List<Object>> data,
- List<String> columnType) {
+ public static void executePreparedWithType(String query,
+ List<List<Object>> data, List<String> columnType) {
PreparedStatement prep = null;
if (data.size() == 0)
try {
if (connection != null) {
+ int batchCount = 0;
prep = connection.prepareStatement(query);
// count ? in query
if (columnType.get(i).equals(DBConstants.TEXT)) {
String colstr = (String) col;
if (colstr.length() > DBConstants.TEXT_LEN)
- colstr = colstr.substring(0, DBConstants.TEXT_LEN);
+ colstr = colstr.substring(0,
+ DBConstants.TEXT_LEN);
prep.setString(i + 1, colstr);
} else if (columnType.get(i).equals(
DBConstants.BIG_TEXT)) {
String colstr = (String) col;
if (colstr.length() > DBConstants.BIG_TEXT_LEN)
- colstr = colstr.substring(0, DBConstants.BIG_TEXT_LEN);
+ colstr = colstr.substring(0,
+ DBConstants.BIG_TEXT_LEN);
prep.setString(i + 1, colstr);
} else if (columnType.get(i).equals(
DBConstants.BIGBIG_TEXT)) {
String colstr = (String) col;
if (colstr.length() > DBConstants.BIGBIG_TEXT_LEN)
- colstr = colstr.substring(0, DBConstants.BIGBIG_TEXT_LEN);
+ colstr = colstr.substring(0,
+ DBConstants.BIGBIG_TEXT_LEN);
prep.setString(i + 1, colstr);
} else if (columnType.get(i).equals(
DBConstants.INTEGER)) {
}
} catch (SQLException e) {
e.printStackTrace();
+ isPrepared = false;
}
}
try {
if (isPrepared) {
prep.addBatch();
+ batchCount++;
}
prep.clearParameters();
} catch (SQLException e) {
}
}
- prep.executeBatch();
+ if (batchCount > 0)
+ prep.executeBatch();
+ connection.commit();
+ connection.setAutoCommit(true);
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ CommonUtil.tryClose(prep);
+ }
+ }
+
+ public static void executePreparedWithInterface(String query,
+ List<List<Object>> data, IPreparedStatement ip) {
+ PreparedStatement prep = null;
+
+ if (data.size() == 0)
+ return;
+
+ try {
+ if (connection != null) {
+ int batchCount = 0;
+ prep = connection.prepareStatement(query);
+
+ // count ? in query
+ int questionCount = 0;
+ int querylen = query.length();
+ for (int i = 0; i < querylen; i++) {
+ if (query.charAt(i) == '?')
+ questionCount++;
+ }
+
+ // set data into prepared statement
+ int datasize = data.size();
+
+ connection.setAutoCommit(false);
+
+ for (int k = 0; k < datasize; k++) {
+ List<Object> row = data.get(k);
+ int datacolsize = row.size();
+ if (datacolsize == questionCount) { // column count is equal
+ try {
+ if (ip.prepare(prep, row)) {
+ prep.addBatch();
+ batchCount++;
+ }
+ prep.clearParameters();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ } else { // column count is not equal
+ DA_LOG.error("column count is not equal !!");
+ }
+ }
+
+ if (batchCount > 0)
+ prep.executeBatch();
connection.commit();
connection.setAutoCommit(true);
}
import org.eclipse.swt.widgets.Display;\r
import org.eclipse.swt.widgets.Shell;\r
import org.tizen.dynamicanalyzer.common.AnalyzerManager;\r
+import org.tizen.dynamicanalyzer.common.GlobalInformation;\r
import org.tizen.dynamicanalyzer.communicator.DACommunicator;\r
import org.tizen.dynamicanalyzer.constant.CommonConstants;\r
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;\r
\r
public class OpenTraceHandler extends AbstractHandler {\r
private static final DALogger DA_LOG = DALogger.getInstance();\r
- \r
+\r
public static final String ID = OpenTraceHandler.class.getName();\r
Project project = null;\r
\r
OpenTraceProgressManager.getInstance().runThreads();\r
OpenTraceProgressManager.getInstance().openTraceComplete();\r
SqlManager.getInstance().closeConnection();\r
- \r
+\r
NetworkDataManager.getInstance().openProcess();\r
return null;\r
}\r
List<String> info = dbInfo.get(0);\r
TargetInfo targetInfo = new TargetInfo();\r
targetInfo.loadSaveFormat(info);\r
- DACommunicator.getSelectedDevice().setTargetInfo(targetInfo);\r
+ GlobalInformation.getCurrentDeviceInfo().setTargetInfo(targetInfo);\r
}\r
\r
List<String> pids = SqlManager.getInstance().getPids();\r
*/
package org.tizen.dynamicanalyzer.logparser;
-import java.io.File;
import java.util.List;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.SymbolManager;
-import org.tizen.dynamicanalyzer.communicator.CommunicatorUtils;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.model.ImageInfo;
-import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;
-import org.tizen.dynamicanalyzer.swap.channel.data.BasicDataMessage;
import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
-import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
-import org.tizen.dynamicanalyzer.swap.model.data.ScreenShotData;
-import org.tizen.dynamicanalyzer.swap.model.data.SystemData;
-import org.tizen.dynamicanalyzer.swap.model.data.UserFunctionData;
-import org.tizen.dynamicanalyzer.ui.page.BaseView;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.util.DALogger;
-import org.tizen.dynamicanalyzer.utils.ImageUtil;
-import org.tizen.sdblib.service.SyncResult;
public class LogParser implements Runnable {
private static final DALogger DA_LOG = DALogger.getInstance();
-
- private final String OSP_MAIN = "OspMain"; //$NON-NLS-1$
+
private static Thread logParser = null;
private static boolean dropCallTraceLog = false;
private static LogQueue logQueue = null;
// private static boolean isLogParsingComplete = false;
- private int SMALL_IMG_WIDTH = 40;
- private int SMALL_IMG_HEIGHT = 66;
-
- private int DEFAULT_IMG_WIDTH = 480;
- private int DEFAULT_IMG_HEIGHT = 800;
-
- /** thread **/
- private int pid = -1;
-
public static void clear() {
stopLogParser();
getLogQueue().clear();
// updateLog(logPack);
}
-// private void processImage(final String from, String rotate) {
-// final String fileName = getImageName(from);
-// final String to = AnalyzerManager.getProject().getSavePath()
-// + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
-// + File.separator + fileName;
-// final int angle = Integer.parseInt(rotate);
-// if (angle != 0) {
-// System.out.println("[ image rotate : " + angle + " ]");
-// }
-//
-// new Thread(null, new Runnable() {
-// int count = 0;
-//
-// @Override
-// public void run() {
-// while (true && count < 5) {
-// SyncResult res = CommunicatorUtils.pull(from, to);
-// if (null != res && res.isOk()) {
-// /* image resizing */
-// String smallImagePath = AnalyzerManager.getProject()
-// .getSavePath()
-// + File.separator
-// + AnalyzerConstants.IMAGE_FOLDER_NAME
-// + File.separator
-// + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME
-// + File.separator + fileName;
-// ImageUtil.transform(to, to, DEFAULT_IMG_WIDTH,
-// DEFAULT_IMG_HEIGHT, angle);
-// if (angle == 90 || angle == 270) {
-// ImageUtil.resize(to, smallImagePath,
-// SMALL_IMG_HEIGHT, SMALL_IMG_WIDTH);
-// } else {
-// ImageUtil.resize(to, smallImagePath,
-// SMALL_IMG_WIDTH, SMALL_IMG_HEIGHT);
-// }
-//
-// break;
-// } else {
-// System.out.println("Failed to get '" + from + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
-// try {
-// Thread.sleep(1000);
-// count++;
-// } catch (InterruptedException e) {
-// e.printStackTrace();
-// }
-// }
-// }
-// }
-// }, AnalyzerConstants.MESSAGE_INTERNAL_IMAGE_THREAD).start();
-//
-// }
+ // private void processImage(final String from, String rotate) {
+ // final String fileName = getImageName(from);
+ // final String to = AnalyzerManager.getProject().getSavePath()
+ // + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
+ // + File.separator + fileName;
+ // final int angle = Integer.parseInt(rotate);
+ // if (angle != 0) {
+ // System.out.println("[ image rotate : " + angle + " ]");
+ // }
+ //
+ // new Thread(null, new Runnable() {
+ // int count = 0;
+ //
+ // @Override
+ // public void run() {
+ // while (true && count < 5) {
+ // SyncResult res = CommunicatorUtils.pull(from, to);
+ // if (null != res && res.isOk()) {
+ // /* image resizing */
+ // String smallImagePath = AnalyzerManager.getProject()
+ // .getSavePath()
+ // + File.separator
+ // + AnalyzerConstants.IMAGE_FOLDER_NAME
+ // + File.separator
+ // + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME
+ // + File.separator + fileName;
+ // ImageUtil.transform(to, to, DEFAULT_IMG_WIDTH,
+ // DEFAULT_IMG_HEIGHT, angle);
+ // if (angle == 90 || angle == 270) {
+ // ImageUtil.resize(to, smallImagePath,
+ // SMALL_IMG_HEIGHT, SMALL_IMG_WIDTH);
+ // } else {
+ // ImageUtil.resize(to, smallImagePath,
+ // SMALL_IMG_WIDTH, SMALL_IMG_HEIGHT);
+ // }
+ //
+ // break;
+ // } else {
+ // System.out.println("Failed to get '" + from + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
+ // try {
+ // Thread.sleep(1000);
+ // count++;
+ // } catch (InterruptedException e) {
+ // e.printStackTrace();
+ // }
+ // }
+ // }
+ // }
+ // }, AnalyzerConstants.MESSAGE_INTERNAL_IMAGE_THREAD).start();
+ //
+ // }
private String getImageName(String fullPath) {
String name = null;
coreCount = i + 1;
}
if (coreCount != 0) {
- DACommunicator.getSelectedDevice().getTargetInfo()
+ GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
.setCpuCount(coreCount);
}
byte[] cpuFrequency = new byte[temp.length];
import java.util.List;
import org.tizen.dynamicanalyzer.common.ElfSymbolExtracter;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.model.AddrSymbolPair;
-import org.tizen.dynamicanalyzer.swap.channel.control.ApplicationInfo;
+import org.tizen.dynamicanalyzer.swap.channel.control.ApplicationInst;
import org.tizen.dynamicanalyzer.swap.channel.control.BinaryInfo;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public static final int PKGINFO_SIZE = 12;
public static final String APPTYPE_CPP = "c++";//$NON-NLS-1$
+ public static final String APPTYPE_CAPP = "capp";//$NON-NLS-1$
public static final String APPTYPE_WEB = "webapp";//$NON-NLS-1$
public static final String FLAG_ZERO = "0";//$NON-NLS-1$
public static final String FLAG_ONE = "1";//$NON-NLS-1$
if (null == execFileName) {
String execPath = appInfo.get(EXEC_INDEX);
String[] splitPath = execPath.split(CommonConstants.SLASH);
- if (type == ApplicationInfo.APPTYPE_TIZEN) {
+ if (type == ApplicationInst.APPTYPE_TIZEN) {
execFileName = splitPath[splitPath.length - 1]
+ CommonConstants.EXTENSION_EXEC_FILE;
} else {
}
public BinaryInfo getBinaryInfo(String targetBinPath) {
- PackageInfo pkgInfo = DACommunicator.getSelectedDevice()
+ PackageInfo pkgInfo = GlobalInformation.getCurrentDeviceInfo()
.getPackageInfoHash().get(getPackageId());
BinaryInfo ret = pkgInfo.getBinaryInfo(targetBinPath);
return ret;
import java.util.List;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.path.PathConstants;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
}
public void setCoreCount(int count) {
- DACommunicator.getSelectedDevice().getTargetInfo().setCpuCount(count);
+ GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
+ .setCpuCount(count);
}
public int getCoreCount() {
- return DACommunicator.getSelectedDevice().getTargetInfo().getCpuCount();
+ return GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
+ .getCpuCount();
}
public int getMaxBrightness() {
- return DACommunicator.getSelectedDevice().getTargetInfo()
+ return GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
.getMaxBrightness();
}
public long getSystemMemorySize() {
- return DACommunicator.getSelectedDevice().getTargetInfo()
+ return GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
.getSystemMemorySize();
}
}
public void init() {
- if (null == DACommunicator.getSelectedApp()) {
+ if (null == GlobalInformation.getCurrentApplication()) {
String comboText = ToolbarArea.getInstance().getAppCombo()
.getText();
AppInfo appInfo = DACommunicator.getPkgInfoByName(comboText);
- DACommunicator.setSelectedApp(appInfo);
- ToolbarArea.getInstance().setSelectedApp(appInfo);
+ GlobalInformation.setCurrentApplication(appInfo);
+ GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .onAppSelected(appInfo);
}
- setAppName(DACommunicator.getSelectedApp().getInfo(AppInfo.LABEL_INDEX));
- setPkgId(DACommunicator.getSelectedApp().getInfo(AppInfo.PACKAGE_INDEX));
- DeviceInfo deviceName = DACommunicator.getSelectedDevice();
+ setAppName(GlobalInformation.getCurrentApplication().getInfo(
+ AppInfo.LABEL_INDEX));
+ setPkgId(GlobalInformation.getCurrentApplication().getInfo(
+ AppInfo.PACKAGE_INDEX));
+ DeviceInfo deviceName = GlobalInformation.getCurrentDeviceInfo();
if (null != deviceName
&& null != deviceName.getIDevice().getSerialNumber()
&& !deviceName.getIDevice().getSerialNumber().isEmpty()) {
- setDevice(DACommunicator.getSelectedDevice().getIDevice()
+ setDevice(GlobalInformation.getCurrentDeviceInfo().getIDevice()
.getSerialNumber());
} else {
setDevice(CommonConstants.SPACE);
// close previous database connection
SqlConnectionManager.closeConnection();
-
+
// establish database connection
boolean conn_res = SqlConnectionManager
.establishConnection(getSavePath() + File.separator
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
String insertQuery = info.insertQuery();
if (insertQuery != null) {
- TargetInfo targetInfo = DACommunicator.getSelectedDevice()
+ TargetInfo targetInfo = GlobalInformation.getCurrentDeviceInfo()
.getTargetInfo();
List<String> insetRowData = new ArrayList<String>();
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.project.AppInfo;
public String getUserFunctionPosition() {
if (userFunctionBin == null || userFunctionBin.isEmpty()) {
if (AnalyzerManager.isOsp()) {
- userFunctionBin = new String(DACommunicator.getSelectedApp()
+ userFunctionBin = new String(GlobalInformation.getCurrentApplication()
.getInfo(AppInfo.EXEC_INDEX) + ".exe"); //$NON-NLS-1$
} else {
- userFunctionBin = new String(DACommunicator.getSelectedApp()
+ userFunctionBin = new String(GlobalInformation.getCurrentApplication()
.getInfo(AppInfo.EXEC_INDEX));
}
}
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.SymbolManager;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
String path = processInfo.getMainTargetBinaryPath();
String key = AnalyzerUtil.getTargetPathKey(path);
- BinaryInfo binInfo = DACommunicator.getSelectedApp().getBinaryInfo(key);
+ BinaryInfo binInfo = GlobalInformation.getCurrentApplication().getBinaryInfo(key);
if (null == binInfo) {
return false;
}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-package org.tizen.dynamicanalyzer.swap.channel.control;
-
-import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
-import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
-
-public class ApplicationInfo implements SWAPModel {
- public static final int APPTYPE_TIZEN = 0x01;
- public static final int APPTYPE_PROCESS = 0x02;
- public static final int APPTYPE_COMMON_EXEC = 0x03;
- public static final int APPTYPE_WEB = 0x04;
- /***
- * target application type
- * 01: tizen native application
- * 02: already launched process
- * 03: common executables
- */
- private int appType = 0;
-
- /***
- * target application ID
- * depends on the target application type
- * 01: AppID, pkg_id.app_name, the standard tizen native application ID
- * 02: PID
- * 03: "\0"
- */
- private String appId = null;
- private String execPath = null;
-
- public int getAppType() {
- return appType;
- }
-
- public void setAppType(int appType) {
- this.appType = appType;
- }
-
- public String getAppId() {
- return appId;
- }
-
- public void setAppId(String appId) {
- this.appId = appId;
- }
-
- public String getExecPath() {
- return execPath;
- }
-
- public void setExecPath(String execPath) {
- this.execPath = execPath;
- }
-
- @Override
- public byte[] getByteValue() {
- return ByteUtils.getByte(appType, appId, execPath);
- }
-
- @Override
- public void setByteToValues(byte[] input) {
- // TODO Auto-generated method stub
-
- }
-}
import org.tizen.dynamicanalyzer.swap.model.SWAPModel;
public class ApplicationInst implements SWAPModel {
+ public static final int APPTYPE_TIZEN = 0x01;
+ public static final int APPTYPE_PROCESS = 0x02;
+ public static final int APPTYPE_COMMON_EXEC = 0x03;
+ public static final int APPTYPE_WEB = 0x04;
+
+ /***
+ * target application type
+ * 01: tizen native application
+ * 02: already launched process
+ * 03: common executables
+ * 04: web application
+ */
private int applicationType = 0;
+
+ /***
+ * target application ID
+ * depends on the target application type
+ * 01: AppID, pkg_id.app_name, the standard tizen native application ID
+ * 02: PID
+ * 03: "\0" -> empty string
+ * 04: AppID, pkg_id.app_name, the standard tizen web application ID
+ */
private String applicationId = null;
+
private String executablePath = null;
private int functionCount = 0;
private List<FunctionInst> functionInstList = new ArrayList<FunctionInst>();
import java.util.List;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
public class ApiNameManager {
}
public static List<String> getApiList() {
- return DACommunicator.getSelectedDevice().getApiList();
+ return GlobalInformation.getCurrentDeviceInfo().getApiList();
}
import java.util.HashMap;
import java.util.List;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.model.DeviceInfo;
public BinaryInfo getTargetBinary(long pcAddr) {
BinaryInfo binInfo = null;
if (pcAddr >= getLowestAddress() && pcAddr <= getHighestAddress()) {
- String pkgId = DACommunicator.getSelectedApp().getPackageId();
- DeviceInfo devInfo = DACommunicator.getSelectedDevice();
+ String pkgId = GlobalInformation.getCurrentApplication().getPackageId();
+ DeviceInfo devInfo = GlobalInformation.getCurrentDeviceInfo();
PackageInfo pkgInfo = devInfo.getSelectedPackage(pkgId);
List<AppInfo> apps = pkgInfo.getAppInfos();
for (AppInfo app : apps) {
import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
import org.tizen.dynamicanalyzer.common.ElfSymbolExtracter;
import org.tizen.dynamicanalyzer.common.ErrorCode;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.HostResult;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.communicator.BaseCommunicator;
import org.tizen.dynamicanalyzer.project.AppInfo;
import org.tizen.dynamicanalyzer.project.PackageInfo;
import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.swap.channel.control.ApplicationInfo;
import org.tizen.dynamicanalyzer.swap.channel.control.ApplicationInst;
import org.tizen.dynamicanalyzer.swap.channel.control.BinaryInfo;
import org.tizen.dynamicanalyzer.swap.channel.control.FunctionInst;
AnalyzerConstants.COMMUNICATOR_RECEIVE_THREAD);
// start message send
HostResult result = handleControlMessage(
- DACommunicator.getSelectedDevice(), ret);
+ GlobalInformation.getCurrentDeviceInfo(), ret);
DA_LOG.performance("TEST", "Start Trace", "Make and Send start message");
// FIX
index += INT_SIZE;
int nano = ByteUtils.toInt(data, index);
- AnalyzerManager.getProject().setProfileStartTime(new DATime(sec, nano));
+ AnalyzerManager.getProject().setProfileStartTime(
+ new DATime(sec, nano));
}
} else {
DACommunicator.setRunning(false);
String appType = app.getInfo(AppInfo.APPTYPE_INDEX);
if (appType.contains(AppInfo.APPTYPE_CPP)) {
- appInst.setApplicationType(ApplicationInfo.APPTYPE_TIZEN);
+ appInst.setApplicationType(ApplicationInst.APPTYPE_TIZEN);
+ appInst.setApplicationId(app.getAppId());
} else if (appType.contains(AppInfo.APPTYPE_WEB)) {
- appInst.setApplicationType(ApplicationInfo.APPTYPE_WEB);
+ appInst.setApplicationType(ApplicationInst.APPTYPE_WEB);
+ appInst.setApplicationId(app.getAppId());
} else {
- appInst.setApplicationType(ApplicationInfo.APPTYPE_COMMON_EXEC);
+ appInst.setApplicationType(ApplicationInst.APPTYPE_COMMON_EXEC);
+ appInst.setApplicationId(CommonConstants.EMPTY);
}
- appInst.setApplicationId(app.getAppId());
appInst.setExecutablePath(app.getExecPath());
DA_LOG.debug("Set execute path : " + app.getExecPath());
BinaryInfo binInfo = app.getMainBinaryInfo();
byte[] msgBinInfo = ByteUtils
.toBytes(AnalyzerConstants.MSG_BINARY_INFO);
- PackageInfo pkgInfo = DACommunicator.getSelectedDevice()
+ PackageInfo pkgInfo = GlobalInformation.getCurrentDeviceInfo()
.getPackageInfoHash()
.get(selectedApp.getInfo(AppInfo.PACKAGE_INDEX));
List<AppInfo> apps = pkgInfo.getAppInfos();
byte[] msg = ByteUtils.getByte(msgBinInfo, length, preMsg);
HostResult result = handleControlMessage(
- DACommunicator.getSelectedDevice(), msg);
+ GlobalInformation.getCurrentDeviceInfo(), msg);
if (!result.isSuccess() || !isCorrectAck(MSG_BINARY_INFO_ACK, result)) {
return HostResult.ERR_BIN_INFO_GET_FAIL;
private HostResult pullTheFile(String from, String to) {
try {
- DACommunicator.getSelectedDevice().getIDevice()
+ GlobalInformation.getCurrentDeviceInfo().getIDevice()
.becomeSuperUser(true);
} catch (TimeoutException e) {
e.printStackTrace();
int length = 0;
byte[] stopMsg = ByteUtils.getByte(stop, length);
HostResult result = handleControlMessage(
- DACommunicator.getSelectedDevice(), stopMsg);
+ GlobalInformation.getCurrentDeviceInfo(), stopMsg);
if (result.isSuccess()) {
if (isCorrectAck(MSG_STOP_ACK, result)) {
@Override
public Socket getDataSocket() {
- return DACommunicator.getSelectedDevice().getDataSock();
+ return GlobalInformation.getCurrentDeviceInfo().getDataSock();
}
private TargetInfo processTargetInfo(byte[] payload, int index) {
@Override
public void closeSock() {
- DACommunicator.getSelectedDevice().releaseDataSock();
+ GlobalInformation.getCurrentDeviceInfo().releaseDataSock();
}
private int getReturnId(byte[] data) {
}
@Override
- public void setSelectedApp(AppInfo app) {
- HostResult hr = sendBinaryInfoMessage(app);
- if (!hr.isSuccess()) {
- DA_LOG.debug("binary info get failed :" + hr.getMessage());
+ public void onAppSelected(AppInfo app) {
+ if (app != null) {
+ HostResult hr = sendBinaryInfoMessage(app);
+ if (!hr.isSuccess()) {
+ DA_LOG.debug("binary info get failed :" + hr.getMessage());
+ }
}
}
public HostResult sendScreenShotRequest() {
byte[] msg = ByteUtils.getByte(AnalyzerConstants.MSG_GET_SCREENSHOT, 0);
HostResult result = HostResult.SUCCESS;
- Socket controlSock = DACommunicator.getSelectedDevice()
+ Socket controlSock = GlobalInformation.getCurrentDeviceInfo()
.getControlSock();
try {
// ByteUtils.printByteArrayForStart(msg);
HostResult result = handleControlMessage(
- DACommunicator.getSelectedDevice(), msg);
+ GlobalInformation.getCurrentDeviceInfo(), msg);
int ackMsg = AnalyzerConstants.MSG_SWAP_INST_ADD_ACK;
if (messageId == AnalyzerConstants.MSG_SWAP_INST_REMOVE) {
String key = AnalyzerUtil.getTargetPathKey(binInfo
.getTargetBinaryPath());
- DACommunicator.getSelectedApp().getBinaryInfoMap()
+ GlobalInformation.getCurrentApplication().getBinaryInfoMap()
.put(key, binInfo);
binInfoList.add(binInfo);
}
byte[] msg = ByteUtils.getByte(AnalyzerConstants.MSG_BINARY_INFO,
length, sendBin);
HostResult result = handleControlMessage(
- DACommunicator.getSelectedDevice(), msg);
+ GlobalInformation.getCurrentDeviceInfo(), msg);
if (!result.isSuccess() || !isCorrectAck(MSG_BINARY_INFO_ACK, result)) {
return HostResult.ERR_BIN_INFO_GET_FAIL;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
pInfo.setDepLibCount(dependantLibCount);
// User Call Trace : App is Tizen C++ or Tizen native
- String applicationType = DACommunicator.getSelectedApp().getInfo(
+ String applicationType = GlobalInformation.getCurrentApplication().getInfo(
AppInfo.APPTYPE_INDEX);
if (applicationType.contains(AppInfo.APPTYPE_CPP)) {
pInfoPack.setDropLog(true);
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.SymbolManager;
import org.tizen.dynamicanalyzer.communicator.CommunicatorUtils;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
public class SWAPLogParser implements Runnable {
private static final DALogger DA_LOG = DALogger.getInstance();
-
+
private static final String OSP_MAIN = "OspMain"; //$NON-NLS-1$
private static Thread logParser = null;
// default false, turn on when Tizen C++ app
int id = log.getId();
int seqNum = log.getSeq();
if (log instanceof SystemData) {
-// System.out
-// .println("=========systemData is slicing===========\n");
+ // System.out
+ // .println("=========systemData is slicing===========\n");
pushLog(log, logPack);
} else if (log instanceof ProfileData) {
if (!AnalyzerManager.isProcessInfoArrived()) {
String remoteImgPath;
if (DACommunicator.isTargetEmulator()
&& SocketClient.getInstance().isConnected()) {
- DACommunicator.getSelectedDevice().emulatorScreenshot
+ GlobalInformation.getCurrentDeviceInfo().emulatorScreenshot
.send();
- remoteImgPath = DACommunicator.getSelectedDevice().emulatorScreenshot
+ remoteImgPath = GlobalInformation
+ .getCurrentDeviceInfo().emulatorScreenshot
.getFilePath();
bECS = true;
} else {
import java.sql.ResultSet;
import java.sql.SQLException;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
public void makeData(byte[] data) {
super.makeData(data);
// index = MessageParser.MSG_HEADER_SIZE;
- int coreCount = DACommunicator.getSelectedDevice().getTargetInfo()
+ int coreCount = GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
.getCpuCount();
- int deviceCount = DACommunicator.getSelectedDevice().getTargetInfo()
+ int deviceCount = GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
.getDeviceCount();
appCpuUsage = ByteUtils.toFloat(data, index);
index += FLOAT_SIZE;
}
private static String parseCpu(int start, byte[] payload) {
- int coreCount = DACommunicator.getSelectedDevice().getTargetInfo()
+ int coreCount = GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
.getCpuCount();
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < coreCount; i++) {
}
private static String parseUsage(int start, byte[] payload) {
- int count = DACommunicator.getSelectedDevice().getTargetInfo()
+ int count = GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
.getDeviceCount();
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < count; i++) {
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.model.DeviceInfo;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
}
public void makeTree() {
- DeviceInfo selectedDevice = DACommunicator.getSelectedDevice();
+ DeviceInfo selectedDevice = GlobalInformation.getCurrentDeviceInfo();
if (null == selectedDevice) {
return;
}
- IDevice device = DACommunicator.getSelectedDevice().getIDevice();
+ IDevice device = GlobalInformation.getCurrentDeviceInfo().getIDevice();
FileEntry root = device.getRoot();
GridItem item = new GridItem(table, SWT.NONE);
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.tizen.dynamicanalyzer.appearance.DesignConstants;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.nl.WidgetLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
data.height = 476;
data.width = 434;
explorer.setLayoutData(data);
- explorer.setDevice(DACommunicator.getSelectedDevice().getIDevice());
- explorer.setRoot(DACommunicator.getSelectedDevice().getIDevice()
+ explorer.setDevice(GlobalInformation.getCurrentDeviceInfo().getIDevice());
+ explorer.setRoot(GlobalInformation.getCurrentDeviceInfo().getIDevice()
.getRoot().getFullPath());
// explorer.updateData();
package org.tizen.dynamicanalyzer.ui.info.callstack;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.SymbolManager;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
.demanglingFunctionName(prevFunctionName);
}
} else {
- AppInfo selectedApp = DACommunicator.getSelectedApp();
+ AppInfo selectedApp = GlobalInformation.getCurrentApplication();
if (DACommunicator.isDeviceConnected() && null != selectedApp
&& path.equals(selectedApp.getInfo(AppInfo.EXEC_INDEX))
&& AnalyzerManager.isOsp()) {
package org.tizen.dynamicanalyzer.ui.kernel.data;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.List;
+
import org.tizen.dynamicanalyzer.database.DBColumn;
import org.tizen.dynamicanalyzer.database.DBConstants;
import org.tizen.dynamicanalyzer.database.DBTable;
addColumn(new DBColumn(ENDADDR, DBConstants.EMPTY, DBConstants.LONG));
}
+ @Override
+ public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+ boolean isPrepared = true;
+
+ int columnsize = getColumnSize();
+ if (columnsize != rowData.size()) {
+ isPrepared = false;
+ } else {
+ try {
+ prep.setInt(1, (Integer) (rowData.get(0)));
+ prep.setInt(2, (Integer) (rowData.get(1)));
+ prep.setInt(3, (Integer) (rowData.get(2)));
+ prep.setInt(4, (Integer) (rowData.get(3)));
+
+ prep.setLong(5, (Long) (rowData.get(4)));
+ prep.setLong(6, (Long) (rowData.get(5)));
+ prep.setLong(7, (Long) (rowData.get(6)));
+ prep.setLong(8, (Long) (rowData.get(7)));
+ } catch (SQLException e) {
+ e.printStackTrace();
+ isPrepared = false;
+ }
+ }
+
+ return isPrepared;
+ }
+
}
package org.tizen.dynamicanalyzer.ui.kernel.data;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.List;
+
import org.tizen.dynamicanalyzer.database.DBColumn;
import org.tizen.dynamicanalyzer.database.DBConstants;
import org.tizen.dynamicanalyzer.database.DBTable;
addColumn(new DBColumn(ENDTIME, DBConstants.EMPTY, DBConstants.LONG));
addColumn(new DBColumn(ENDTYPE, DBConstants.EMPTY, DBConstants.INTEGER));
addColumn(new DBColumn(ENDADDR, DBConstants.EMPTY, DBConstants.LONG));
- addColumn(new DBColumn(FUNCNAME, DBConstants.EMPTY, DBConstants.TEXT));
+ addColumn(new DBColumn(FUNCNAME, DBConstants.EMPTY,
+ DBConstants.VARCHAR, DBConstants.FUNCNAME_LEN));
+ }
+
+ @Override
+ public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+ boolean isPrepared = true;
+
+ int columnsize = getColumnSize();
+ if (columnsize != rowData.size()) {
+ isPrepared = false;
+ } else {
+ try {
+ prep.setInt(1, (Integer) (rowData.get(0)));
+ prep.setInt(2, (Integer) (rowData.get(1)));
+ prep.setInt(3, (Integer) (rowData.get(2)));
+ prep.setInt(4, (Integer) (rowData.get(3)));
+
+ prep.setLong(5, (Long) (rowData.get(4)));
+ prep.setInt(6, (Integer) (rowData.get(5)));
+ prep.setLong(7, (Long) (rowData.get(6)));
+
+ prep.setLong(8, (Long) (rowData.get(7)));
+ prep.setInt(9, (Integer) (rowData.get(8)));
+ prep.setLong(10, (Long) (rowData.get(9)));
+
+ String retstr = clipString((String) (rowData.get(10)),
+ DBConstants.FUNCNAME_LEN, rowData.get(0).toString());
+
+ prep.setString(11, retstr);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ isPrepared = false;
+ }
+ }
+
+ return isPrepared;
}
}
package org.tizen.dynamicanalyzer.ui.network.data;
+import java.sql.PreparedStatement;
import java.util.ArrayList;
import java.util.List;
return statusSeriesList;
}
+ @Override
+ public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
package org.tizen.dynamicanalyzer.ui.network.data;
+import java.sql.PreparedStatement;
import java.util.ArrayList;
import java.util.List;
return statusSeriesList;
}
+ @Override
+ public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
package org.tizen.dynamicanalyzer.ui.timeline;
+import java.sql.PreparedStatement;
+import java.util.List;
+
import org.tizen.dynamicanalyzer.database.DBColumn;
import org.tizen.dynamicanalyzer.database.DBConstants;
import org.tizen.dynamicanalyzer.database.DBTable;
addColumn(new DBColumn(IMAGE_FILE_PATH, DBConstants.NOT_NULL, DBConstants.TEXT)); // TODO integer -> float
addColumn(new DBColumn(IMAGE_ORIENTATION, DBConstants.NOT_NULL, DBConstants.INTEGER));
}
+
+ @Override
+ public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
package org.tizen.dynamicanalyzer.ui.timeline;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.List;
+
import org.tizen.dynamicanalyzer.database.DBColumn;
import org.tizen.dynamicanalyzer.database.DBConstants;
import org.tizen.dynamicanalyzer.database.DBTable;
public class SystemDataDBTable extends DBTable {
private static final String TABLENAME = "TIMELINE_SYSTEM_DATA";
-
+
public static enum COLUMN {
- TIME,
- CPU_LOAD_APP,
- PROCESS_COUNT,
- HEAP_ALLOCATION_TOTAL,
- HEAP_ALLOCATION_APP,
- MEMORY_VIRTUAL,
- MEMORY_RESIDENT,
- MEMORY_SHARED,
- MEMORY_PSS,
- MEMORY_TOTAL_SYSTEM,
- MEMORY_USAGE_SYSTEM,
- NETWORK_SIZE_SEND,
- NETWORK_SIZE_RECEIVE,
- DEVICE_STATUS_WIFI,
- DEVICE_STATUS_BLUETOOTH,
- DEVICE_STATUS_GPS,
- DEVICE_STATUS_BRIGHTNESS,
- DEVICE_STATUS_DNET,
- DEVICE_STATUS_CAMERA,
- DEVICE_STATUS_SOUND,
- DEVICE_STATUS_AUDIO,
- DEVICE_STATUS_VIBRATION,
- DEVICE_STATUS_VOLTAGE,
- DEVICE_STATUS_RSSI,
- DEVICE_STATUS_VIDEO,
- DEVICE_STATUS_CALL,
- DISK_TOTAL_USAGE,
- DISK_IO_READ_SIZE,
- DISK_IO_READ_SECTOR,
- DISK_IO_WRITE_SIZE,
- DISK_IO_WRITE_SECTOR,
- ENERGY_USAGE,
- FD_COUNT,
- FD_ACTIVITY
+ TIME, CPU_LOAD_APP, PROCESS_COUNT, HEAP_ALLOCATION_TOTAL, HEAP_ALLOCATION_APP, MEMORY_VIRTUAL, MEMORY_RESIDENT, MEMORY_SHARED, MEMORY_PSS, MEMORY_TOTAL_SYSTEM, MEMORY_USAGE_SYSTEM, NETWORK_SIZE_SEND, NETWORK_SIZE_RECEIVE, DEVICE_STATUS_WIFI, DEVICE_STATUS_BLUETOOTH, DEVICE_STATUS_GPS, DEVICE_STATUS_BRIGHTNESS, DEVICE_STATUS_DNET, DEVICE_STATUS_CAMERA, DEVICE_STATUS_SOUND, DEVICE_STATUS_AUDIO, DEVICE_STATUS_VIBRATION, DEVICE_STATUS_VOLTAGE, DEVICE_STATUS_RSSI, DEVICE_STATUS_VIDEO, DEVICE_STATUS_CALL, DISK_TOTAL_USAGE, DISK_IO_READ_SIZE, DISK_IO_READ_SECTOR, DISK_IO_WRITE_SIZE, DISK_IO_WRITE_SECTOR, ENERGY_USAGE, FD_COUNT, FD_ACTIVITY
}
-
+
public static final String TIME = "TIME";
public static final String CPU_LOAD_APP = "CPU_LOAD_APP";
public static final String PROCESS_COUNT = "PROCESS_COUNT";
public SystemDataDBTable() {
addColumn(new DBColumn(TIME, DBConstants.NOT_NULL, DBConstants.LONG));
- addColumn(new DBColumn(CPU_LOAD_APP, DBConstants.NOT_NULL, DBConstants.INTEGER)); // TODO integer -> float
- addColumn(new DBColumn(PROCESS_COUNT, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(HEAP_ALLOCATION_TOTAL, DBConstants.NOT_NULL, DBConstants.LONG));
- addColumn(new DBColumn(HEAP_ALLOCATION_APP, DBConstants.NOT_NULL, DBConstants.LONG));
- addColumn(new DBColumn(MEMORY_VIRTUAL, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(MEMORY_RESIDENT, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(MEMORY_SHARED, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(MEMORY_PSS, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(MEMORY_TOTAL_SYSTEM, DBConstants.NOT_NULL, DBConstants.LONG)); //10
- addColumn(new DBColumn(MEMORY_USAGE_SYSTEM, DBConstants.NOT_NULL, DBConstants.LONG));
- addColumn(new DBColumn(NETWORK_SIZE_SEND, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(NETWORK_SIZE_RECEIVE, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_WIFI, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_BLUETOOTH, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_GPS, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_BRIGHTNESS, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_DNET, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_CAMERA, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_SOUND, DBConstants.NOT_NULL, DBConstants.INTEGER)); //20
- addColumn(new DBColumn(DEVICE_STATUS_AUDIO, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_VIBRATION, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_VOLTAGE, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_RSSI, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_VIDEO, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DEVICE_STATUS_CALL, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DISK_TOTAL_USAGE, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DISK_IO_READ_SIZE, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DISK_IO_READ_SECTOR, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(DISK_IO_WRITE_SIZE, DBConstants.NOT_NULL, DBConstants.INTEGER)); //30
- addColumn(new DBColumn(DISK_IO_WRITE_SECTOR, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(ENERGY_USAGE, DBConstants.NOT_NULL, DBConstants.INTEGER));
-// addColumn(new DBColumn(FD_COUNT, DBConstants.NOT_NULL, DBConstants.INTEGER));
-// addColumn(new DBColumn(FD_ACTIVITY, DBConstants.NOT_NULL, DBConstants.INTEGER));
+ addColumn(new DBColumn(CPU_LOAD_APP, DBConstants.NOT_NULL,
+ DBConstants.INTEGER)); // TODO integer -> float
+ addColumn(new DBColumn(PROCESS_COUNT, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(HEAP_ALLOCATION_TOTAL, DBConstants.NOT_NULL,
+ DBConstants.LONG));
+ addColumn(new DBColumn(HEAP_ALLOCATION_APP, DBConstants.NOT_NULL,
+ DBConstants.LONG));
+ addColumn(new DBColumn(MEMORY_VIRTUAL, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(MEMORY_RESIDENT, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(MEMORY_SHARED, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(MEMORY_PSS, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(MEMORY_TOTAL_SYSTEM, DBConstants.NOT_NULL,
+ DBConstants.LONG)); // 10
+ addColumn(new DBColumn(MEMORY_USAGE_SYSTEM, DBConstants.NOT_NULL,
+ DBConstants.LONG));
+ addColumn(new DBColumn(NETWORK_SIZE_SEND, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(NETWORK_SIZE_RECEIVE, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_WIFI, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_BLUETOOTH, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_GPS, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_BRIGHTNESS, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_DNET, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_CAMERA, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_SOUND, DBConstants.NOT_NULL,
+ DBConstants.INTEGER)); // 20
+ addColumn(new DBColumn(DEVICE_STATUS_AUDIO, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_VIBRATION, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_VOLTAGE, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_RSSI, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_VIDEO, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DEVICE_STATUS_CALL, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DISK_TOTAL_USAGE, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DISK_IO_READ_SIZE, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DISK_IO_READ_SECTOR, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(DISK_IO_WRITE_SIZE, DBConstants.NOT_NULL,
+ DBConstants.INTEGER)); // 30
+ addColumn(new DBColumn(DISK_IO_WRITE_SECTOR, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ addColumn(new DBColumn(ENERGY_USAGE, DBConstants.NOT_NULL,
+ DBConstants.INTEGER));
+ // addColumn(new DBColumn(FD_COUNT, DBConstants.NOT_NULL,
+ // DBConstants.INTEGER));
+ // addColumn(new DBColumn(FD_ACTIVITY, DBConstants.NOT_NULL,
+ // DBConstants.INTEGER));
+ }
+
+ @Override
+ public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+ boolean isPrepared = true;
+
+ int columnsize = getColumnSize();
+ if (columnsize != rowData.size()) {
+ isPrepared = false;
+ } else {
+ try {
+ prep.setLong(1, (Long) (rowData.get(0)));
+ prep.setInt(2, (Integer) (rowData.get(1)));
+ prep.setInt(3, (Integer) (rowData.get(2)));
+ prep.setLong(4, (Long) (rowData.get(3)));
+ prep.setLong(5, (Long) (rowData.get(4)));
+ prep.setInt(6, (Integer) (rowData.get(5)));
+ prep.setInt(7, (Integer) (rowData.get(6)));
+ prep.setInt(8, (Integer) (rowData.get(7)));
+ prep.setInt(9, (Integer) (rowData.get(8)));
+ prep.setLong(10, (Long) (rowData.get(9)));
+ prep.setLong(11, (Long) (rowData.get(10)));
+
+ prep.setInt(12, (Integer) (rowData.get(11)));
+ prep.setInt(13, (Integer) (rowData.get(12)));
+ prep.setInt(14, (Integer) (rowData.get(13)));
+ prep.setInt(15, (Integer) (rowData.get(14)));
+ prep.setInt(16, (Integer) (rowData.get(15)));
+ prep.setInt(17, (Integer) (rowData.get(16)));
+ prep.setInt(18, (Integer) (rowData.get(17)));
+ prep.setInt(19, (Integer) (rowData.get(18)));
+ prep.setInt(20, (Integer) (rowData.get(19)));
+ prep.setInt(21, (Integer) (rowData.get(20)));
+ prep.setInt(22, (Integer) (rowData.get(21)));
+ prep.setInt(23, (Integer) (rowData.get(22)));
+ prep.setInt(24, (Integer) (rowData.get(23)));
+ prep.setInt(25, (Integer) (rowData.get(24)));
+ prep.setInt(26, (Integer) (rowData.get(25)));
+ prep.setInt(27, (Integer) (rowData.get(26)));
+ prep.setInt(28, (Integer) (rowData.get(27)));
+ prep.setInt(29, (Integer) (rowData.get(28)));
+ prep.setInt(30, (Integer) (rowData.get(29)));
+ prep.setInt(31, (Integer) (rowData.get(30)));
+ prep.setInt(32, (Integer) (rowData.get(31)));
+ } catch (SQLException e) {
+ e.printStackTrace();
+ isPrepared = false;
+ }
+ }
+
+ return isPrepared;
}
}
package org.tizen.dynamicanalyzer.ui.timeline;
+import java.sql.PreparedStatement;
+import java.util.List;
+
import org.tizen.dynamicanalyzer.database.DBColumn;
import org.tizen.dynamicanalyzer.database.DBConstants;
import org.tizen.dynamicanalyzer.database.DBTable;
addColumn(new DBColumn(INFO_STRING, DBConstants.NOT_NULL, DBConstants.TEXT));
addColumn(new DBColumn(INFO_INTEGER, DBConstants.NOT_NULL, DBConstants.INTEGER));
}
+
+ @Override
+ public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
import java.util.List;
import org.eclipse.swt.graphics.Color;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
private void parseLog(SystemData logData) {
try {
if (coreSize == TimelineConstants.NOT_INITED) {
- coreSize = DACommunicator.getSelectedDevice().getTargetInfo()
+ coreSize = GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
.getCpuCount();
for (int i = 0; i < coreSize; i++) {
DAChartSeries chartSeries = new DAChartSeries(
import java.util.List;
import org.eclipse.swt.graphics.Color;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
private void parseLog(SystemData logData) {
try {
if (coreSize == TimelineConstants.NOT_INITED) {
- coreSize = DACommunicator.getSelectedDevice().getTargetInfo()
+ coreSize = GlobalInformation.getCurrentDeviceInfo().getTargetInfo()
.getCpuCount();
for (int i = 0; i < coreSize; i++) {
DAChartSeries chartSeries = new DAChartSeries(
import java.util.List;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
private void parseLog(SystemData logData) {
try {
if (!isInitialized) {
- String[] deviceList = DACommunicator.getSelectedDevice()
+ String[] deviceList = GlobalInformation.getCurrentDeviceInfo()
.getTargetInfo().getDevices()
.split(CommonConstants.COMMA);
for (String device : deviceList) {
import org.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
import org.tizen.dynamicanalyzer.resources.ImageResources;
if(DACommunicator.isTargetEmulator()
&& SocketClient.getInstance().isConnected()) {
- imagePathLog = DACommunicator.getSelectedDevice()
+ imagePathLog = GlobalInformation.getCurrentDeviceInfo()
.emulatorScreenshot.getFilePath();
} else {
imagePathLog = logData.getImageFilePath();
import org.tizen.dynamicanalyzer.appearance.DesignConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
public static final String PROCESS_SPLITER = CommonConstants.SPACE
+ CommonConstants.COLON + CommonConstants.SPACE;
- String selectedDevice = null;
- AppInfo selectedApp = null;
-
private static ToolbarArea coolbarArea;
// Toolbar
public static final int TOOLBAR_STATE_RECORDING = 0;
public static final int TOOLBAR_STATE_READY = 1;
- public String getSelectedDevice() {
- return selectedDevice;
- }
-
- public void setSelectedDevice(String selectedDevice) {
- this.selectedDevice = selectedDevice;
- }
-
- public AppInfo getSelectedApp() {
- return selectedApp;
- }
-
- public void setSelectedApp(AppInfo selectedApp) {
- this.selectedApp = selectedApp;
- }
-
public static void createInstance(Composite parent) {
if (null == coolbarArea) {
coolbarArea = new ToolbarArea(parent);
return;
}
- String sDeviceName = DACommunicator.getSelectedDevice()
+ String sDeviceName = GlobalInformation.getCurrentDeviceInfo()
.getIDevice().getSerialNumber();
String pDeviceName = p.getDevice();
@Override
public void selectionEvent(DACustomCombo combo) {
- String oldDevice = getSelectedDevice();
+ String oldDeviceName = null;
+ DeviceInfo oldDevInfo = GlobalInformation
+ .getCurrentDeviceInfo();
+ if (oldDevInfo != null)
+ oldDeviceName = oldDevInfo.getIDevice().getSerialNumber();
String serial = combo.getText();
- if (!serial.equals(oldDevice)) {
- DACommunicator.setSelectedDeviceBySerial(serial);
- setSelectedDevice(serial);
+ if (!serial.equals(oldDeviceName)) {
+ GlobalInformation.setCurrentDeviceInfo(DACommunicator
+ .setSelectedDeviceBySerial(serial));
if (null != serial && !serial.isEmpty()) {
initAppCombo();
}
.getPkgInfoByName(appName);
if (null != selectedApp) {
- DACommunicator.setSelectedApp(selectedApp);
- setSelectedApp(selectedApp);
- DACommunicator.getSelectedDevice().setSelectedAppName(
- selectedApp.getInfo(AppInfo.LABEL_INDEX));
+ GlobalInformation.setCurrentApplication(selectedApp);
+ GlobalInformation.getCurrentDeviceInfo()
+ .getCommunicator().onAppSelected(selectedApp);
+ GlobalInformation.getCurrentDeviceInfo()
+ .setSelectedAppName(
+ selectedApp
+ .getInfo(AppInfo.LABEL_INDEX));
}
- if (null != DACommunicator.getSelectedDevice()) {
+ if (null != GlobalInformation.getCurrentDeviceInfo()) {
// AnalyzerUtil
// .setRecordState(RecordStateSourceProvider.RECORD_READY);
AnalyzerManager.setRunningState(false);
}
if (!deviceCombo.isEnabled()
- || null == DACommunicator.getSelectedDevice()) {
+ || null == GlobalInformation.getCurrentDeviceInfo()) {
appCombo.setEnabled(false);
}
if (!appCombo.isEnabled()
- || null == DACommunicator.getSelectedApp()) {
+ || null == GlobalInformation.getCurrentApplication()) {
setStartButtonEnablement(false);
}
appCombo.add(apps.get(i).getInfo(AppInfo.LABEL_INDEX));
}
if (size > 0) {
- String appName = DACommunicator.getSelectedDevice()
+ String appName = GlobalInformation.getCurrentDeviceInfo()
.getSelectedAppName();
if (null == appName) {
appCombo.select(0);
- setSelectedApp(apps.get(0));
- DACommunicator.setSelectedApp(apps.get(0));
- DACommunicator.getSelectedDevice().setSelectedAppName(
+ GlobalInformation.setCurrentApplication(apps.get(0));
+ GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .onAppSelected(apps.get(0));
+ GlobalInformation.getCurrentDeviceInfo().setSelectedAppName(
apps.get(0).getInfo(AppInfo.LABEL_INDEX));
} else {
AppInfo appInfo = DACommunicator.getPkgInfoByName(appName);
if (null != appInfo) {
appCombo.setText(appName);
- setSelectedApp(appInfo);
- DACommunicator.setSelectedApp(appInfo);
- DACommunicator.getSelectedDevice().setSelectedAppName(
- appInfo.getInfo(AppInfo.LABEL_INDEX));
+ GlobalInformation.setCurrentApplication(appInfo);
+ GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .onAppSelected(appInfo);
+ GlobalInformation.getCurrentDeviceInfo()
+ .setSelectedAppName(
+ appInfo.getInfo(AppInfo.LABEL_INDEX));
// startButton.setButtonEnabled(true);
setStartButtonState(true);
} else {
appCombo.setText(appName);
appCombo.select(0);
- setSelectedApp(null);
- DACommunicator.setSelectedApp(null);
+ GlobalInformation.setCurrentApplication(null);
}
}
} else {
appCombo.add(CommonConstants.EMPTY);
appCombo.select(0);
- setSelectedApp(null);
- DACommunicator.setSelectedApp(null);
+ GlobalInformation.setCurrentApplication(null);
}
}
} else {
int size = items.size();
int selIndex = 0;
- String selDevice = DACommunicator.getSelectedDevice().getIDevice()
- .getSerialNumber();
+ String selDevice = GlobalInformation.getCurrentDeviceInfo()
+ .getIDevice().getSerialNumber();
for (int i = 0; i < size; i++) {
deviceCombo.add(items.get(i));
if (items.get(i).equals(selDevice)) {
}
deviceCombo.select(selIndex);
- setSelectedDevice(items.get(selIndex));
+ GlobalInformation.setCurrentDeviceInfo(DACommunicator
+ .getDeviceByName(items.get(selIndex)));
deviceCombo.setToolTipText(items.get(selIndex));
if (null == oldDevice || !oldDevice.equals(selDevice)) {
appCombo.select(COMBO_FIRST_INDEX);
AppInfo appInfo = DACommunicator.getPkgInfoByName(items.get(0));
if (null != appInfo) {
- DACommunicator.setSelectedApp(appInfo);
- DACommunicator.getSelectedDevice().setSelectedAppName(
+ GlobalInformation.setCurrentApplication(appInfo);
+ GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .onAppSelected(appInfo);
+ GlobalInformation.getCurrentDeviceInfo().setSelectedAppName(
appInfo.getInfo(AppInfo.LABEL_INDEX));
appCombo.setToolTipText(appCombo.getItem(0));
setStartButtonState(true);
public void setAppComboText(final String text) {
AppInfo appInfo = DACommunicator.getPkgInfoByName(text);
if (null != appInfo) {
- DACommunicator.setSelectedApp(appInfo);
- DACommunicator.getSelectedDevice().setSelectedAppName(
+ GlobalInformation.setCurrentApplication(appInfo);
+ GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .onAppSelected(appInfo);
+ GlobalInformation.getCurrentDeviceInfo().setSelectedAppName(
appInfo.getInfo(AppInfo.LABEL_INDEX));
Display.getDefault().syncExec(new Runnable() {
@Override
public void setAppComboTextByAppId(String id) {
AppInfo appInfo = DACommunicator.getPkgInfoByAppPkgId(id);
if (null != appInfo) {
- DACommunicator.setSelectedApp(appInfo);
- DACommunicator.getSelectedDevice().setSelectedAppName(
+ GlobalInformation.setCurrentApplication(appInfo);
+ GlobalInformation.getCurrentDeviceInfo().getCommunicator()
+ .onAppSelected(appInfo);
+ GlobalInformation.getCurrentDeviceInfo().setSelectedAppName(
appInfo.getInfo(AppInfo.LABEL_INDEX));
appCombo.setText(appInfo.getInfo(AppInfo.LABEL_INDEX));
}
}
String text = deviceCombo.getText();
- String device = DACommunicator.getSelectedDevice().getIDevice()
- .getSerialNumber();
+ String device = GlobalInformation.getCurrentDeviceInfo()
+ .getIDevice().getSerialNumber();
if (!device.equals(text)) {
// startButton.setButtonEnabled(false);
setStartButtonState(false);
@Override
public void run() {
String text = deviceCombo.getText();
- String device = DACommunicator.getSelectedDevice().getIDevice()
- .getSerialNumber();
+ String device = GlobalInformation.getCurrentDeviceInfo()
+ .getIDevice().getSerialNumber();
if (!device.equals(text)) {
// startButton.setButtonEnabled(false);
setStartButtonState(false);
private void setStartButtonState(boolean enabled) {
if (enabled) {
- DeviceInfo device = DACommunicator.getSelectedDevice();
+ DeviceInfo device = GlobalInformation.getCurrentDeviceInfo();
if (null != device && device.isConfigSuccess()) {
startButton.setButtonEnabled(true);
}
@Override
public void handleClickEvent(DACustomButton button) {
DeviceExplorerDilaog dialog = new DeviceExplorerDilaog(getShell());
- dialog.setFilter(".so");
+// dialog.setFilter(".so");
Object result = dialog.open();
if (result != null) {
BinarySettingProgressManager.getInstance().startProcessStart(
import org.eclipse.nebula.widgets.grid.Grid;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.HostResult;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
public void applySwapValue(DATableComposite featuresTable) {
setFeaturesValueFromTableItemsList(featuresTable.getTable());
applySettingValueToConfigureManager();
- if (null != DACommunicator.getSelectedDevice()) {
+ if (null != GlobalInformation.getCurrentDeviceInfo()) {
HostResult result = DACommunicator.sendRuntimeMessage(
DACommunicator.MSG_TYPE_CONFIG, null);
if (!result.equals(HostResult.SUCCESS)) {
applyFailedSwapValue(featuresTable);
- } else if (!DACommunicator.getSelectedDevice().isConfigSuccess()) {
- DACommunicator.getSelectedDevice().setConfigSuccess(true);
+ } else if (!GlobalInformation.getCurrentDeviceInfo().isConfigSuccess()) {
+ GlobalInformation.getCurrentDeviceInfo().setConfigSuccess(true);
ToolbarArea.getInstance().setStartButtonEnablement(true);
} else {
updateFeaturesValueFromConfigureManager();
package org.tizen.dynamicanalyzer.ui.toolbar.replay.data;
+import java.sql.PreparedStatement;
import java.util.List;
import org.tizen.dynamicanalyzer.database.DBColumn;
SqlConnectionManager.executeUpdate(DELETE_QUERY);
return true;
}
+
+ @Override
+ public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.common.ScreenshotConstants;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
}
private void getDeviceResolution() {
- String selDeviceName = DACommunicator.getSelectedDevice().getIDevice()
+ String selDeviceName = GlobalInformation.getCurrentDeviceInfo().getIDevice()
.getDeviceName();
String resolutionInfoXmlPath = PathManager.TIZEN_SDK_DATA_PATH
+ File.separator + "emulator-vms" + File.separator + "vms"//$NON-NLS-1$
import org.eclipse.ui.handlers.IHandlerService;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.swap.channel.control.BinaryInfo;
public static String getBinarySourcePath(int pid, long time) {
String localBinPath = AnalyzerUtil.getProcessLocalBinaryPath(pid, time);
String key = getTargetPathKey(localBinPath);
- BinaryInfo binInfo = DACommunicator.getSelectedApp().getBinaryInfo(key);
+ BinaryInfo binInfo = GlobalInformation.getCurrentApplication().getBinaryInfo(key);
String sourceBinPath = binInfo.getTempBinaryPath();
return sourceBinPath;
}
String path = processInfo.getMainTargetBinaryPath();
String key = getTargetPathKey(path);
- BinaryInfo binInfo = DACommunicator.getSelectedApp().getBinaryInfo(key);
+ BinaryInfo binInfo = GlobalInformation.getCurrentApplication().getBinaryInfo(key);
return binInfo;
}
String path = processInfo.getMainTargetBinaryPath();
String key = getTargetPathKey(path);
- BinaryInfo binInfo = DACommunicator.getSelectedApp().getBinaryInfo(key);
+ BinaryInfo binInfo = GlobalInformation.getCurrentApplication().getBinaryInfo(key);
if (null == binInfo) {
return false;
}
}
public static boolean getBinaryBuildType(String localBinaryPath) {
- HashMap<String, BinaryInfo> binMap = DACommunicator.getSelectedApp()
+ HashMap<String, BinaryInfo> binMap = GlobalInformation.getCurrentApplication()
.getBinaryInfoMap();
String key = AnalyzerUtil.getTargetPathKey(localBinaryPath);
BinaryInfo binInfo = binMap.get(key);