From 81833c03db62112f173ee3733659ee5dd7615f56 Mon Sep 17 00:00:00 2001 From: greatim Date: Thu, 18 Sep 2014 15:17:50 +0900 Subject: [PATCH] INTERNAL: remove probe format class (unnecessary) remove probe format class change GlobalInformation -> Global remove some unnecessary code in RangeDataManager move PAGE constants in CommonConstants to AnalyzerConstants Change-Id: I266882f8edc1b766d99957a60e58d8e378363ba5 Signed-off-by: greatim --- .../dynamicanalyzer/constant/CommonConstants.java | 11 -- .../dynamicanalyzer/common/AnalyzerConstants.java | 10 + .../dynamicanalyzer/common/AutoStartManager.java | 2 +- .../common/{GlobalInformation.java => Global.java} | 2 +- .../communicator/Communicator22.java | 8 +- .../communicator/CommunicatorUtils.java | 18 +- .../communicator/DACommunicator.java | 74 +++---- .../communicator/IDECommunicator.java | 4 +- .../org/tizen/dynamicanalyzer/project/Project.java | 25 ++- .../org/tizen/dynamicanalyzer/sql/SqlManager.java | 141 +------------- .../swap/callstack/BaseCallstackManager.java | 6 +- .../swap/communicator/Communicator30.java | 28 +-- .../swap/logparser/SWAPLogParser.java | 6 +- .../swap/model/data/LogDataFactory.java | 55 ++---- .../swap/model/format/CommonColumns.java | 97 --------- .../swap/model/format/ContextSwitchLogFormat.java | 62 ------ .../swap/model/format/ControlLogFormat.java | 64 ------ .../swap/model/format/CustomChartLogFormat.java | 64 ------ .../swap/model/format/FileLogFormat.java | 64 ------ .../swap/model/format/GLES20LogFormat.java | 42 ---- .../swap/model/format/HeaderColumns.java | 88 --------- .../swap/model/format/LifeCycleLogFormat.java | 45 ----- .../swap/model/format/LogFormat.java | 138 ------------- .../swap/model/format/MemoryLogFormat.java | 68 ------- .../swap/model/format/NetworkLogFormat.java | 67 ------- .../swap/model/format/ProfilingLogFormat.java | 64 ------ .../swap/model/format/ReplayLogFormat.java | 64 ------ .../swap/model/format/SceneLogFormat.java | 65 ------- .../swap/model/format/ScreenShotLogFormat.java | 62 ------ .../swap/model/format/SyncLogFormat.java | 62 ------ .../swap/model/format/SystemLogFormat.java | 118 ----------- .../swap/model/format/ThreadLogFormat.java | 63 ------ .../swap/model/format/UIEventLogFormat.java | 79 -------- .../swap/model/format/UserFunctionLogFormat.java | 62 ------ .../swap/platform/ui/DAFileTreeExplorer.java | 6 +- .../ui/DeviceExplorer/DeviceExplorerDilaog.java | 6 +- .../tizen/dynamicanalyzer/ui/page/BaseView.java | 146 +++++++------- .../dynamicanalyzer/ui/range/RangeDataManager.java | 216 ++++++--------------- .../dynamicanalyzer/ui/summary/leaks/LeakData.java | 2 +- .../ui/summary/leaks/LeakTable.java | 4 +- .../ui/summary/warning/WarningData.java | 2 +- .../ui/summary/warning/WarningTable.java | 2 +- .../ui/timeline/common/TimelineChartManager.java | 4 +- .../ui/toolbar/ProcessExplorerDialog.java | 4 +- .../dynamicanalyzer/ui/toolbar/ToolbarArea.java | 52 ++--- .../ConfigurationDialogDataManager.java | 8 +- .../replayEditor/ReplayEditScreenshotDialog.java | 4 +- 47 files changed, 296 insertions(+), 1988 deletions(-) rename org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/{GlobalInformation.java => Global.java} (97%) delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/CommonColumns.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ContextSwitchLogFormat.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ControlLogFormat.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/CustomChartLogFormat.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/FileLogFormat.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/GLES20LogFormat.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/HeaderColumns.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LifeCycleLogFormat.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LogFormat.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/MemoryLogFormat.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/NetworkLogFormat.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ProfilingLogFormat.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ReplayLogFormat.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SceneLogFormat.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ScreenShotLogFormat.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SyncLogFormat.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SystemLogFormat.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ThreadLogFormat.java delete mode 100755 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/UIEventLogFormat.java delete mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/UserFunctionLogFormat.java diff --git a/org.tizen.dynamicanalyzer.common/src/org/tizen/dynamicanalyzer/constant/CommonConstants.java b/org.tizen.dynamicanalyzer.common/src/org/tizen/dynamicanalyzer/constant/CommonConstants.java index 47168a9..ec3ac4a 100644 --- a/org.tizen.dynamicanalyzer.common/src/org/tizen/dynamicanalyzer/constant/CommonConstants.java +++ b/org.tizen.dynamicanalyzer.common/src/org/tizen/dynamicanalyzer/constant/CommonConstants.java @@ -91,15 +91,4 @@ public class CommonConstants { public final static int FLOAT_SIZE = Float.SIZE / Byte.SIZE; public final static int DOUBLE_SIZE = Double.SIZE / Byte.SIZE; - /* Tab Page */ - public static final int PAGE_TIME_LINE = 0; - public static final int PAGE_THREAD = 1; - public static final int PAGE_NETWORK = 2; - public static final int PAGE_FILE = 3; - public static final int PAGE_GRAPHICS = 4; - public static final int PAGE_UI = 5; - public static final int PAGE_KERNEL = 6; - public static final int PAGE_SUMMARY = 7; - public static final int PAGE_RANGE = 8; - } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerConstants.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerConstants.java index 12198a4..1024b3e 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerConstants.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerConstants.java @@ -122,6 +122,16 @@ public class AnalyzerConstants { public static final int PROJECT_PROF_START_TIME_INDEX = 8; public static final int PROJECT_SAVE_PATH_INDEX = 9; + /* Tab Page */ + public static final int PAGE_TIME_LINE = 0; + public static final int PAGE_THREAD = 1; + public static final int PAGE_NETWORK = 2; + public static final int PAGE_FILE = 3; + public static final int PAGE_GRAPHICS = 4; + public static final int PAGE_UI = 5; + public static final int PAGE_KERNEL = 6; + public static final int PAGE_SUMMARY = 7; + public static final int PAGE_RANGE = 8; /* save return values */ public static final int ERROR_EXTENSION_FAIL = -1; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AutoStartManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AutoStartManager.java index a35bd60..dfc037f 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AutoStartManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AutoStartManager.java @@ -110,7 +110,7 @@ public class AutoStartManager implements Runnable { Logger.debug("auto start : " + appid); DeviceInfo device = DACommunicator.getDeviceByName(deviceName); - GlobalInformation.setCurrentDeviceInfo(device); + Global.setCurrentDeviceInfo(device); PackageInfo pkgInfo = DACommunicator.getPkgInfoByMainAppID(appid); if (null == pkgInfo) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/GlobalInformation.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/Global.java similarity index 97% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/GlobalInformation.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/Global.java index d8217c0..418ffa4 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/GlobalInformation.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/Global.java @@ -7,7 +7,7 @@ import org.tizen.dynamicanalyzer.swap.channel.control.RunTimeConfiguration; // This class is for global information that can be accessed from anywhere in dynamic analyzer code. // So this class contains only static methods and variables. -public class GlobalInformation { +public class Global { private static DeviceInfo currentDevice = null; private static PackageInfo currentApplication = null; private static Project currentProject = null; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/Communicator22.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/Communicator22.java index a8e9742..4041432 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/Communicator22.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/Communicator22.java @@ -40,7 +40,7 @@ import org.eclipse.swt.widgets.Display; 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.Global; import org.tizen.dynamicanalyzer.common.HostResult; import org.tizen.dynamicanalyzer.constant.CommonConstants; import org.tizen.dynamicanalyzer.model.DeviceInfo; @@ -161,7 +161,7 @@ public class Communicator22 extends BaseCommunicator { isArm = 1; } - DeviceInfo device = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo device = Global.getCurrentDeviceInfo(); if (device == null) { return HostResult.ERR_DEVICE_IS_NULL; } @@ -171,7 +171,7 @@ public class Communicator22 extends BaseCommunicator { isEmul = 1; } - PackageInfo pkg = GlobalInformation.getCurrentApplication(); + PackageInfo pkg = Global.getCurrentApplication(); if (null == pkg) { return HostResult.ERR_SELECTED_APP_IS_NULL; } @@ -289,7 +289,7 @@ public class Communicator22 extends BaseCommunicator { .execCommand(AnalyzerShellCommands.DACOMMAND_RUN_MANAGER); // step 3. get remote port from /tmp/port.da in device or emul - remotePort = CommunicatorUtils.getRemotePort(GlobalInformation + remotePort = CommunicatorUtils.getRemotePort(Global .getCurrentDeviceInfo().getIDevice()); if (remotePort < 0) { return HostResult.ERR_REMOTE_PORT_GET_FAILED; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/CommunicatorUtils.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/CommunicatorUtils.java index 4ee3591..efeae88 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/CommunicatorUtils.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/CommunicatorUtils.java @@ -41,7 +41,7 @@ import java.util.List; 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.Global; import org.tizen.dynamicanalyzer.common.HostResult; import org.tizen.dynamicanalyzer.common.path.PathConstants; import org.tizen.dynamicanalyzer.common.path.PathManager; @@ -113,7 +113,7 @@ public class CommunicatorUtils { return HostResult.ERR_FILE_IS_NOT_EXISTS; } - result = uploadFile(GlobalInformation.getCurrentDeviceInfo() + result = uploadFile(Global.getCurrentDeviceInfo() .getIDevice(), source, PathConstants.DA_REMOTE_PATH + AnalyzerConstants.READELF_BIN); if (!result.isSuccess()) { @@ -161,7 +161,7 @@ public class CommunicatorUtils { public static void execShellCommand(String command, IShellOutputReceiver receiver) { - DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo currentDevice = Global.getCurrentDeviceInfo(); if (null != currentDevice && isOnline(currentDevice.getIDevice())) { try { currentDevice.getIDevice().executeShellCommand(command, @@ -240,7 +240,7 @@ public class CommunicatorUtils { public static SyncResult pull(String remote, String local, ISyncProgressMonitor monitor) { SyncResult result = null; - DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo currentDevice = Global.getCurrentDeviceInfo(); if (null != currentDevice && isOnline(currentDevice.getIDevice())) { FileOutputStream fileOut = null; try { @@ -396,13 +396,13 @@ public class CommunicatorUtils { } public static HostResult foward(int local, int remote) { - DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo currentDevice = Global.getCurrentDeviceInfo(); return foward(currentDevice.getIDevice(), local, remote); } public static void unfoward(int local, int remote) { - DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo currentDevice = Global.getCurrentDeviceInfo(); unfoward(currentDevice.getIDevice(), local, remote); } @@ -425,7 +425,7 @@ public class CommunicatorUtils { } public static void removeCommand(String path) { - DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo currentDevice = Global.getCurrentDeviceInfo(); if (null != currentDevice && isOnline(currentDevice.getIDevice())) { try { currentDevice.getIDevice().executeShellCommand( @@ -446,7 +446,7 @@ public class CommunicatorUtils { public static void execHostCommand(String command, IShellOutputReceiver receiver) { - DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo currentDevice = Global.getCurrentDeviceInfo(); if (null != currentDevice && isOnline(currentDevice.getIDevice())) { try { currentDevice.getIDevice() @@ -469,7 +469,7 @@ public class CommunicatorUtils { } public static Process execCommand(String command) { - DeviceInfo currentDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo currentDevice = Global.getCurrentDeviceInfo(); if (null != currentDevice) { return execCommand(currentDevice.getIDevice(), command); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java index 8bee963..bd1a55d 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java @@ -43,7 +43,7 @@ import org.eclipse.swt.widgets.Display; 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.Global; import org.tizen.dynamicanalyzer.common.HostResult; import org.tizen.dynamicanalyzer.common.path.PathConstants; import org.tizen.dynamicanalyzer.common.path.PathManager; @@ -89,19 +89,19 @@ public class DACommunicator { } public static HostResult startTrace() { - return GlobalInformation.getCurrentDeviceInfo().getCommunicator().startTrace(); + return Global.getCurrentDeviceInfo().getCommunicator().startTrace(); } public static HostResult sendRuntimeMessage(int type, String message) { - return GlobalInformation.getCurrentDeviceInfo().sendRuntimeMessage(type, message); + return Global.getCurrentDeviceInfo().sendRuntimeMessage(type, message); } public static HostResult stopTrace() { - return GlobalInformation.getCurrentDeviceInfo().getCommunicator().stopTrace(); + return Global.getCurrentDeviceInfo().getCommunicator().stopTrace(); } public static void exit() { - GlobalInformation.getCurrentDeviceInfo().getCommunicator().exit(); + Global.getCurrentDeviceInfo().getCommunicator().exit(); } public static void reload() { @@ -132,8 +132,8 @@ public class DACommunicator { } public static PackageInfo getSelectedPackage() { - return GlobalInformation.getCurrentDeviceInfo().getPackageInfoHash() - .get(GlobalInformation.getCurrentApplication().getPackageId()); + return Global.getCurrentDeviceInfo().getPackageInfoHash() + .get(Global.getCurrentApplication().getPackageId()); } public static void setNewBridge() { @@ -231,7 +231,7 @@ public class DACommunicator { } public static Map getAppListFromTarget() { - DeviceInfo curDev = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo curDev = Global.getCurrentDeviceInfo(); if (curDev == null) { return null; } @@ -310,7 +310,7 @@ public class DACommunicator { } public static Map getProcessListFromTarget() { - if (null == GlobalInformation.getCurrentDeviceInfo()) { + if (null == Global.getCurrentDeviceInfo()) { return null; } @@ -348,7 +348,7 @@ public class DACommunicator { } public static String getProcessNameFromTarget(int pid) { - if (null == GlobalInformation.getCurrentDeviceInfo()) { + if (null == Global.getCurrentDeviceInfo()) { return null; } String processName = null; @@ -369,7 +369,7 @@ public class DACommunicator { } public static PackageInfo getPkgInfoByMainAppID(String appid) { - DeviceInfo curDev = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo curDev = Global.getCurrentDeviceInfo(); if (null != curDev) { Map pkgHash = curDev.getPackageInfoHash(); @@ -386,7 +386,7 @@ public class DACommunicator { } public static PackageInfo getPkgInfoByLabel(String appLabel) { - DeviceInfo curDev = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo curDev = Global.getCurrentDeviceInfo(); if (null != curDev) { Map pkgHash = curDev.getPackageInfoHash(); @@ -403,8 +403,8 @@ public class DACommunicator { } public static PackageInfo getPkgInfoByPkgId(String pkgid) { - if (null != GlobalInformation.getCurrentDeviceInfo()) { - return GlobalInformation.getCurrentDeviceInfo().getPackageInfoHash().get(pkgid); + if (null != Global.getCurrentDeviceInfo()) { + return Global.getCurrentDeviceInfo().getPackageInfoHash().get(pkgid); } else { return null; } @@ -416,7 +416,7 @@ public class DACommunicator { } public static boolean isTargetEmulator() { - DeviceInfo device = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo device = Global.getCurrentDeviceInfo(); if (device != null) { if (device.getIDevice().getSerialNumber().contains(CommonConstants.EMULATOR)) { return true; @@ -453,7 +453,7 @@ public class DACommunicator { Logger.debug("device disconnected : " + device.getSerialNumber()); DeviceInfo deviceInfo = getDeviceByName(device.getSerialNumber()); - DeviceInfo selectedDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo selectedDevice = Global.getCurrentDeviceInfo(); if (null != devices && !devices.isEmpty()) { devices.remove(deviceInfo); if (!AnalyzerManager.isRunning()) { @@ -497,8 +497,8 @@ public class DACommunicator { updateToolbarDevice(); } } - if (null != GlobalInformation.getCurrentDeviceInfo() - && null != GlobalInformation.getCurrentApplication()) { + if (null != Global.getCurrentDeviceInfo() + && null != Global.getCurrentApplication()) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { @@ -536,8 +536,8 @@ public class DACommunicator { updateToolbarDevice(); } } - if (null != GlobalInformation.getCurrentDeviceInfo() - && null != GlobalInformation.getCurrentApplication()) { + if (null != Global.getCurrentDeviceInfo() + && null != Global.getCurrentApplication()) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { @@ -562,7 +562,7 @@ public class DACommunicator { public static void updateToolbarDevice() { final List deviceSerials = new ArrayList(); final String selectedDevice; - DeviceInfo selDev = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo selDev = Global.getCurrentDeviceInfo(); if (selDev != null) { selectedDevice = selDev.getIDevice().getSerialNumber(); } else { @@ -578,7 +578,7 @@ public class DACommunicator { } } if (!devices.isEmpty()) { - GlobalInformation.setCurrentDeviceInfo(devices.get(selIndex)); + Global.setCurrentDeviceInfo(devices.get(selIndex)); } else { clearDeviceAppInfo(); } @@ -592,15 +592,15 @@ public class DACommunicator { } private static void clearDeviceAppInfo() { - GlobalInformation.setCurrentDeviceInfo(null); - GlobalInformation.setCurrentApplication(null); + Global.setCurrentDeviceInfo(null); + Global.setCurrentApplication(null); cmdResultMultiLines.clear(); } public static DeviceInfo setSelectedDeviceBySerial(String serial) { DeviceInfo dev = null; if (null == serial || serial.isEmpty()) { - GlobalInformation.setCurrentDeviceInfo(null); + Global.setCurrentDeviceInfo(null); } else { int size = getDevices().size(); for (int i = 0; i < size; i++) { @@ -608,7 +608,7 @@ public class DACommunicator { if (null != idev) { if (serial.equals(idev.getSerialNumber())) { dev = devices.get(i); - GlobalInformation.setCurrentDeviceInfo(dev); + Global.setCurrentDeviceInfo(dev); break; } } @@ -661,27 +661,27 @@ public class DACommunicator { // } public static boolean isWaitToReceive() { - return GlobalInformation.getCurrentDeviceInfo().getCommunicator().isBlocked(); + return Global.getCurrentDeviceInfo().getCommunicator().isBlocked(); } public static BufferedReader getSockBufferedReader() { - return GlobalInformation.getCurrentDeviceInfo().getCommunicator().getDataBufferedReader(); + return Global.getCurrentDeviceInfo().getCommunicator().getDataBufferedReader(); } public static void closeAll() { - GlobalInformation.getCurrentDeviceInfo().getCommunicator().clear(); + Global.getCurrentDeviceInfo().getCommunicator().clear(); } public static void closeSock() { - GlobalInformation.getCurrentDeviceInfo().getCommunicator().closeSock(); + Global.getCurrentDeviceInfo().getCommunicator().closeSock(); } public static HostResult handleControlMessage(String msg) { - return GlobalInformation.getCurrentDeviceInfo().getCommunicator().handleControlMessage(msg); + return Global.getCurrentDeviceInfo().getCommunicator().handleControlMessage(msg); } public static Map sendProcessAddInfoMessage(List pids) { - DeviceInfo dev = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo dev = Global.getCurrentDeviceInfo(); if (dev != null) { if (isSWAPVersion()) { return ((Communicator30) dev.getCommunicator()).sendProcessAddInfoMessage(pids); @@ -692,7 +692,7 @@ public class DACommunicator { public static HostResult sendBinaryInfoMessageForLib(List input) { if (isSWAPVersion()) { - return ((Communicator30) GlobalInformation.getCurrentDeviceInfo().getCommunicator()) + return ((Communicator30) Global.getCurrentDeviceInfo().getCommunicator()) .sendBinaryInfoMessageForLib(input); } return null; @@ -700,7 +700,7 @@ public class DACommunicator { public static HostResult sendSWAPMessage(int messageId, List input) { if (isSWAPVersion()) { - return ((Communicator30) GlobalInformation.getCurrentDeviceInfo().getCommunicator()) + return ((Communicator30) Global.getCurrentDeviceInfo().getCommunicator()) .sendSWAPMessage(messageId, input); } return null; @@ -708,7 +708,7 @@ public class DACommunicator { public static HostResult sendScreenShotMessage() { if (isSWAPVersion()) { - return ((Communicator30) GlobalInformation.getCurrentDeviceInfo().getCommunicator()) + return ((Communicator30) Global.getCurrentDeviceInfo().getCommunicator()) .sendScreenShotRequest(); } return null; @@ -719,7 +719,7 @@ public class DACommunicator { } public static Socket getDataSocket() { - return GlobalInformation.getCurrentDeviceInfo().getCommunicator().getDataSocket(); + return Global.getCurrentDeviceInfo().getCommunicator().getDataSocket(); } public static String getTargetVersion(DeviceInfo device) { @@ -727,7 +727,7 @@ public class DACommunicator { } public static boolean isSWAPVersion() { - if (GlobalInformation.getCurrentDeviceInfo().getTargetVersion().contains("3.0")) { + if (Global.getCurrentDeviceInfo().getTargetVersion().contains("3.0")) { return true; } else { return false; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java index ebdb483..0034814 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java @@ -48,7 +48,7 @@ import org.eclipse.swt.widgets.Display; 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.Global; import org.tizen.dynamicanalyzer.common.path.PathManager; import org.tizen.dynamicanalyzer.constant.CommonConstants; import org.tizen.dynamicanalyzer.model.DeviceInfo; @@ -351,7 +351,7 @@ public class IDECommunicator implements Runnable { Logger.debug("auto start : " + binaryOfTarget); DeviceInfo device = DACommunicator.getDeviceByName(deviceName); - GlobalInformation.setCurrentDeviceInfo(device); + Global.setCurrentDeviceInfo(device); DACommunicator.getAppListFromTarget(); PackageInfo pkgInfo = null; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java index b406b61..3eb91b2 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java @@ -42,7 +42,7 @@ import java.util.Map; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.common.GlobalInformation; +import org.tizen.dynamicanalyzer.common.Global; import org.tizen.dynamicanalyzer.common.path.PathConstants; import org.tizen.dynamicanalyzer.common.path.PathManager; import org.tizen.dynamicanalyzer.communicator.DACommunicator; @@ -285,29 +285,29 @@ public class Project { // this initForTrace() function called only when trace is started. public void initForTrace() { - if (null == GlobalInformation.getCurrentApplication()) { + if (null == Global.getCurrentApplication()) { String comboText = ToolbarArea.getInstance().getAppCombo().getText(); PackageInfo pkgInfo = DACommunicator.getPkgInfoByLabel(comboText); - GlobalInformation.setCurrentApplication(pkgInfo); - GlobalInformation.getCurrentDeviceInfo().getCommunicator().onAppSelected(pkgInfo); + Global.setCurrentApplication(pkgInfo); + Global.getCurrentDeviceInfo().getCommunicator().onAppSelected(pkgInfo); } - setProtocolVersion(GlobalInformation.getCurrentDeviceInfo().getTargetVersion()); + setProtocolVersion(Global.getCurrentDeviceInfo().getTargetVersion()); - setDeviceStatusInfo(GlobalInformation.getCurrentDeviceInfo().getDeviceStatusInfo()); - setApplicationInfo(GlobalInformation.getCurrentApplication().getMainApp()); - RunTimeConfiguration currentConfig = GlobalInformation.getCurrentConfiguration(); + setDeviceStatusInfo(Global.getCurrentDeviceInfo().getDeviceStatusInfo()); + setApplicationInfo(Global.getCurrentApplication().getMainApp()); + RunTimeConfiguration currentConfig = Global.getCurrentConfiguration(); if (currentConfig != null) { addConfigHistory(currentConfig); } - setAppName(GlobalInformation.getCurrentApplication().getMainApp() + setAppName(Global.getCurrentApplication().getMainApp() .getInfo(AppInfo.PROPERTY.LABEL.index)); - setPackageID(GlobalInformation.getCurrentApplication().getPackageId()); - DeviceInfo deviceName = GlobalInformation.getCurrentDeviceInfo(); + setPackageID(Global.getCurrentApplication().getPackageId()); + DeviceInfo deviceName = Global.getCurrentDeviceInfo(); if (null != deviceName && null != deviceName.getIDevice().getSerialNumber() && !deviceName.getIDevice().getSerialNumber().isEmpty()) { - setDevice(GlobalInformation.getCurrentDeviceInfo().getIDevice().getSerialNumber()); + setDevice(Global.getCurrentDeviceInfo().getIDevice().getSerialNumber()); } else { setDevice(CommonConstants.SPACE); } @@ -354,7 +354,6 @@ public class Project { DBTableRegistry.createDBTables(); SqlManager.getInstance().createTables(); - SqlManager.getInstance().createProbeTable(); } public void dispose() { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java index 0f7cd0f..795480b 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java @@ -45,7 +45,6 @@ import org.tizen.dynamicanalyzer.logparser.LogCenterConstants; import org.tizen.dynamicanalyzer.project.Project; import org.tizen.dynamicanalyzer.swap.model.data.LogData; import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory; -import org.tizen.dynamicanalyzer.swap.model.format.LogFormat; import org.tizen.dynamicanalyzer.util.CommonUtil; import org.tizen.dynamicanalyzer.util.Logger; @@ -143,94 +142,6 @@ public class SqlManager { instance = null; } - public synchronized void createProbeTable() { - Statement stat = null; - try { - Connection conn = getConnection(); - if (null == conn) { - return; - } - - List logFormats = LogFormat.getLogFormats(); - int size = logFormats.size(); - semaphoreAcquire(); - stat = conn.createStatement(); - for (int i = 0; i < size; i++) { - if (AnalyzerManager.isExit()) { - break; - } - LogFormat lf = logFormats.get(i); - String tableName = lf.getName(); - String dropTableQuery = createDropTableQuery(tableName); - if (isQueryPrint) { - Logger.debug("query : " + dropTableQuery); - } - stat.executeUpdate(dropTableQuery); - - String createTableQuery = createTableQuery(lf); - if (isQueryPrint) { - Logger.debug("query : " + createTableQuery); - } - stat.executeUpdate(createTableQuery); - executeCreateIndexTable(stat, tableName, "time");//$NON-NLS-1$//$NON-NLS-2$ - } - } catch (SQLException e) { - e.printStackTrace(); - } finally { - CommonUtil.tryClose(stat); - semaphoreRelease(); - } - } - - private String createTableQuery(LogFormat logFormat) { - StringBuffer query = new StringBuffer(); - query.append("create table "); //$NON-NLS-1$ - String name = logFormat.getName(); - query.append(name); - query.append(CommonConstants.SPACE + CommonConstants.OPEN_BRACKET); - - List dbColumns = logFormat.getDBColumnNames(); - List dbTypes = logFormat.getDBColumntypes(); - int size = dbColumns.size(); - - for (int i = 0; i < size; i++) { - query.append(dbColumns.get(i)).append(CommonConstants.SPACE); - String type = DBTableManager.TEXT; - if (dbTypes.get(i) == LogFormat.I) { - type = DBTableManager.INTEGER; - } else if (dbTypes.get(i) == LogFormat.L) { - type = DBTableManager.LONG; - } else if (dbTypes.get(i) == LogFormat.S) { - type = DBTableManager.BIG_TEXT; - } else if (dbTypes.get(i) == LogFormat.LV) { - type = DBTableManager.BIGBIG_TEXT; - } - query.append(type); - if (i + 1 == size) { - query.append(CommonConstants.CLOSE_BRACKET).append( - CommonConstants.SEMICOLON); - } else { - query.append(CommonConstants.COMMA); - } - } - - // System.out.println("dddd : " + query.toString()); - return query.toString(); - } - - private void executeCreateIndexTable(Statement stat, String tableName, - String indeColumn) { - String createIndexTable = "create index " + tableName + "_index on "//$NON-NLS-1$//$NON-NLS-2$ - + tableName + CommonConstants.OPEN_BRACKET + indeColumn - + CommonConstants.CLOSE_BRACKET; - try { - executeUpdateCreateTable(stat, createIndexTable); - } catch (SQLException e) { - e.printStackTrace(); - Logger.debug("table name : " + tableName); - } - } - public String createDropTableQuery(String target) { StringBuffer query = new StringBuffer(); query.append("drop table if exists "); //$NON-NLS-1$ TODO @@ -728,7 +639,7 @@ public class SqlManager { } public int getRangeMinSeq(int logId, long time) { - String tableName = LogDataFactory.getLogFormatById(logId).getName(); + String tableName = LogDataFactory.getLogFormatName(logId); String queryOption = " where time >= " + time; //$NON-NLS-1$ List> dbInfo = selectQuery(null, new String[] { "min(seqnumber)" }, tableName, queryOption); //$NON-NLS-1$ //$NON-NLS-2$ @@ -739,7 +650,7 @@ public class SqlManager { } public int getRangeMaxSeq(int logId, long time) { - String tableName = LogDataFactory.getLogFormatById(logId).getName(); + String tableName = LogDataFactory.getLogFormatName(logId); String queryOption = " where time <= " + time; //$NON-NLS-1$ List> dbInfo = selectQuery(null, new String[] { "max(seqnumber)" }, tableName, queryOption); //$NON-NLS-1$ //$NON-NLS-2$ @@ -749,54 +660,6 @@ public class SqlManager { return Integer.parseInt(dbInfo.get(0).get(0)); } - public List selectArea(int logId, long from, long to) { - - String tableName = LogDataFactory.getLogFormatById(logId).getName(); - StringBuffer queryOption = new StringBuffer(); - queryOption.append(" where SeqNumber >= "); //$NON-NLS-1$ - queryOption.append(from); - queryOption.append(" and SeqNumber <= "); //$NON-NLS-1$ - queryOption.append(to); - - String[] columnNames = LogDataFactory - .getLogFormatById(logId) - .getDBColumnNames() - .toArray( - new String[LogDataFactory.getLogFormatById(logId) - .getDBColumnNames().size()]); - - List dbInfo = newSelectQuery(null, columnNames, tableName, - queryOption.toString()); //$NON-NLS-1$ //$NON-NLS-2$ - - return dbInfo; - } - - public List selectArea2(int logId, long start, long end, long base, - long count) { - - String tableName = LogDataFactory.getLogFormatById(logId).getName(); - StringBuffer preOption = new StringBuffer(); - preOption - .append(" limit ").append(base).append(CommonConstants.SPACE).append(count); //$NON-NLS-1$ - - StringBuffer postOption = new StringBuffer(); - postOption.append(" where time >= ").append(start).append(" and time <= ") - .append(end); - postOption.append(" order by time asc "); //$NON-NLS-1$ - - String[] columnNames = LogDataFactory - .getLogFormatById(logId) - .getDBColumnNames() - .toArray( - new String[LogDataFactory.getLogFormatById(logId) - .getDBColumnNames().size()]); - - List dbInfo = newSelectQuery2(null, columnNames, tableName, - preOption.toString(), postOption.toString()); //$NON-NLS-1$ //$NON-NLS-2$ - - return dbInfo; - } - // public synchronized List selectTableData(int logId, int from, // int to, String option) { // String tableName = LogDataFactory.getLogFormatById(logId).getName(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/BaseCallstackManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/BaseCallstackManager.java index 307aa4a..64236c1 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/BaseCallstackManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/BaseCallstackManager.java @@ -36,7 +36,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.common.GlobalInformation; +import org.tizen.dynamicanalyzer.common.Global; import org.tizen.dynamicanalyzer.common.SymbolManager; import org.tizen.dynamicanalyzer.constant.CommonConstants; import org.tizen.dynamicanalyzer.nl.InformationViewLabels; @@ -163,11 +163,11 @@ public abstract class BaseCallstackManager { public String getUserFunctionPosition() { if (userFunctionBin == null || userFunctionBin.isEmpty()) { if (AnalyzerManager.isOsp()) { - userFunctionBin = new String(GlobalInformation.getCurrentApplication().getMainApp() + userFunctionBin = new String(Global.getCurrentApplication().getMainApp() .getInfo(AppInfo.PROPERTY.EXEC.index) + ".exe"); //$NON-NLS-1$ } else { - userFunctionBin = new String(GlobalInformation.getCurrentApplication().getMainApp() + userFunctionBin = new String(Global.getCurrentApplication().getMainApp() .getInfo(AppInfo.PROPERTY.EXEC.index)); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java index a8c4809..fa6c47f 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java @@ -62,7 +62,7 @@ import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands; import org.tizen.dynamicanalyzer.common.ElfSymbolExtractor; import org.tizen.dynamicanalyzer.common.ErrorCode; -import org.tizen.dynamicanalyzer.common.GlobalInformation; +import org.tizen.dynamicanalyzer.common.Global; import org.tizen.dynamicanalyzer.common.HostResult; import org.tizen.dynamicanalyzer.common.path.PathManager; import org.tizen.dynamicanalyzer.communicator.BaseCommunicator; @@ -217,7 +217,7 @@ public class Communicator30 extends BaseCommunicator { Thread dataThread = new Thread(null, new DataChannelThread(), AnalyzerConstants.COMMUNICATOR_RECEIVE_THREAD); // start message send - HostResult result = handleControlMessage(GlobalInformation.getCurrentDeviceInfo(), ret); + HostResult result = handleControlMessage(Global.getCurrentDeviceInfo(), ret); Logger.performance("TEST", "Start Trace", "Make and Send start message"); // FIX @@ -395,7 +395,7 @@ public class Communicator30 extends BaseCommunicator { byte[] msgBinInfo = ByteUtil.toBytes(AnalyzerConstants.MSG_BINARY_INFO); byte[] preMsg = null; - DeviceInfo curDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo curDevice = Global.getCurrentDeviceInfo(); if (AnalyzerConstants.RUNNING_PROCESS.equals(selectedPkg.getPackageId())) { Map selProcess = selectedPkg.getMainApp().getRunningProcesses(); @@ -454,7 +454,7 @@ public class Communicator30 extends BaseCommunicator { private HostResult pullTheFile(String from, String to) { try { - GlobalInformation.getCurrentDeviceInfo().getIDevice().becomeSuperUser(true); + Global.getCurrentDeviceInfo().getIDevice().becomeSuperUser(true); } catch (TimeoutException e) { e.printStackTrace(); } catch (SdbCommandRejectedException e) { @@ -500,7 +500,7 @@ public class Communicator30 extends BaseCommunicator { rt.setApplyTime(0); // set time of configuration to zero } - GlobalInformation.setCurrentConfiguration(rt); + Global.setCurrentConfiguration(rt); return result; } } @@ -523,7 +523,7 @@ public class Communicator30 extends BaseCommunicator { byte[] stop = ByteUtil.toBytes(AnalyzerConstants.MSG_STOP_SWAP); int length = 0; byte[] stopMsg = ByteUtil.getByte(stop, length); - HostResult result = handleControlMessage(GlobalInformation.getCurrentDeviceInfo(), + HostResult result = handleControlMessage(Global.getCurrentDeviceInfo(), stopMsg); if (result.isSuccess()) { @@ -761,7 +761,7 @@ public class Communicator30 extends BaseCommunicator { @Override public Socket getDataSocket() { - return GlobalInformation.getCurrentDeviceInfo().getDataSock(); + return Global.getCurrentDeviceInfo().getDataSock(); } private void processTargetInfo(byte[] payload, int index, DeviceStatusInfo tInfo) { @@ -821,7 +821,7 @@ public class Communicator30 extends BaseCommunicator { @Override public void closeSock() { - GlobalInformation.getCurrentDeviceInfo().releaseDataSock(); + Global.getCurrentDeviceInfo().releaseDataSock(); } private int getReturnId(byte[] data) { @@ -904,7 +904,7 @@ public class Communicator30 extends BaseCommunicator { public HostResult sendScreenShotRequest() { byte[] msg = ByteUtil.getByte(AnalyzerConstants.MSG_GET_SCREENSHOT, 0); HostResult result = HostResult.SUCCESS; - Socket controlSock = GlobalInformation.getCurrentDeviceInfo().getControlSock(); + Socket controlSock = Global.getCurrentDeviceInfo().getControlSock(); try { if (null != controlSock && !controlSock.isClosed()) { @@ -942,7 +942,7 @@ public class Communicator30 extends BaseCommunicator { byte[] libInst = new byte[0]; for (int a = 0; a < count; a++) { String binaryPath = settings.get(a).getBinaryPath(); - BinaryInfo binInfo = GlobalInformation.getCurrentDeviceInfo().getDeviceStatusInfo() + BinaryInfo binInfo = Global.getCurrentDeviceInfo().getDeviceStatusInfo() .getBinaryInfo(binaryPath); if (null == binInfo) { continue; @@ -992,7 +992,7 @@ public class Communicator30 extends BaseCommunicator { msg = ByteUtil.getByte(msg, length, libInst); // ByteUtils.printByteArrayForStart(msg); - HostResult result = handleControlMessage(GlobalInformation.getCurrentDeviceInfo(), msg); + HostResult result = handleControlMessage(Global.getCurrentDeviceInfo(), msg); int ackMsg = AnalyzerConstants.MSG_SWAP_INST_ADD_ACK; if (messageId == AnalyzerConstants.MSG_SWAP_INST_REMOVE) { @@ -1021,7 +1021,7 @@ public class Communicator30 extends BaseCommunicator { int length = sendbin.length; byte[] msg = ByteUtil.getByte(AnalyzerConstants.MSG_GET_PROCESS_ADD_INFO, length, sendbin); - HostResult result = handleControlMessage(GlobalInformation.getCurrentDeviceInfo(), msg); + HostResult result = handleControlMessage(Global.getCurrentDeviceInfo(), msg); if (result.isSuccess() && isCorrectAck(AnalyzerConstants.MSG_GET_PROCESS_ADD_INFO_ACK, result)) { @@ -1068,7 +1068,7 @@ public class Communicator30 extends BaseCommunicator { int length = sendBin.length; byte[] msg = ByteUtil.getByte(AnalyzerConstants.MSG_BINARY_INFO, length, sendBin); - HostResult result = handleControlMessage(GlobalInformation.getCurrentDeviceInfo(), msg); + HostResult result = handleControlMessage(Global.getCurrentDeviceInfo(), msg); if (!result.isSuccess() || !isCorrectAck(MSG_BINARY_INFO_ACK, result)) { return HostResult.ERR_BIN_INFO_GET_FAIL; @@ -1088,7 +1088,7 @@ public class Communicator30 extends BaseCommunicator { HostResult result; int index = 0; - DeviceInfo curDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo curDevice = Global.getCurrentDeviceInfo(); int count = ByteUtil.toInt(payload, index); index += INT_SIZE; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java index 96e385a..1f01d2e 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java @@ -35,7 +35,7 @@ import java.util.Map; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.common.GlobalInformation; +import org.tizen.dynamicanalyzer.common.Global; import org.tizen.dynamicanalyzer.common.SymbolManager; import org.tizen.dynamicanalyzer.communicator.CommunicatorUtils; import org.tizen.dynamicanalyzer.communicator.DACommunicator; @@ -234,9 +234,9 @@ public class SWAPLogParser implements Runnable { String remoteImgPath; if (DACommunicator.isTargetEmulator() && SocketClient.getInstance().isConnected()) { - GlobalInformation.getCurrentDeviceInfo().emulatorScreenshot + Global.getCurrentDeviceInfo().emulatorScreenshot .send(); - remoteImgPath = GlobalInformation.getCurrentDeviceInfo().emulatorScreenshot + remoteImgPath = Global.getCurrentDeviceInfo().emulatorScreenshot .getFilePath(); bECS = true; } else { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogDataFactory.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogDataFactory.java index 8db33b2..2d5d0d9 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogDataFactory.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogDataFactory.java @@ -53,23 +53,6 @@ import java.util.ArrayList; import java.util.List; import org.tizen.dynamicanalyzer.logparser.LogCenterConstants; -import org.tizen.dynamicanalyzer.swap.model.format.ContextSwitchLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.ControlLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.CustomChartLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.FileLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.GLES20LogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.LifeCycleLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.LogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.MemoryLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.NetworkLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.ProfilingLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.SceneLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.ScreenShotLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.SyncLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.SystemLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.ThreadLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.UIEventLogFormat; -import org.tizen.dynamicanalyzer.swap.model.format.UserFunctionLogFormat; import org.tizen.dynamicanalyzer.util.ByteUtil; public class LogDataFactory { @@ -287,63 +270,63 @@ public class LogDataFactory { return output; } - public static LogFormat getLogFormatById(int id) { - LogFormat format = null; + public static String getLogFormatName(int id) { + String formatName = null; switch (id) { case MSG_PROBE_MEMORY: - format = MemoryLogFormat.getInstance(); + formatName = "Memory"; break; case MSG_PROBE_UICONTROL: - format = ControlLogFormat.getInstance(); + formatName = "Control"; break; case MSG_PROBE_UIEVENT: - format = UIEventLogFormat.getInstance(); + formatName = "UIEvent"; break; case MSG_PROBE_FILE: - format = FileLogFormat.getInstance(); + formatName = "File"; break; case MSG_PROBE_NETWORK: - format = NetworkLogFormat.getInstance(); + formatName = "Network"; break; case MSG_PROBE_GLES20: - format = GLES20LogFormat.getInstance(); + formatName = "GLES20"; break; case MSG_PROBE_LIFECYCLE: - format = LifeCycleLogFormat.getInstance(); + formatName = "LifeCycle"; break; case MSG_PROBE_SCREENSHOT: - format = ScreenShotLogFormat.getInstance(); + formatName = "ScreenShot"; break; case MSG_PROBE_SCENE: - format = SceneLogFormat.getInstance(); + formatName = "Scene"; break; case MSG_PROBE_THREAD: - format = ThreadLogFormat.getInstance(); + formatName = "Thread"; break; case MSG_PROBE_CUSTOM: - format = CustomChartLogFormat.getInstance(); + formatName = "CustomChart"; break; case MSG_PROBE_SYNC: - format = SyncLogFormat.getInstance(); + formatName = "Sync"; break; case LogCenterConstants.LOG_USER_FUNCTION: // user function entry/exit - format = UserFunctionLogFormat.getInstance(); + formatName = "UserFunction"; break; case MSG_DATA_SAMPLE: case MSG_FUNCTION_ENTRY: case MSG_FUNCTION_EXIT: // profiling sample log // function enter/exit - format = ProfilingLogFormat.getInstance(); + formatName = "Profiling"; break; case MSG_CONTEXT_SWITCH_ENTRY: case MSG_CONTEXT_SWITCH_EXIT: - format = ContextSwitchLogFormat.getInstance(); + formatName = "ContextSwitch"; break; case MSG_DATA_SYSTEM: // system log - format = SystemLogFormat.getInstance(); + formatName = "System"; break; case MSG_DATA_RECORD: // format = ReplayLogFormat.getInstance(); @@ -351,7 +334,7 @@ public class LogDataFactory { default: break; } - return format; + return formatName; } public static int getLogColumnCountbyId(int id) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/CommonColumns.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/CommonColumns.java deleted file mode 100755 index 38f8fed..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/CommonColumns.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import static org.tizen.dynamicanalyzer.swap.model.format.LogFormat.I; -import static org.tizen.dynamicanalyzer.swap.model.format.LogFormat.L; -import static org.tizen.dynamicanalyzer.swap.model.format.LogFormat.T; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class CommonColumns { - - private static String[] dcn = { "APPID", "PID", "TID", "args", "Return", - "Errno", "InternalCall", "CallerPCAddr", "Reserved1", "Reserved2", "LibName" }; - private static Integer[] dct = { I, I, I, T, T, L, I, L, I, I , T}; - private static String[] tcn = { "App ID", "PID", "TID", "Args", "Return", - "Errno", "Internal Call", "Caller PCAddr", "Reserved1", "Reserved2", "LibName" }; - private static Integer[] logTypes = { I, I, I, T, T, L, I, L, I, I, T }; - - private static List dbColumnNames = null; - private static List dbColumnTypes = null; - private static List tableColumnNames = null; - private static List types = null; - - public static List getDBColumnNames() { - if (null == dbColumnNames) { - dbColumnNames = new ArrayList(); - dbColumnNames.addAll(HeaderColumns.getDBColumnNames()); - dbColumnNames.addAll(Arrays.asList(dcn)); - } - ArrayList ret = new ArrayList(); - ret.addAll(dbColumnNames); - - return ret; - } - - public static List getDBColumntypes() { - if (null == dbColumnTypes) { - dbColumnTypes = new ArrayList(); - dbColumnTypes.addAll(HeaderColumns.getDBColumntypes()); - dbColumnTypes.addAll(Arrays.asList(dct)); - } - - ArrayList ret = new ArrayList(); - ret.addAll(dbColumnTypes); - return ret; - } - - public static List getTableColumnNames() { - if (null == tableColumnNames) { - tableColumnNames = new ArrayList(); - tableColumnNames.addAll(HeaderColumns.getTableColumnNames()); - tableColumnNames.addAll(Arrays.asList(tcn)); - } - ArrayList ret = new ArrayList(); - ret.addAll(tableColumnNames); - return ret; - } - - public static List getLogColumnTypes() { - if (null == types) { - types = new ArrayList(); - types.addAll(HeaderColumns.getLogColumnTypes()); - types.addAll(Arrays.asList(logTypes)); - } - - ArrayList ret = new ArrayList(); - ret.addAll(types); - return ret; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ContextSwitchLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ContextSwitchLogFormat.java deleted file mode 100644 index 04840a1..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ContextSwitchLogFormat.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class ContextSwitchLogFormat extends LogFormat { - public static final String NAME = "ContextSwitch"; - - private static ContextSwitchLogFormat instance = null; - - public static ContextSwitchLogFormat getInstance() { - if (null == instance) { - instance = new ContextSwitchLogFormat(); - } - return instance; - } - - private ContextSwitchLogFormat() { - setName(NAME); - - String[] dcn = { "PCAddr", "Pid", "Tid", "CpuNum" }; - dbColumnNames = HeaderColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { L, I, I, I }; - dbColumnTypes = HeaderColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "PCAddr", "Pid", "Tid", "CpuNum" }; - tableColumnNames = HeaderColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { L, I, I, I }; - logColumnTypes = HeaderColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ControlLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ControlLogFormat.java deleted file mode 100755 index 9f07c33..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ControlLogFormat.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Heeyoung Hwang - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class ControlLogFormat extends LogFormat { - public static final String NAME = "Control"; - - private static ControlLogFormat instance = null; - - public static ControlLogFormat getInstance() { - if (null == instance) { - instance = new ControlLogFormat(); - } - return instance; - } - - private ControlLogFormat() { - setName(NAME); - String[] dcn = { "ParentName", "ParentClass", "ParentPointer", - "ChildName", "ChildClass", "ChildPointer" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { T, T, L, T, T, L }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "Parent Name", "Parent Class", "Parent Pointer", - "Child Name", "Child Class", "Child Pointer" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { S, S, L, S, S, L }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } - -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/CustomChartLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/CustomChartLogFormat.java deleted file mode 100755 index e7211ba..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/CustomChartLogFormat.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class CustomChartLogFormat extends LogFormat { - public static final int ID = 0x3009; - public static final String NAME = "CustomChart"; - - private static CustomChartLogFormat instance = null; - - public static CustomChartLogFormat getInstance() { - if (null == instance) { - instance = new CustomChartLogFormat(); - } - return instance; - } - - private CustomChartLogFormat() { - setName(NAME); - - String[] dcn = { "Handle", "Type", "Name", "Color", "Value" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { I, I, T, I, T }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "Handle", "Type", "Name", "Color", "Value" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { I, I, S, I, D }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/FileLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/FileLogFormat.java deleted file mode 100755 index 9a2eadc..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/FileLogFormat.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class FileLogFormat extends LogFormat { - public static final String NAME = "File"; - - private static FileLogFormat instance = null; - - public static FileLogFormat getInstance() { - if (null == instance) { - instance = new FileLogFormat(); - } - return instance; - } - - private FileLogFormat() { - setName(NAME); - - String[] dcn = { "Size", "FDValue", "FDApiType", "FileSize", - "FilePath" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { L, L, I, L, T }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "Size", "FD Value", "FD Api Type", - "File Size", "FilePath" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { L, L, I, L, S }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/GLES20LogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/GLES20LogFormat.java deleted file mode 100644 index ac03ed6..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/GLES20LogFormat.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.tizen.dynamicanalyzer.swap.model.format; - -import java.util.Arrays; - -public class GLES20LogFormat extends LogFormat { - public static final String NAME = "GLES20"; - - private static volatile GLES20LogFormat instance = null; - - public static GLES20LogFormat getInstance() { - if(instance == null) { - synchronized (GLES20LogFormat.class) { - if(instance == null) { - instance = new GLES20LogFormat(); - } - - } - } - - return instance; - } - - private GLES20LogFormat() { - setName(NAME); - - String[] dcn = {"GLApiType", "GLElapsedTime", "GLContextValue"}; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = {I, L, S}; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = {"Api Type", "Elapsed Time", "Context Value"}; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { I, L, S }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/HeaderColumns.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/HeaderColumns.java deleted file mode 100644 index 6d9d1e6..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/HeaderColumns.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import static org.tizen.dynamicanalyzer.swap.model.format.LogFormat.I; -import static org.tizen.dynamicanalyzer.swap.model.format.LogFormat.L; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class HeaderColumns { - private static String[] dcn = { "RID", "MessageId", "SeqNumber", "Time" }; - private static Integer[] dct = { I, I, I, L }; - private static String[] tcn = { "Row Id", "Message ID", "Sequence", "Time" }; - private static Integer[] logTypes = { I, I, I, L }; - - private static List dbColumnNames = null; - private static List dbColumnTypes = null; - private static List tableColumnNames = null; - private static List types = null; - - public static List getDBColumnNames() { - if (null == dbColumnNames) { - dbColumnNames = new ArrayList(); - dbColumnNames = Arrays.asList(dcn); - } - - ArrayList ret = new ArrayList(); - ret.addAll(dbColumnNames); - - return ret; - } - - public static List getDBColumntypes() { - if (null == dbColumnTypes) { - dbColumnTypes = Arrays.asList(dct); - } - - ArrayList ret = new ArrayList(); - ret.addAll(dbColumnTypes); - return ret; - } - - public static List getTableColumnNames() { - if (null == tableColumnNames) { - tableColumnNames = new ArrayList(); - tableColumnNames = Arrays.asList(tcn); - } - ArrayList ret = new ArrayList(); - ret.addAll(tableColumnNames); - return ret; - } - - public static List getLogColumnTypes() { - if (null == types) { - types = Arrays.asList(logTypes); - } - - ArrayList ret = new ArrayList(); - ret.addAll(types); - return ret; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LifeCycleLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LifeCycleLogFormat.java deleted file mode 100755 index 27e828f..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LifeCycleLogFormat.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - - -public class LifeCycleLogFormat extends LogFormat { - public static final String NAME = "LifeCycle"; - - private static LifeCycleLogFormat instance = null; - - public static LifeCycleLogFormat getInstance() { - if (null == instance) { - instance = new LifeCycleLogFormat(); - } - return instance; - } - - private LifeCycleLogFormat() { - setName(NAME); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LogFormat.java deleted file mode 100755 index c484831..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LogFormat.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.ArrayList; -import java.util.List; - -public class LogFormat { - public static final int I = 1; // Integer - public static final int S = 2; // String - public static final int L = 3; // Long - public static final int D = 4; // Double - public static final int T = 5; // TEXT - public static final int F = 6; // Float - public static final int SI = 7; // Short int - public static final int LV = 13; // Long varchar - - // for system logs - public static final int CL = 8; // CPU load - public static final int CF = 9; // CPU frequency - public static final int TL = 10; // Thread load - public static final int PL = 11; // Process load - public static final int A = 12; // Entry args - - protected List dbColumnNames = null; - protected List dbColumnTypes = null; - protected List tableColumnNames = null; - protected List logColumnTypes = null; - - public static List logFormats = null; - - protected int id = -1; - protected String name = null; - - public int getId() { - return id; - } - - public String getName() { - return name; - } - - protected void setName(String name) { - this.name = name; - } - - public List getDBColumnNames() { - if (null == dbColumnNames) { - return CommonColumns.getDBColumnNames(); - } - return dbColumnNames; - } - - public List getDBColumntypes() { - if (null == dbColumnTypes) { - return CommonColumns.getDBColumntypes(); - } - return dbColumnTypes; - } - - public List getTableColumnNames() { - if (null == tableColumnNames) { - return CommonColumns.getTableColumnNames(); - } - return tableColumnNames; - } - - public List getLogColumnTypes() { - if (null == logColumnTypes) { - return CommonColumns.getLogColumnTypes(); - } - return logColumnTypes; - } - - public int getDBTotalColumnCount() { - return getDBColumnNames().size(); - } - - public static List getLogFormats() { - if (null == logFormats) { - logFormats = new ArrayList(); - - logFormats.add(ContextSwitchLogFormat.getInstance()); - logFormats.add(ControlLogFormat.getInstance()); - logFormats.add(CustomChartLogFormat.getInstance()); - logFormats.add(FileLogFormat.getInstance()); - // logFormats.add(NetworkLogFormat.getInstance()); - logFormats.add(LifeCycleLogFormat.getInstance()); - logFormats.add(MemoryLogFormat.getInstance()); - // logFormats.add(ReplayLogFormat.getInstance()); - logFormats.add(SceneLogFormat.getInstance()); - logFormats.add(ScreenShotLogFormat.getInstance()); - logFormats.add(SyncLogFormat.getInstance()); - logFormats.add(SystemLogFormat.getInstance()); - logFormats.add(ThreadLogFormat.getInstance()); - logFormats.add(UIEventLogFormat.getInstance()); - // logFormats.add(GLES20LogFormat.getInstance()); - - } - return logFormats; - } - - public static LogFormat getLogFormatById(int id) { - int size = getLogFormats().size(); - - for (int i = 0; i < size; i++) { - if (logFormats.get(i).getId() == id) { - return logFormats.get(i); - } - } - return null; - } - -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/MemoryLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/MemoryLogFormat.java deleted file mode 100755 index 6657407..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/MemoryLogFormat.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class MemoryLogFormat extends LogFormat { - public static final String NAME = "Memory"; - - private static MemoryLogFormat instance = null; - - public static MemoryLogFormat getInstance() { - if (null == instance) { - instance = new MemoryLogFormat(); - } - return instance; - } - - private MemoryLogFormat() { - setName(NAME); - - String[] dcn = { "Size", "MemoryAPIType", "Address" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - for (String str : dcn) { - dbColumnNames.add(str); - } - // dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { L, I, L }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "Size", "Memory API Type", "Address" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - for (String str : tcn) { - tableColumnNames.add(str); - } - // tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { L, I, L }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/NetworkLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/NetworkLogFormat.java deleted file mode 100644 index 61c0ef7..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/NetworkLogFormat.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class NetworkLogFormat extends LogFormat { - public static final String NAME = "Network"; - - private static NetworkLogFormat instance = null; - - public static NetworkLogFormat getInstance() { - if (null == instance) { - instance = new NetworkLogFormat(); - } - return instance; - } - - private NetworkLogFormat() { - setName(NAME); - - String[] dcn = { "ObjetAddress", "FDValue", "FDApiType", - "DestinationIPAddress", "DestinationPortAddress", - "MessageSize", "Message" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { L, L, I, I, I, I, S }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "ObjetAddress", "FDValue", "FDApiType", - "DestinationIPAddress", "DestinationPortAddress", - "MessageSize", "Message" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { L, L, I, I, I, I, S }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ProfilingLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ProfilingLogFormat.java deleted file mode 100644 index 5311fe8..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ProfilingLogFormat.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class ProfilingLogFormat extends LogFormat { - public static final String NAME = "Profiling"; - - private static ProfilingLogFormat instance = null; - - public static ProfilingLogFormat getInstance() { - if (null == instance) { - instance = new ProfilingLogFormat(); - } - return instance; - } - - private ProfilingLogFormat() { - setName(NAME); - - String[] dcn = { "PCAddr", "CallerPcAddr", "ProbeType", "ProbeSubType", - "Pid", "Tid", "CpuNum", "Args", "Ret", "ApiName", "LibName", "CallStack" }; - dbColumnNames = HeaderColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { L, L, I, I, I, I, I, T, T, T, T, T }; - dbColumnTypes = HeaderColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "PCAddr", "CallerPcAddr", "ProbeType", "ProbeSubType", - "Pid", "Tid", "CpuNum", "Args", "Ret", "ApiName", "LibName", "CallStack" }; - tableColumnNames = HeaderColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { L, L, I, I, I, I, I, S, S, S, S, S }; - logColumnTypes = HeaderColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ReplayLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ReplayLogFormat.java deleted file mode 100644 index 9d0217b..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ReplayLogFormat.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.ArrayList; -import java.util.Arrays; - -public class ReplayLogFormat extends LogFormat { - public static final String NAME = "Replay"; - - private static ReplayLogFormat instance = null; - - public static ReplayLogFormat getInstance() { - if (null == instance) { - instance = new ReplayLogFormat(); - } - return instance; - } - - private ReplayLogFormat() { - setName(NAME); - String[] dcn = { "Rid", "MessageId", "SeqNumber", "Time", "Sec", "Nano", "EventId", - "EventType", "EventCode", "EventValue" }; - dbColumnNames = new ArrayList(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { I, I, L, L, I, I, I, I, I, I }; - dbColumnTypes = new ArrayList(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "Rid", "MessageId", "SeqNumber", "Time", "Sec", "Nano", "EventId", - "EventType", "EventCode", "EventValue" }; - tableColumnNames = new ArrayList(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { I, I, L, L, I, I, I, I, I, I }; - logColumnTypes = new ArrayList(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SceneLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SceneLogFormat.java deleted file mode 100755 index 36b0438..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SceneLogFormat.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Heeyoung Hwang - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class SceneLogFormat extends LogFormat { - public static final String NAME = "Scene"; - - private static SceneLogFormat instance = null; - - public static SceneLogFormat getInstance() { - if (null == instance) { - instance = new SceneLogFormat(); - } - return instance; - } - - private SceneLogFormat() { - setName(NAME); - - String[] dcn = { "SceneName", "FormName", "FormPointer", "PanelName", - "PanelPointer", "TransitionTime", "UserTransitionTime" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { T, T, L, T, L, I, I }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "Scene Name", "Form Name", "Form Pointer", - "Panel Name", "Panel Pointer", "Transition Time", - "User Transition Time" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { S, S, L, S, L, I, I }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ScreenShotLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ScreenShotLogFormat.java deleted file mode 100755 index c0329d4..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ScreenShotLogFormat.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class ScreenShotLogFormat extends LogFormat { - public static final String NAME = "ScreenShot"; - - private static ScreenShotLogFormat instance = null; - - public static ScreenShotLogFormat getInstance() { - if (null == instance) { - instance = new ScreenShotLogFormat(); - } - return instance; - } - - private ScreenShotLogFormat() { - setName(NAME); - - String[] dcn = { "ImageFilePath", "Orientation" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { T, I }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "Image File Path", "Orientation" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { S, I }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SyncLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SyncLogFormat.java deleted file mode 100755 index 8de8f53..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SyncLogFormat.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class SyncLogFormat extends LogFormat { - public static final String NAME = "Sync"; - - private static SyncLogFormat instance = null; - - public static SyncLogFormat getInstance() { - if (null == instance) { - instance = new SyncLogFormat(); - } - return instance; - } - - private SyncLogFormat() { - setName(NAME); - - String[] dcn = { "SyncValue", "SyncType", "ApiType" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { L, I, I }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "Sync Value", "Sync Type", "Api Type" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { L, I, I }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SystemLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SystemLogFormat.java deleted file mode 100644 index 2161578..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SystemLogFormat.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class SystemLogFormat extends LogFormat { - public static final String NAME = "System"; - - private static SystemLogFormat instance = null; - - public static SystemLogFormat getInstance() { - if (null == instance) { - instance = new SystemLogFormat(); - } - return instance; - } - - private SystemLogFormat() { - setName(NAME); - String[] dcn = { "AppCpuUsage", "CpuFrequency", "CpuLoad","ThreadCount", "ThreadLoad", - "ProcessCount", "ProcessLoad","VirtualMemory", "ResidentMemory", "SharedMemory", - "PssMemory","TotalAllocSize", "SystemMemoryTotal", "SystemMemoryUsed","TotalUsedDrive", - "DiskReads", "DiskSectorsRead", "DiskWrites","DiskSectorsWritten", "NetworkSendSize", - "NetworkReceiveSize","WiFi", "BlueTooth", "GPS", "Brightness", - "Camera", "Sound","Audio", "Vibration", "Voltage", - "Rssi", "Video", "CallValue","Dnet", "Energy", - "EnergyPerDevice", "AppEnergyPerDevice"}; - dbColumnNames = new ArrayList(); - dbColumnNames.addAll(HeaderColumns.getDBColumnNames()); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { T, T, T,I, T, - I, LV, - I, I, I, I,I, L, L, - I, I,I, I, I, - I, I, - I, I, I, I, I, - I, I, I, I, I, - I, I, I, - I, T, T}; - dbColumnTypes = new ArrayList(); - dbColumnTypes.addAll(HeaderColumns.getDBColumntypes()); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "App Cpu Usage", "Cpu Frequency", "Cpu Load", - "Thread Count", "Thread Load", "Process Count", "Process Load", - "Virtual Memory", "Resident Memory", "Shared Memory", "Pss Memory", - "Total Alloc Size", "System Memory Total", "System Memory Used", - "Total Used Drive", "Disk Reads", "Disk Sectors Read", "Disk Writes", - "Disk Sectors Written", "Network Send Size,", "Network Receive Size", - "WiFi", "BlueTooth", "GPS", "Brightness", "Camera", "Sound", - "Audio", "Vibration", "Voltage", "Rssi", "Video", "Call", - "Dnet", "Energy", "Energy Usage Per Devices", "Application Energy Usage" }; - tableColumnNames = new ArrayList(); - tableColumnNames.addAll(HeaderColumns.getTableColumnNames()); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = {F, S, S,I, S, - I, S, - I, I, I, I,I, L, L, - I, I,I, I, I, - I, I, - I, I, I, I, I, - I, I, I, I, I, - I, I, I, - I, S, S}; - logColumnTypes = new ArrayList(); - logColumnTypes.addAll(HeaderColumns.getLogColumnTypes()); - logColumnTypes.addAll(Arrays.asList(types)); - } - - public List getDBColumnNames() { - return dbColumnNames; - } - - public List getDBColumntypes() { - return dbColumnTypes; - } - - public List getTableColumnNames() { - return tableColumnNames; - } - - public List getLogColumnTypes() { - return logColumnTypes; - } - - public int getDBTotalColumnCount() { - return getDBColumnNames().size(); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ThreadLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ThreadLogFormat.java deleted file mode 100755 index 22ce777..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/ThreadLogFormat.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class ThreadLogFormat extends LogFormat { - public static final String NAME = "Thread"; - - private static ThreadLogFormat instance = null; - - public static ThreadLogFormat getInstance() { - if (null == instance) { - instance = new ThreadLogFormat(); - } - return instance; - } - - private ThreadLogFormat() { - setName(NAME); - - String[] dcn = { "PThreadID", "OspThreadID", "ThreadType", "ApiType" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { L, L, I, I }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "PThread ID", "Osp Thread ID", "Thread Type", - "Api Type" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { L, L, I, I }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/UIEventLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/UIEventLogFormat.java deleted file mode 100755 index fcd9498..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/UIEventLogFormat.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class UIEventLogFormat extends LogFormat { - public static final String NAME = "UIEvent"; - - private static UIEventLogFormat instance = null; - - public static UIEventLogFormat getInstance() { - if (null == instance) { - instance = new UIEventLogFormat(); - } - return instance; - } - - private UIEventLogFormat() { - setName(NAME); - - String[] dcn = { "EventType", "DetailType", "X", "Y", "Info1", "Info2" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { I, I, I, I, T, T }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "Event Type", "Detail Type", "X", "Y", "Info1", - "Info2" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { I, I, I, I, S, S }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/UserFunctionLogFormat.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/UserFunctionLogFormat.java deleted file mode 100644 index ec86b71..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/UserFunctionLogFormat.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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.model.format; - -import java.util.Arrays; - -public class UserFunctionLogFormat extends LogFormat { - public static final String NAME = "UserFunction"; - - private static UserFunctionLogFormat instance = null; - - public static UserFunctionLogFormat getInstance() { - if (null == instance) { - instance = new UserFunctionLogFormat(); - } - return instance; - } - - private UserFunctionLogFormat() { - setName(NAME); - - String[] dcn = { "LowPC", "HighPC", "Type", "ElapsedTime", "PCAddr" }; - dbColumnNames = CommonColumns.getDBColumnNames(); - dbColumnNames.addAll(Arrays.asList(dcn)); - - Integer[] dct = { L, L, I, L, L }; - dbColumnTypes = CommonColumns.getDBColumntypes(); - dbColumnTypes.addAll(Arrays.asList(dct)); - - String[] tcn = { "LogPC", "HighPC", "Type", "ElapsedTime", "PCAddr" }; - tableColumnNames = CommonColumns.getTableColumnNames(); - tableColumnNames.addAll(Arrays.asList(tcn)); - - Integer[] types = { L, L, I, L, L }; - logColumnTypes = CommonColumns.getLogColumnTypes(); - logColumnTypes.addAll(Arrays.asList(types)); - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DAFileTreeExplorer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DAFileTreeExplorer.java index 126a3e6..639c73c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DAFileTreeExplorer.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DAFileTreeExplorer.java @@ -36,7 +36,7 @@ import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; -import org.tizen.dynamicanalyzer.common.GlobalInformation; +import org.tizen.dynamicanalyzer.common.Global; import org.tizen.dynamicanalyzer.model.DeviceInfo; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.resources.FontResources; @@ -115,11 +115,11 @@ public class DAFileTreeExplorer extends Composite { } public void makeTree() { - DeviceInfo selectedDevice = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo selectedDevice = Global.getCurrentDeviceInfo(); if (null == selectedDevice) { return; } - IDevice device = GlobalInformation.getCurrentDeviceInfo().getIDevice(); + IDevice device = Global.getCurrentDeviceInfo().getIDevice(); FileEntry root = device.getRoot(); GridItem item = new GridItem(table, SWT.NONE); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DeviceExplorer/DeviceExplorerDilaog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DeviceExplorer/DeviceExplorerDilaog.java index f9829c9..ea5aaad 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DeviceExplorer/DeviceExplorerDilaog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DeviceExplorer/DeviceExplorerDilaog.java @@ -44,7 +44,7 @@ import org.eclipse.swt.layout.FormLayout; 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.common.Global; import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.nl.WidgetLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; @@ -74,8 +74,8 @@ public class DeviceExplorerDilaog extends DAMessageBox { data.height = 476; data.width = 434; explorer.setLayoutData(data); - explorer.setDevice(GlobalInformation.getCurrentDeviceInfo().getIDevice()); - explorer.setRoot(GlobalInformation.getCurrentDeviceInfo().getIDevice() + explorer.setDevice(Global.getCurrentDeviceInfo().getIDevice()); + explorer.setRoot(Global.getCurrentDeviceInfo().getIDevice() .getRoot().getFullPath()); // explorer.updateData(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java index 3a68d17..b68e006 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java @@ -35,7 +35,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.part.ViewPart; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; -import org.tizen.dynamicanalyzer.constant.CommonConstants; import org.tizen.dynamicanalyzer.nl.ConfigureLabels; import org.tizen.dynamicanalyzer.ui.file.FilePage; import org.tizen.dynamicanalyzer.ui.kernel.KernelPage; @@ -87,90 +86,86 @@ public class BaseView extends ViewPart { public void createTabViewPage() { ConfigureManager configureManager = ConfigureManager.getInstance(); List tabViewList = new ArrayList(); - tabViewList.add(CommonConstants.PAGE_TIME_LINE); // default : timeline tab + tabViewList.add(AnalyzerConstants.PAGE_TIME_LINE); // default : timeline + // tab // thread tab - if (AnalyzerConstants.FEATURE_OFF != - configureManager.getValueLong(ConfigureLabels.FEATURE_THREAD)) { - tabViewList.add(CommonConstants.PAGE_THREAD); + if (AnalyzerConstants.FEATURE_OFF != configureManager + .getValueLong(ConfigureLabels.FEATURE_THREAD)) { + tabViewList.add(AnalyzerConstants.PAGE_THREAD); } // else nothing // network tab - if (AnalyzerConstants.FEATURE_OFF != - configureManager.getValueLong(ConfigureLabels.FEATURE_NETWORK)) { - tabViewList.add(CommonConstants.PAGE_NETWORK); + if (AnalyzerConstants.FEATURE_OFF != configureManager + .getValueLong(ConfigureLabels.FEATURE_NETWORK)) { + tabViewList.add(AnalyzerConstants.PAGE_NETWORK); } // else nothing // openGL tab - if (AnalyzerConstants.FEATURE_OFF != - configureManager.getValueLong(ConfigureLabels.FEATURE_OPENGL)) { - tabViewList.add(CommonConstants.PAGE_GRAPHICS); + if (AnalyzerConstants.FEATURE_OFF != configureManager + .getValueLong(ConfigureLabels.FEATURE_OPENGL)) { + tabViewList.add(AnalyzerConstants.PAGE_GRAPHICS); } // else nothing // kernel tab - if (AnalyzerConstants.FEATURE_OFF != - configureManager.getValueLong(ConfigureLabels.FEATURE_CONTEXT_SWITCH)) { - tabViewList.add(CommonConstants.PAGE_KERNEL); + if (AnalyzerConstants.FEATURE_OFF != configureManager + .getValueLong(ConfigureLabels.FEATURE_CONTEXT_SWITCH)) { + tabViewList.add(AnalyzerConstants.PAGE_KERNEL); } // else nothing - + // file tab if (AnalyzerConstants.FEATURE_OFF != configureManager .getValueLong(ConfigureLabels.FEATURE_FILE)) { - tabViewList.add(CommonConstants.PAGE_FILE); + tabViewList.add(AnalyzerConstants.PAGE_FILE); } // else nothing - tabViewList.add(CommonConstants.PAGE_SUMMARY); // default : summary tab - addTabViewPage(tabViewList); + tabViewList.add(AnalyzerConstants.PAGE_SUMMARY); // default : summary + // tab + addTabViewPage(tabViewList); } - + /** * add tab pages dynamically - * @param tabViewList : selected tab pages for adding + * + * @param tabViewList + * : selected tab pages for adding */ public void addTabViewPage(List tabViewList) { DABaseComposite newPage = null; - if(tabViewList != null && tabViewList.size() > 0) { + if (tabViewList != null && tabViewList.size() > 0) { tabView.removeAll(); // remove existing pages - for(int id : tabViewList) { - switch(id){ - case CommonConstants.PAGE_FILE: - newPage = new FilePage( - tabView.getContentComposite(), SWT.NONE); + for (int id : tabViewList) { + switch (id) { + case AnalyzerConstants.PAGE_FILE: + newPage = new FilePage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_GRAPHICS: - newPage = new GLPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_GRAPHICS: + newPage = new GLPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_KERNEL: - newPage = new KernelPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_KERNEL: + newPage = new KernelPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_NETWORK: - newPage = new NetworkPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_NETWORK: + newPage = new NetworkPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_SUMMARY: - newPage = new SummaryPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_SUMMARY: + newPage = new SummaryPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_THREAD: - newPage = new ThreadPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_THREAD: + newPage = new ThreadPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_TIME_LINE: - newPage = new TimelinePage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_TIME_LINE: + newPage = new TimelinePage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_UI: - newPage = new UIPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_UI: + newPage = new UIPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; default: @@ -182,53 +177,48 @@ public class BaseView extends ViewPart { Logger.error("View Page List is Null"); } } - + /** * add a tab page dynamically - * @param tabViewType, tabViewId + * + * @param tabViewType + * , tabViewId */ public void addTabViewPage(int tabViewType, String tabViewId) { DABaseComposite newPage = null; - if(!tabView.isExistingPage(tabViewId)) { //if the page does not exist, add the page + if (!tabView.isExistingPage(tabViewId)) { // if the page does not exist, + // add the page switch (tabViewType) { - case CommonConstants.PAGE_FILE: - newPage = new FilePage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_FILE: + newPage = new FilePage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_GRAPHICS: - newPage = new GLPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_GRAPHICS: + newPage = new GLPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_KERNEL: - newPage = new KernelPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_KERNEL: + newPage = new KernelPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_NETWORK: - newPage = new NetworkPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_NETWORK: + newPage = new NetworkPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_SUMMARY: - newPage = new SummaryPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_SUMMARY: + newPage = new SummaryPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_THREAD: - newPage = new ThreadPage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_THREAD: + newPage = new ThreadPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_TIME_LINE: - newPage = new TimelinePage( - tabView.getContentComposite(), SWT.NONE); + case AnalyzerConstants.PAGE_TIME_LINE: + newPage = new TimelinePage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; - case CommonConstants.PAGE_UI: - newPage = new UIPage(tabView.getContentComposite(), - SWT.NONE); + case AnalyzerConstants.PAGE_UI: + newPage = new UIPage(tabView.getContentComposite(), SWT.NONE); tabView.addView(newPage, false); break; default: @@ -239,19 +229,21 @@ public class BaseView extends ViewPart { Logger.info("Add failed : " + tabViewId + " already exists"); } } - + /** * remove a tab page dynamically + * * @param tabViewId */ public void removeTabViewPage(String tabViewId) { - if (tabView.isExistingPage(tabViewId)) { // If the page exist, remove the page + if (tabView.isExistingPage(tabViewId)) { // If the page exist, remove + // the page tabView.removeView(tabViewId, false); } else { Logger.debug("Remove failed : " + tabViewId + " does not exist"); } } - + public DAPageComposite getTopComposite() { Display.getDefault().syncExec(new Runnable() { @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/range/RangeDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/range/RangeDataManager.java index 5f3ffc9..167f92a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/range/RangeDataManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/range/RangeDataManager.java @@ -38,17 +38,12 @@ import java.util.PriorityQueue; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; -import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.database.SqlConnectionManager; -import org.tizen.dynamicanalyzer.sql.SqlManager; import org.tizen.dynamicanalyzer.swap.callstack.BaseCallstackManager; import org.tizen.dynamicanalyzer.swap.callstack.SWAPCallStackManager; import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants; -import org.tizen.dynamicanalyzer.swap.logparser.LogPackage; -import org.tizen.dynamicanalyzer.swap.logparser.Logs; -import org.tizen.dynamicanalyzer.swap.model.data.LogData; import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory; import org.tizen.dynamicanalyzer.swap.model.data.ProfileData; import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager; @@ -82,7 +77,7 @@ public class RangeDataManager implements Runnable { private long analysisEndTime = 0; private boolean isBeingAnalyzed = false; - + private enum Function { SEQ(1), // ResultSet column index starts from 1 PID(2), @@ -92,22 +87,19 @@ public class RangeDataManager implements Runnable { TIME(6), CALLERPCADDR(7), PCADDR(8); - + public final int index; - + Function(int index) { this.index = index; } } - + private enum Sample { - TIME(1), - PID(2), - TID(3), - PCADDR(4); - + TIME(1), PID(2), TID(3), PCADDR(4); + public final int index; - + Sample(int index) { this.index = index; } @@ -158,8 +150,7 @@ public class RangeDataManager implements Runnable { public void startRangeThread() { clearRange(); if (null == rangeThread || !rangeThread.isAlive()) { - rangeThread = new Thread(null, getInstance(), - "Range data manager thread"); //$NON-NLS-1$ + rangeThread = new Thread(null, getInstance(), "Range data manager thread"); //$NON-NLS-1$ rangeThread.start(); analysisStartTime = markerStartTime; @@ -171,8 +162,7 @@ public class RangeDataManager implements Runnable { public void startRangeAnalysis() { if (!isBeingAnalyzed) { DATabComposite mainTab = AnalyzerUtil.getMainTab(); - DABaseComposite rangePage = new RangePage( - mainTab.getContentComposite(), SWT.NONE); + DABaseComposite rangePage = new RangePage(mainTab.getContentComposite(), SWT.NONE); DATabButton rangeTab = mainTab.addView(null, rangePage, true, true); rangeTab.addCloseButtonListener(new DACustomButtonClickEventListener() { @Override @@ -268,8 +258,7 @@ public class RangeDataManager implements Runnable { } public boolean isAnalyzable() { - if (markerStartTime >= 0 - && markerEndTime >= 0 + if (markerStartTime >= 0 && markerEndTime >= 0 && (markerStartTime != analysisStartTime || markerEndTime != analysisEndTime)) { return true; } else { @@ -288,13 +277,10 @@ public class RangeDataManager implements Runnable { @Override public void run() { List logIds = LogDataFactory.getLogList(); - List input = null; // LogPackage logPackage = new LogPackage(); int size = logIds.size(); - int from = 0; boolean profileSkip = false; - boolean contextSkip = false; - //TODO: divide this method into sub-methods + // TODO: divide this method into sub-methods for (int i = 0; i < size; i++) { // case 1 : profile data // log id = profiling data @@ -307,75 +293,79 @@ public class RangeDataManager implements Runnable { ResultSet rsSample = null; PriorityQueue pQueue = new PriorityQueue(3, new Comparator() { - public int compare(ProfileData pData1, ProfileData pData2) { - long time1 = pData1.getTime(); - long time2 = pData2.getTime(); - if (time1 < time2) { - return -1; - } else if (time1 > time2) { - return 1; - } else { - return 0; - } - } - }); - + public int compare(ProfileData pData1, ProfileData pData2) { + long time1 = pData1.getTime(); + long time2 = pData2.getTime(); + if (time1 < time2) { + return -1; + } else if (time1 > time2) { + return 1; + } else { + return 0; + } + } + }); + try { String query = String.format(FunctionEntryDBTable.SELECT_QUERY, markerStartTime, markerEndTime); rsEntry = SqlConnectionManager.executeQueryRS(query); - - query = String.format(FunctionExitDBTable.SELECT_QUERY, - markerStartTime, markerEndTime); + + query = String.format(FunctionExitDBTable.SELECT_QUERY, markerStartTime, + markerEndTime); rsExit = SqlConnectionManager.executeQueryRS(query); - - query = String.format(FunctionSampleDBTable.SELECT_QUERY, - markerStartTime, markerEndTime); + + query = String.format(FunctionSampleDBTable.SELECT_QUERY, markerStartTime, + markerEndTime); rsSample = SqlConnectionManager.executeQueryRS(query); - + if (rsEntry == null || rsExit == null || rsSample == null) { Logger.error("failed to query function profiling data in range"); continue; } if (rsEntry.next()) { - ProfileData pEntry = - makeFunctionProfileData(DataChannelConstants.MSG_FUNCTION_ENTRY, rsEntry); + ProfileData pEntry = makeFunctionProfileData( + DataChannelConstants.MSG_FUNCTION_ENTRY, rsEntry); pQueue.offer(pEntry); } if (rsExit.next()) { - ProfileData pExit = - makeFunctionProfileData(DataChannelConstants.MSG_FUNCTION_EXIT, rsExit); - pQueue.offer(pExit); - } + ProfileData pExit = makeFunctionProfileData( + DataChannelConstants.MSG_FUNCTION_EXIT, rsExit); + pQueue.offer(pExit); + } if (rsSample.next()) { ProfileData pSample = makeSampleProfileData(rsSample); pQueue.offer(pSample); } - // handle entry/exit/sample data one by one in chronological order + // handle entry/exit/sample data one by one in + // chronological order while (true) { ProfileData top = pQueue.poll(); if (top == null) { break; } - ProfileDataMaker profileDataMaker = getProfileDataMakerByPid(top.getPid()); - - switch(top.getId()) { + ProfileDataMaker profileDataMaker = getProfileDataMakerByPid(top + .getPid()); + + switch (top.getId()) { case DataChannelConstants.MSG_FUNCTION_ENTRY: if (rsEntry.next()) { - ProfileData pEntry = - makeFunctionProfileData(DataChannelConstants.MSG_FUNCTION_ENTRY, rsEntry); + ProfileData pEntry = makeFunctionProfileData( + DataChannelConstants.MSG_FUNCTION_ENTRY, rsEntry); pQueue.offer(pEntry); } - swapCallstackManager.makeUserCallstackforRange(top, profileDataMaker); + swapCallstackManager.makeUserCallstackforRange(top, + profileDataMaker); break; case DataChannelConstants.MSG_FUNCTION_EXIT: if (rsExit.next()) { - ProfileData pExit = - makeFunctionProfileData(DataChannelConstants.MSG_FUNCTION_EXIT, rsExit); - pQueue.offer(pExit); + ProfileData pExit = makeFunctionProfileData( + DataChannelConstants.MSG_FUNCTION_EXIT, rsExit); + pQueue.offer(pExit); } - swapCallstackManager.makeUserCallstackforRange(top, profileDataMaker); + swapCallstackManager.makeUserCallstackforRange(top, + profileDataMaker); break; case DataChannelConstants.MSG_DATA_SAMPLE: if (rsSample.next()) { @@ -388,7 +378,7 @@ public class RangeDataManager implements Runnable { Logger.error("Wrong data from selecting function profiling data inside range"); break; } - } + } } catch (SQLException e) { e.printStackTrace(); } finally { @@ -406,74 +396,8 @@ public class RangeDataManager implements Runnable { continue; } } - // case 2 : context data - if (!contextSkip) { - if (logId == DataChannelConstants.MSG_CONTEXT_SWITCH_ENTRY) { - from = 0; - while (true) { - LogPackage logPackage = new LogPackage(); - Logs logs = new Logs( - DataChannelConstants.LOG_CONTEXT_SWITCH); - input = SqlManager.getInstance().selectArea2(logId, - markerStartTime, markerEndTime, from, AnalyzerConstants.DATABASE_READ_SIZE); - if (input == null || input.isEmpty()) { - break; - } - logs.setLogs(input); - logPackage.setLogs( - DataChannelConstants.LOG_CONTEXT_SWITCH, logs); - makeRangeData(logPackage); - from += AnalyzerConstants.DATABASE_READ_SIZE; - } - contextSkip = true; - continue; - } - } - // case 3 : system data - - if (logId == DataChannelConstants.MSG_DATA_SYSTEM) { - from = 0; - while (true) { - LogPackage logPackage = new LogPackage(); - Logs logs = new Logs(logId); - input = SqlManager.getInstance().selectArea2(logId, - markerStartTime, markerEndTime, from, AnalyzerConstants.DATABASE_READ_SIZE); - if (input == null || input.isEmpty()) { - break; - } - logs.setLogs(input); - logPackage.setLogs(logId, logs); - makeRangeData(logPackage); - from += AnalyzerConstants.DATABASE_READ_SIZE; - } - continue; - } - // case 4 : probe data - if (logId != DataChannelConstants.MSG_DATA_SYSTEM - && logId != DataChannelConstants.MSG_FUNCTION_ENTRY - && logId != DataChannelConstants.MSG_FUNCTION_EXIT - && logId != DataChannelConstants.MSG_CONTEXT_SWITCH_ENTRY - && logId != DataChannelConstants.MSG_CONTEXT_SWITCH_EXIT - && logId != DataChannelConstants.MSG_DATA_SAMPLE) { - - from = 0; - while (true) { - LogPackage logPackage = new LogPackage(); - Logs logs = new Logs(logId); - input = SqlManager.getInstance().selectArea2(logId, - markerStartTime, markerEndTime, from, AnalyzerConstants.DATABASE_READ_SIZE); - if (input == null || input.isEmpty()) { - break; - } - logs.setLogs(input); - logPackage.setLogs(logId, logs); - makeRangeData(logPackage); - from += AnalyzerConstants.DATABASE_READ_SIZE; - } - continue; - } } - + // make leak data SummaryDataManager.getInstance().getLeakDataMaker() .makeLeakDataForRange(Long.valueOf(markerStartTime), Long.valueOf(markerEndTime)); @@ -487,7 +411,7 @@ public class RangeDataManager implements Runnable { } }); } - + private ProfileData makeFunctionProfileData(int id, ResultSet rs) { ProfileData profileData = null; try { @@ -499,15 +423,15 @@ public class RangeDataManager implements Runnable { long time = rs.getLong(Function.TIME.index); long callerPcAddr = rs.getLong(Function.CALLERPCADDR.index); long pcAddr = rs.getLong(Function.PCADDR.index); - - profileData = new ProfileData(id, seq, pid, tid, functionId, - binaryId, time, callerPcAddr, pcAddr); + + profileData = new ProfileData(id, seq, pid, tid, functionId, binaryId, time, + callerPcAddr, pcAddr); } catch (SQLException e) { - e.printStackTrace(); + e.printStackTrace(); } return profileData; } - + private ProfileData makeSampleProfileData(ResultSet rs) { ProfileData profileData = null; try { @@ -515,25 +439,11 @@ public class RangeDataManager implements Runnable { int pid = rs.getInt(Sample.PID.index); int tid = rs.getInt(Sample.TID.index); long pcAddr = rs.getLong(Sample.PCADDR.index); - - profileData = new ProfileData(time, pid, tid, pcAddr); + + profileData = new ProfileData(time, pid, tid, pcAddr); } catch (SQLException e) { - e.printStackTrace(); + e.printStackTrace(); } return profileData; } - - private void makeRangeData(LogPackage logPack) { - Logs logs = logPack.getLogs(DataChannelConstants.LOG_USER_FUNCTION); - if (null != logs) { - List profileData = logs.getRawLogs(); - int size = profileData.size(); - for (int i = 0; i < size; i++) { - ProfileData input = (ProfileData) profileData.get(i); - ProfileDataMaker profileDataMaker = getProfileDataMakerByPid(input - .getPid()); - profileDataMaker.makeFunctionUsageProfileData(input); - } - } - } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakData.java index 13b51ee..92f384a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakData.java @@ -239,6 +239,6 @@ public class LeakData { } public String getType() { - return LogDataFactory.getLogFormatById(id).getName(); + return LogDataFactory.getLogFormatName(id); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakTable.java index cfbc555..78a26a4 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakTable.java @@ -227,7 +227,7 @@ public class LeakTable extends DATreeComposite { data.add(pid); // 3 : message id int id = (Integer) leakData.get(MemoryAllocationDataDBTable.COLUMN.MESSAGE_ID.index); - String type = LogDataFactory.getLogFormatById(id).getName(); + String type = LogDataFactory.getLogFormatName(id); text.add(type); data.add(type); // 4 : allocated time @@ -331,7 +331,7 @@ public class LeakTable extends DATreeComposite { data.add(seq); // 3 : message id int id = (Integer) idata.get(MemoryAllocationDataDBTable.COLUMN.MESSAGE_ID.index); - String type = LogDataFactory.getLogFormatById(id).getName(); + String type = LogDataFactory.getLogFormatName(id); text.add(type); data.add(type); // 4 : allocated time diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningData.java index e45ef7c..89ee9a4 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningData.java @@ -74,7 +74,7 @@ public class WarningData { } public String getCategory() { - return LogDataFactory.getLogFormatById(category).getName(); + return LogDataFactory.getLogFormatName(category); } public int getWarningCase() { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningTable.java index 5a05d9e..e8f7bd9 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/warning/WarningTable.java @@ -159,7 +159,7 @@ public class WarningTable extends DATableComposite { data.add(Integer.toString(rid)); // 1 : message id int msgID = (Integer)idata.get(WarningDataDBTable.COLUMN_INDEX_MESSAGE_ID); - String category = LogDataFactory.getLogFormatById(msgID).getName(); + String category = LogDataFactory.getLogFormatName(msgID); text.add(category); data.add(category); // 2 : pid diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineChartManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineChartManager.java index 3d5cf5a..8a5395c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineChartManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineChartManager.java @@ -35,7 +35,7 @@ import java.util.List; import java.util.Map; import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.common.GlobalInformation; +import org.tizen.dynamicanalyzer.common.Global; import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.constant.CommonConstants; import org.tizen.dynamicanalyzer.database.DBTable; @@ -579,7 +579,7 @@ public class TimelineChartManager extends PageDataManager implements IDAChartSer String[] splitedImagePathLog = null; if (DACommunicator.isTargetEmulator() && SocketClient.getInstance().isConnected()) { - imagePathLog = GlobalInformation.getCurrentDeviceInfo().emulatorScreenshot + imagePathLog = Global.getCurrentDeviceInfo().emulatorScreenshot .getFilePath(); splitedImagePathLog = AnalyzerUtil.splitFilePath(imagePathLog, File.separator); } else { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ProcessExplorerDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ProcessExplorerDialog.java index 50aae58..8450f35 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ProcessExplorerDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ProcessExplorerDialog.java @@ -12,7 +12,7 @@ import org.eclipse.swt.layout.FormLayout; 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.common.Global; import org.tizen.dynamicanalyzer.nl.WidgetLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; @@ -39,7 +39,7 @@ public class ProcessExplorerDialog extends DAMessageBox { data.height = 476; data.width = 434; explorer.setLayoutData(data); - explorer.setDeviceInfo(GlobalInformation.getCurrentDeviceInfo()); + explorer.setDeviceInfo(Global.getCurrentDeviceInfo()); Composite buttonComp = new Composite(shell, SWT.NONE); buttonComp.setLayout(new FormLayout()); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java index afdbb97..5b16090 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java @@ -47,7 +47,7 @@ import org.eclipse.swt.widgets.Shell; 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.common.Global; import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.constant.CommonConstants; import org.tizen.dynamicanalyzer.handlers.CommandActionHandler; @@ -171,7 +171,7 @@ public class ToolbarArea { } String sDeviceName = null; - DeviceInfo curDev = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo curDev = Global.getCurrentDeviceInfo(); if (curDev != null) { sDeviceName = curDev.getIDevice().getSerialNumber(); } @@ -199,13 +199,13 @@ public class ToolbarArea { @Override public void selectionEvent(DACustomCombo combo) { String oldDeviceName = null; - DeviceInfo oldDevInfo = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo oldDevInfo = Global.getCurrentDeviceInfo(); if (oldDevInfo != null) oldDeviceName = oldDevInfo.getIDevice().getSerialNumber(); String serial = combo.getText(); if (serial != null && !serial.equals(oldDeviceName)) { - GlobalInformation.setCurrentDeviceInfo(DACommunicator + Global.setCurrentDeviceInfo(DACommunicator .setSelectedDeviceBySerial(serial)); if (null != serial && !serial.isEmpty()) { initAppCombo(); @@ -268,16 +268,16 @@ public class ToolbarArea { // TODO : implement to select common executable } - GlobalInformation.setCurrentApplication(selectedPkg); - GlobalInformation.getCurrentDeviceInfo().getCommunicator() + Global.setCurrentApplication(selectedPkg); + Global.getCurrentDeviceInfo().getCommunicator() .onAppSelected(selectedPkg); - GlobalInformation.getCurrentDeviceInfo().setSelectedPackageID( + Global.getCurrentDeviceInfo().setSelectedPackageID( selectedPkg.getPackageId()); } else { enablestart = false; } - if (enablestart && null != GlobalInformation.getCurrentDeviceInfo()) { + if (enablestart && null != Global.getCurrentDeviceInfo()) { // AnalyzerUtil // .setRecordState(RecordStateSourceProvider.RECORD_READY); AnalyzerManager.setRunningState(false); @@ -474,11 +474,11 @@ public class ToolbarArea { deviceCombo.setEnabled(false); } - if (!deviceCombo.isEnabled() || null == GlobalInformation.getCurrentDeviceInfo()) { + if (!deviceCombo.isEnabled() || null == Global.getCurrentDeviceInfo()) { appCombo.setEnabled(false); } - if (!appCombo.isEnabled() || null == GlobalInformation.getCurrentApplication()) { + if (!appCombo.isEnabled() || null == Global.getCurrentApplication()) { setStartButtonEnablement(false); } @@ -793,7 +793,7 @@ public class ToolbarArea { List pkgs = appCombo.getItems(); if (pkgs != null && pkgs.size() > 0) { PackageInfo pkgInfo = null; - String packageID = GlobalInformation.getCurrentDeviceInfo().getSelectedPackageID(); + String packageID = Global.getCurrentDeviceInfo().getSelectedPackageID(); if (null != packageID && DACommunicator.getPkgInfoByPkgId(packageID) != null) { pkgInfo = DACommunicator.getPkgInfoByPkgId(packageID); @@ -803,14 +803,14 @@ public class ToolbarArea { appCombo.select(0); } - GlobalInformation.setCurrentApplication(pkgInfo); - GlobalInformation.getCurrentDeviceInfo().getCommunicator().onAppSelected(pkgInfo); - GlobalInformation.getCurrentDeviceInfo().setSelectedPackageID(pkgInfo.getPackageId()); + Global.setCurrentApplication(pkgInfo); + Global.getCurrentDeviceInfo().getCommunicator().onAppSelected(pkgInfo); + Global.getCurrentDeviceInfo().setSelectedPackageID(pkgInfo.getPackageId()); // startButton.setButtonEnabled(true); setStartButtonState(true); } else { appCombo.select(0); - GlobalInformation.setCurrentApplication(null); + Global.setCurrentApplication(null); } } @@ -837,7 +837,7 @@ public class ToolbarArea { } else { int size = items.size(); int selIndex = 0; - String selDevice = GlobalInformation.getCurrentDeviceInfo().getIDevice() + String selDevice = Global.getCurrentDeviceInfo().getIDevice() .getSerialNumber(); for (int i = 0; i < size; i++) { deviceCombo.add(items.get(i)); @@ -847,7 +847,7 @@ public class ToolbarArea { } deviceCombo.select(selIndex); - GlobalInformation.setCurrentDeviceInfo(DACommunicator.getDeviceByName(items + Global.setCurrentDeviceInfo(DACommunicator.getDeviceByName(items .get(selIndex))); deviceCombo.setToolTipText(items.get(selIndex)); @@ -933,9 +933,9 @@ public class ToolbarArea { public void setAppComboText(final String text) { PackageInfo pkgInfo = DACommunicator.getPkgInfoByLabel(text); if (null != pkgInfo) { - GlobalInformation.setCurrentApplication(pkgInfo); - GlobalInformation.getCurrentDeviceInfo().getCommunicator().onAppSelected(pkgInfo); - GlobalInformation.getCurrentDeviceInfo().setSelectedPackageID(pkgInfo.getPackageId()); + Global.setCurrentApplication(pkgInfo); + Global.getCurrentDeviceInfo().getCommunicator().onAppSelected(pkgInfo); + Global.getCurrentDeviceInfo().setSelectedPackageID(pkgInfo.getPackageId()); Display.getDefault().syncExec(new Runnable() { @Override public void run() { @@ -948,9 +948,9 @@ public class ToolbarArea { public void setAppComboTextByAppId(String id) { PackageInfo pkgInfo = DACommunicator.getPkgInfoByMainAppID(id); if (null != pkgInfo) { - GlobalInformation.setCurrentApplication(pkgInfo); - GlobalInformation.getCurrentDeviceInfo().getCommunicator().onAppSelected(pkgInfo); - GlobalInformation.getCurrentDeviceInfo().setSelectedPackageID(pkgInfo.getPackageId()); + Global.setCurrentApplication(pkgInfo); + Global.getCurrentDeviceInfo().getCommunicator().onAppSelected(pkgInfo); + Global.getCurrentDeviceInfo().setSelectedPackageID(pkgInfo.getPackageId()); appCombo.setText(pkgInfo.getMainApp().getInfo(AppInfo.PROPERTY.LABEL.index)); } } @@ -983,7 +983,7 @@ public class ToolbarArea { } String text = deviceCombo.getText(); - String device = GlobalInformation.getCurrentDeviceInfo().getIDevice() + String device = Global.getCurrentDeviceInfo().getIDevice() .getSerialNumber(); if (!device.equals(text)) { // startButton.setButtonEnabled(false); @@ -1004,7 +1004,7 @@ public class ToolbarArea { public void run() { String text = deviceCombo.getText(); String device = null; - DeviceInfo curDev = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo curDev = Global.getCurrentDeviceInfo(); if (curDev != null) device = curDev.getIDevice().getSerialNumber(); if (device == null || !device.equals(text)) { @@ -1184,7 +1184,7 @@ public class ToolbarArea { private void setStartButtonState(boolean enabled) { if (enabled) { - DeviceInfo device = GlobalInformation.getCurrentDeviceInfo(); + DeviceInfo device = Global.getCurrentDeviceInfo(); if (null != device && device.isConfigSuccess()) { startButton.setButtonEnabled(true); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogDataManager.java index e8e5ee7..7b0084f 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogDataManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogDataManager.java @@ -31,7 +31,7 @@ import java.util.List; import org.eclipse.nebula.widgets.grid.Grid; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; -import org.tizen.dynamicanalyzer.common.GlobalInformation; +import org.tizen.dynamicanalyzer.common.Global; import org.tizen.dynamicanalyzer.common.HostResult; import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.constant.CommonConstants; @@ -610,14 +610,14 @@ public class ConfigurationDialogDataManager { public void applySwapValue(DATableComposite featuresTable) { setFeaturesValueFromTableItemsList(featuresTable.getTable()); applySettingValueToConfigureManager(); - if (null != GlobalInformation.getCurrentDeviceInfo()) { + if (null != Global.getCurrentDeviceInfo()) { HostResult result = DACommunicator.sendRuntimeMessage( DACommunicator.MSG_TYPE_CONFIG, null); if (!result.equals(HostResult.SUCCESS)) { applyFailedSwapValue(featuresTable); - } else if (!GlobalInformation.getCurrentDeviceInfo() + } else if (!Global.getCurrentDeviceInfo() .isConfigSuccess()) { - GlobalInformation.getCurrentDeviceInfo().setConfigSuccess(true); + Global.getCurrentDeviceInfo().setConfigSuccess(true); ToolbarArea.getInstance().setStartButtonEnablement(true); } else { updateFeaturesValueFromConfigureManager(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditScreenshotDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditScreenshotDialog.java index c45c86c..808ecca 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditScreenshotDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditScreenshotDialog.java @@ -47,7 +47,7 @@ import org.eclipse.swt.widgets.Composite; 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.Global; import org.tizen.dynamicanalyzer.common.ScreenshotConstants; import org.tizen.dynamicanalyzer.common.path.PathManager; import org.tizen.dynamicanalyzer.constant.CommonConstants; @@ -203,7 +203,7 @@ public class ReplayEditScreenshotDialog extends DAMessageBox { } private void getDeviceResolution() { - String selDeviceName = GlobalInformation.getCurrentDeviceInfo() + String selDeviceName = Global.getCurrentDeviceInfo() .getIDevice().getDeviceName(); String resolutionInfoXmlPath = PathManager.TIZEN_SDK_DATA_PATH + File.separator + "emulator-vms" + File.separator + "vms"//$NON-NLS-1$ -- 2.7.4