PROTOCOL: add debug print routine for control channel 84/39984/2
authorgreatim <jaewon81.lim@samsung.com>
Wed, 27 May 2015 07:52:14 +0000 (16:52 +0900)
committerJaewon Lim <jaewon81.lim@samsung.com>
Tue, 2 Jun 2015 16:32:55 +0000 (09:32 -0700)
Add debug print routine for control channel
Run "ps" commond as root privilege when get list of processes for running process analysis
Add protocol version enum

Change-Id: I859629d27bcfe88ee327ba88c58ce79bc4fb3c8b
Signed-off-by: greatim <jaewon81.lim@samsung.com>
14 files changed:
org.tizen.dynamicanalyzer.common/src/org/tizen/dynamicanalyzer/constant/CommonConstants.java
org.tizen.dynamicanalyzer.workbench/dynamic-analyzer/config/setting
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/BaseCommunicator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/CommunicatorUtils.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/DebugLog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/Protocol.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/ProtocolConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/p30/Communicator30.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/p30/ProtocolConstant30.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/p40/Communicator40.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/protocol/p40/ProtocolConstant40.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/ProfileData.java
org.tizen.dynamicanalyzer/test/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/data/setting

index 00cbfc4..0767fc5 100644 (file)
@@ -92,10 +92,10 @@ public class CommonConstants {
        public static final String ARM_ARCH = "arm"; //$NON-NLS-1$
        public static final String X86_ARCH = "x86"; //$NON-NLS-1$
 
-       public final static int SHORT_SIZE = Short.SIZE / Byte.SIZE;
-       public final static int INT_SIZE = Integer.SIZE / Byte.SIZE;
-       public final static int LONG_SIZE = Long.SIZE / Byte.SIZE;
-       public final static int FLOAT_SIZE = Float.SIZE / Byte.SIZE;
-       public final static int DOUBLE_SIZE = Double.SIZE / Byte.SIZE;
-       
+       public static final int SHORT_SIZE = Short.SIZE / Byte.SIZE;
+       public static final int INT_SIZE = Integer.SIZE / Byte.SIZE;
+       public static final int LONG_SIZE = Long.SIZE / Byte.SIZE;
+       public static final int FLOAT_SIZE = Float.SIZE / Byte.SIZE;
+       public static final int DOUBLE_SIZE = Double.SIZE / Byte.SIZE;
+
 }
index 0abb5d3..ff6f3c5 100644 (file)
@@ -5,7 +5,7 @@ Selected Target|mobile-2.3
 Selected Chart List|CPU|CPU core|CPU frequency
 Default Chart List|CPU|CPU core|CPU frequency
 Options Selected Feature List|5002:0
-Default Feature List|2|3
+Default Feature List|2|3|103
 Total Overhead Range|1000000|3000000|7000000|15000000
 mobile-2.3|Protocol Version|3.0
 mobile-2.3|Available Template List|1|2|3|4|5|6|7|8|9|10
index 45c2545..c3a08f6 100644 (file)
@@ -42,6 +42,7 @@ import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
 import org.tizen.dynamicanalyzer.common.DAResult;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.protocol.DebugLog;
 import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
 import org.tizen.dynamicanalyzer.protocol.p30.Communicator30;
 import org.tizen.dynamicanalyzer.protocol.p40.Communicator40;
@@ -98,6 +99,9 @@ public class BaseCommunicator {
                DAResult result = DAResult.SUCCESS;
 
                try {
+                       // open debug writer
+                       DebugLog.openControlChannelWriter();
+
                        // connect ecs server
                        if (device.isEmulator()) {
                                if (!SocketClient.getInstance().connect()) {
@@ -193,6 +197,9 @@ public class BaseCommunicator {
                                        AnalyzerShellCommands.DACOMMAND_KILL_MANAGER);
                }
 
+               // close debug writer
+               DebugLog.closeControlChannelWriter();
+
                return DAResult.SUCCESS;
        }
 
@@ -442,5 +449,17 @@ public class BaseCommunicator {
 
        private void debugPrintMessage(byte[] msg) {
                // TODO : implement for debugging
+               int msgid = ByteUtil.toInt(msg);
+
+               // print control messages
+               if (msgid < 0x1000) { // sent message
+                       DebugLog.printControl0("send : ");
+               } else { // received message
+                       DebugLog.printControl1("recv : ");
+               }
+
+               for (int k = 0; k < msg.length; k++)
+                       DebugLog.printControl0("%02x ", msg[k]);
+               DebugLog.printControl0("\n");
        }
 }
index f986663..a43af46 100755 (executable)
@@ -63,6 +63,22 @@ public class CommunicatorUtils {
                return port;
        }
 
+       public static boolean becomeSuperUser(IDevice device) {
+               boolean becomeSuper = false;
+
+               try {
+                       becomeSuper = device.becomeSuperUser(true);
+               } catch (TimeoutException e) {
+                       Logger.exception(e);
+               } catch (SdbCommandRejectedException e) {
+                       Logger.exception(e);
+               } catch (IOException e) {
+                       Logger.exception(e);
+               }
+
+               return becomeSuper;
+       }
+
        public static void execShellCommand(IDevice device, String command) {
                execShellCommand(device, command, NullOutputReceiver.getInstance());
        }
index 44bbba9..23abe6f 100644 (file)
@@ -159,6 +159,10 @@ public class DACommunicator {
                        return null;
                }
 
+               if (!CommunicatorUtils.becomeSuperUser(device.getIDevice())) {
+                       return null;
+               }
+
                Map<Integer, String> processMap = new TreeMap<Integer, String>();
 
                final List<String> cmdResultMultiLines = new ArrayList<String>();
index 0c078f3..0ec3a22 100644 (file)
@@ -11,11 +11,31 @@ import org.tizen.dynamicanalyzer.util.CommonUtil;
 import org.tizen.dynamicanalyzer.util.Logger;
 
 public class DebugLog {
+       private static boolean PRINT_CONTROL_LOG_TOFILE = true;
        private static boolean PRINT_DATA_LOG_TOFILE = true;
 
        // for debugging
+       private static PrintWriter controlChannelWriter = null;
        private static PrintWriter dataChannelWriter = null;
 
+       public static void openControlChannelWriter() {
+               controlChannelWriter = null;
+
+               if (PRINT_CONTROL_LOG_TOFILE) {
+                       File logPath = new File(PathManager.DA_DEBUG_CONTROL_CHANNEL_LOG_FILE);
+                       if (logPath.exists()) {
+                               logPath.delete();
+                       }
+
+                       try {
+                               controlChannelWriter = new PrintWriter(new BufferedWriter(new FileWriter(logPath)),
+                                               true);
+                       } catch (IOException e) {
+                               Logger.exception(e);
+                       }
+               }
+       }
+
        public static void openDataChannelWriter() {
                dataChannelWriter = null;
 
@@ -34,6 +54,13 @@ public class DebugLog {
                }
        }
 
+       public static void closeControlChannelWriter() {
+               if (controlChannelWriter != null) {
+                       CommonUtil.tryClose(controlChannelWriter);
+                       controlChannelWriter = null;
+               }
+       }
+
        public static void closeDataChannelWriter() {
                if (dataChannelWriter != null) {
                        CommonUtil.tryClose(dataChannelWriter);
@@ -41,6 +68,37 @@ public class DebugLog {
                }
        }
 
+       public static void printControl(int indent, String format, Object... objects) {
+               if (controlChannelWriter != null) {
+                       switch (indent) {
+                       case 0:
+                               controlChannelWriter.printf(format, objects);
+                               break;
+                       case 1:
+                               controlChannelWriter.printf("\t" + format, objects);
+                               break;
+                       case 2:
+                               controlChannelWriter.printf("\t\t" + format, objects);
+                               break;
+                       default: // max indent is 2
+                               controlChannelWriter.printf("\t\t" + format, objects);
+                               break;
+                       }
+               }
+       }
+
+       public static void printControl0(String format, Object... objects) {
+               printControl(0, format, objects);
+       }
+
+       public static void printControl1(String format, Object... objects) {
+               printControl(1, format, objects);
+       }
+
+       public static void printControl2(String format, Object... objects) {
+               printControl(2, format, objects);
+       }
+
        public static void printData(int indent, String format, Object... objects) {
                if (dataChannelWriter != null) {
                        switch (indent) {
index d0d767f..c905257 100644 (file)
@@ -34,10 +34,12 @@ import org.tizen.dynamicanalyzer.protocol.p30.ProtocolConfig30;
 import org.tizen.dynamicanalyzer.protocol.p40.ProtocolConfig40;
 import org.tizen.dynamicanalyzer.setting.Feature;
 
-public class Protocol {
+public enum Protocol {
+       VERSION_30(0, "3.0"),
+       VERSION_40(1, "4.0");
 
-       // version names
-       private static final String[] versions = { "3.0", "4.0" };
+       private int ID = -1;
+       private String versionName = null;
 
        // data channel message name map for printing debug info
        private static final Map<Integer, String> dataMsgNameMap;
@@ -79,13 +81,26 @@ public class Protocol {
                dataMsgNameMap = Collections.unmodifiableMap(tempMap);
        }
 
+       private Protocol(int id, String versionName) {
+               this.ID = id;
+               this.versionName = versionName;
+       }
+
+       public int getID() {
+               return ID;
+       }
+
+       public String getVerionString() {
+               return versionName;
+       }
+
        // convert version string to specific integer value equal or greater than zero
        // return negative value if version string is not found
-       public static int getVersionValue(String version) {
-               int size = versions.length;
-               for (int i = 0; i < size; i++) {
-                       if (versions[i].equals(version)) {
-                               return i;
+       public static int getVersionValue(String versionStr) {
+               Protocol[] versions = Protocol.values();
+               for (Protocol ver : versions) {
+                       if (ver.getVerionString().equals(versionStr)) {
+                               return ver.getID();
                        }
                }
 
@@ -93,20 +108,23 @@ public class Protocol {
        }
 
        public static String getVersionString(int protocolValue) {
-               if (protocolValue < 0 || protocolValue >= versions.length) {
-                       return CommonConstants.EMPTY;
-               } else {
-                       return versions[protocolValue];
+               Protocol[] versions = Protocol.values();
+               for (Protocol ver : versions) {
+                       if (ver.getID() == protocolValue) {
+                               return ver.getVerionString();
+                       }
                }
+
+               return CommonConstants.EMPTY;
        }
 
        public static IProtocolConfig[] getProtocolConfig(int protocolVersion, Feature feature)
                        throws UnknownProtocolException {
                IProtocolConfig[] configs = null;
 
-               if (protocolVersion == 0) { // protocol 3.0
+               if (protocolVersion == VERSION_30.getID()) { // protocol 3.0
                        configs = ProtocolConfig30.getProtocolConfig(feature);
-               } else if (protocolVersion == 1) { // protocol 4.0
+               } else if (protocolVersion == VERSION_40.getID()) { // protocol 4.0
                        configs = ProtocolConfig40.getProtocolConfig(feature);
                } else { // unknown protocol
                        throw new UnknownProtocolException();
index af3ff5f..4e768f5 100644 (file)
@@ -45,81 +45,81 @@ public class ProtocolConstants {
        public static final int DATAMSG_PAYLOADLEN_INDEX = 16;
 
        // data message id
-       public final static int MSG_DATA_PROCESS_INFO = 0x0001;
-       public final static int MSG_DATA_TERMINATE = 0x0002;
-       public final static int MSG_DATA_ERROR = 0x0003;
-       public final static int MSG_DATA_SAMPLE = 0x0004;
-       public final static int MSG_DATA_SYSTEM = 0x0005;
-       public final static int MSG_DATA_IMAGE = 0x0006;
-       public final static int MSG_DATA_RECORD = 0x0007;
-       public final static int MSG_FUNCTION_ENTRY = 0x0008;
-       public final static int MSG_FUNCTION_EXIT = 0x0009;
-       public final static int MSG_CONTEXT_SWITCH_ENTRY = 0x0010;
-       public final static int MSG_CONTEXT_SWITCH_EXIT = 0x0011;
-       public final static int MSG_PROCESS_MAP = 0x0012;
-       public final static int MSG_PROCESS_UNMAP = 0x0013;
-       public final static int MSG_PROCESS_COMM = 0x0014;
+       public static final int MSG_DATA_PROCESS_INFO = 0x0001;
+       public static final int MSG_DATA_TERMINATE = 0x0002;
+       public static final int MSG_DATA_ERROR = 0x0003;
+       public static final int MSG_DATA_SAMPLE = 0x0004;
+       public static final int MSG_DATA_SYSTEM = 0x0005;
+       public static final int MSG_DATA_IMAGE = 0x0006;
+       public static final int MSG_DATA_RECORD = 0x0007;
+       public static final int MSG_FUNCTION_ENTRY = 0x0008;
+       public static final int MSG_FUNCTION_EXIT = 0x0009;
+       public static final int MSG_CONTEXT_SWITCH_ENTRY = 0x0010;
+       public static final int MSG_CONTEXT_SWITCH_EXIT = 0x0011;
+       public static final int MSG_PROCESS_MAP = 0x0012;
+       public static final int MSG_PROCESS_UNMAP = 0x0013;
+       public static final int MSG_PROCESS_COMM = 0x0014;
 
        // data probe message id
-       public final static int MSG_PROBE_MIN = 0x0101;
-       public final static int MSG_PROBE_MEMORY = 0x0101;
-       public final static int MSG_PROBE_UICONTROL = 0x0102;
-       public final static int MSG_PROBE_UIEVENT = 0x0103;
-       public final static int MSG_PROBE_FILE = 0x0104;
-       public final static int MSG_PROBE_LIFECYCLE = 0x0105;
-       public final static int MSG_PROBE_SCREENSHOT = 0x0106;
-       public final static int MSG_PROBE_SCENE = 0x0107;
-       public final static int MSG_PROBE_THREAD = 0x0108;
-       public final static int MSG_PROBE_CUSTOM = 0x0109;
-       public final static int MSG_PROBE_SYNC = 0x0110;
-       public final static int MSG_PROBE_NETWORK = 0x0111;
-       public final static int MSG_PROBE_GLES20 = 0x0112;
+       public static final int MSG_PROBE_MIN = 0x0101;
+       public static final int MSG_PROBE_MEMORY = 0x0101;
+       public static final int MSG_PROBE_UICONTROL = 0x0102;
+       public static final int MSG_PROBE_UIEVENT = 0x0103;
+       public static final int MSG_PROBE_FILE = 0x0104;
+       public static final int MSG_PROBE_LIFECYCLE = 0x0105;
+       public static final int MSG_PROBE_SCREENSHOT = 0x0106;
+       public static final int MSG_PROBE_SCENE = 0x0107;
+       public static final int MSG_PROBE_THREAD = 0x0108;
+       public static final int MSG_PROBE_CUSTOM = 0x0109;
+       public static final int MSG_PROBE_SYNC = 0x0110;
+       public static final int MSG_PROBE_NETWORK = 0x0111;
+       public static final int MSG_PROBE_GLES20 = 0x0112;
 
        // Custom Message ID
-       public final static int MSG_FUCNTION_ENTRY_EXIT = 0x0900;
-       public final static int MSG_UNKNOWN = 0;
+       public static final int MSG_FUCNTION_ENTRY_EXIT = 0x0900;
+       public static final int MSG_UNKNOWN = 0;
 
        // feature flag values (low 8 byte)
-       public final static long FEATURE_RESERVED1 = 0x1L << 0;
-       public final static long FEATURE_RESERVED2 = 0x1L << 1;
-       public final static long FEATURE_FUNCTION_PROFILING = 0x1L << 2;
-       public final static long FEATURE_MEMORY_ALLOC_PROBE = 0x1L << 3;
-       public final static long FEATURE_FILE_API_PROBE = 0x1L << 4;
-       public final static long FEATURE_THREAD_API_PROBE = 0x1L << 5;
-       public final static long FEATURE_OSPUI_API_PROBE = 0x1L << 6;
-       public final static long FEATURE_SCREENSHOT = 0x1L << 7;
-       public final static long FEATURE_USER_EVENT = 0x1L << 8;
-       public final static long FEATURE_RECORDING = 0x1L << 9;
-       public final static long FEATURE_SYSCALL_FILE = 0x1L << 10;
-       public final static long FEATURE_SYSCALL_IPC = 0x1L << 11;
-       public final static long FEATURE_SYSCALL_PROCESS = 0x1L << 12;
-       public final static long FEATURE_SYSCALL_SIGNAL = 0x1L << 13;
-       public final static long FEATURE_SYSCALL_NETWORK = 0x1L << 14;
-       public final static long FEATURE_SYSCAL_DESC = 0x1L << 15;
-       public final static long FEATURE_CONTEXT_SWITCH = 0x1L << 16;
-       public final static long FEATURE_NETWORK_API_PROBE = 0x1L << 17;
-       public final static long FEATURE_OPENGL_API_PROBE = 0x1L << 18;
-       public final static long FEATURE_FUNCTION_SAMPLING = 0x1L << 19;
+       public static final long FEATURE_RESERVED1 = 0x1L << 0;
+       public static final long FEATURE_RESERVED2 = 0x1L << 1;
+       public static final long FEATURE_FUNCTION_PROFILING = 0x1L << 2;
+       public static final long FEATURE_MEMORY_ALLOC_PROBE = 0x1L << 3;
+       public static final long FEATURE_FILE_API_PROBE = 0x1L << 4;
+       public static final long FEATURE_THREAD_API_PROBE = 0x1L << 5;
+       public static final long FEATURE_OSPUI_API_PROBE = 0x1L << 6;
+       public static final long FEATURE_SCREENSHOT = 0x1L << 7;
+       public static final long FEATURE_USER_EVENT = 0x1L << 8;
+       public static final long FEATURE_RECORDING = 0x1L << 9;
+       public static final long FEATURE_SYSCALL_FILE = 0x1L << 10;
+       public static final long FEATURE_SYSCALL_IPC = 0x1L << 11;
+       public static final long FEATURE_SYSCALL_PROCESS = 0x1L << 12;
+       public static final long FEATURE_SYSCALL_SIGNAL = 0x1L << 13;
+       public static final long FEATURE_SYSCALL_NETWORK = 0x1L << 14;
+       public static final long FEATURE_SYSCAL_DESC = 0x1L << 15;
+       public static final long FEATURE_CONTEXT_SWITCH = 0x1L << 16;
+       public static final long FEATURE_NETWORK_API_PROBE = 0x1L << 17;
+       public static final long FEATURE_OPENGL_API_PROBE = 0x1L << 18;
+       public static final long FEATURE_FUNCTION_SAMPLING = 0x1L << 19;
 
-       public final static long FEATURE_INTERNAL_MEMORY_ALLOC = 0x1L << 28;
-       public final static long FEATURE_INTERNAL_FILE_API = 0x1L << 29;
-       public final static long FEATURE_INTERNAL_THREAD_API = 0x1L << 30;
-       public final static long FEATURE_INTERNAL_OSPUI_API = 0x1L << 31;
-       public final static long FEATURE_INTERNAL_NETWORK_API = 0x1L << 32;
-       public final static long FEATURE_INTERNAL_OPENGL_API = 0x1L << 33;
+       public static final long FEATURE_INTERNAL_MEMORY_ALLOC = 0x1L << 28;
+       public static final long FEATURE_INTERNAL_FILE_API = 0x1L << 29;
+       public static final long FEATURE_INTERNAL_THREAD_API = 0x1L << 30;
+       public static final long FEATURE_INTERNAL_OSPUI_API = 0x1L << 31;
+       public static final long FEATURE_INTERNAL_NETWORK_API = 0x1L << 32;
+       public static final long FEATURE_INTERNAL_OPENGL_API = 0x1L << 33;
 
-       public final static long FEATURE_SYSTEM_CPU = 0x1L << 36;
-       public final static long FEATURE_SYSTEM_MEMORY = 0x1L << 37;
-       public final static long FEATURE_SYSTEM_PROCESS = 0x1L << 38;
-       public final static long FEATURE_SYSTEM_THREAD_LOAD = 0x1L << 39;
-       public final static long FEATURE_SYSTEM_PROCESSES_LOAD = 0x1L << 40;
-       public final static long FEATURE_SYSTEM_DISK = 0x1L << 41;
-       public final static long FEATURE_SYSTEM_NETWORK = 0x1L << 42;
-       public final static long FEATURE_SYSTEM_DEVICE = 0x1L << 43;
-       public final static long FEATURE_SYSTEM_ENERGY = 0x1L << 44;
+       public static final long FEATURE_SYSTEM_CPU = 0x1L << 36;
+       public static final long FEATURE_SYSTEM_MEMORY = 0x1L << 37;
+       public static final long FEATURE_SYSTEM_PROCESS = 0x1L << 38;
+       public static final long FEATURE_SYSTEM_THREAD_LOAD = 0x1L << 39;
+       public static final long FEATURE_SYSTEM_PROCESSES_LOAD = 0x1L << 40;
+       public static final long FEATURE_SYSTEM_DISK = 0x1L << 41;
+       public static final long FEATURE_SYSTEM_NETWORK = 0x1L << 42;
+       public static final long FEATURE_SYSTEM_DEVICE = 0x1L << 43;
+       public static final long FEATURE_SYSTEM_ENERGY = 0x1L << 44;
 
-       public final static long FEATURE_SYSTEM_FILE_ACTIVITY = 0x1L << 48;
+       public static final long FEATURE_SYSTEM_FILE_ACTIVITY = 0x1L << 48;
 
        // miscellaneous
-       public final static String MAIN_FUNCTION_SYMBOL = "main";
+       public static final String MAIN_FUNCTION_SYMBOL = "main";
 }
index 6b29240..50f15ad 100644 (file)
@@ -80,8 +80,6 @@ import org.tizen.dynamicanalyzer.ui.toolbar.replay.data.ReplayDataManager;
 import org.tizen.dynamicanalyzer.util.ByteUtil;
 import org.tizen.dynamicanalyzer.util.CommonUtil;
 import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.sdblib.exception.SdbCommandRejectedException;
-import org.tizen.sdblib.exception.TimeoutException;
 import org.tizen.sdblib.receiver.MultiLineReceiver;
 import org.tizen.sdblib.service.SyncResult;
 
@@ -723,22 +721,10 @@ public class Communicator30 extends SubCommunicator {
        }
 
        protected DAResult pullTheFile(String from, String to) {
-               boolean becomeSuper = false;
-
                DeviceInfo curDev = parent.getDevice();
 
-               try {
-                       becomeSuper = curDev.getIDevice().becomeSuperUser(true);
-               } catch (TimeoutException e) {
-                       Logger.exception(e);
-               } catch (SdbCommandRejectedException e) {
-                       Logger.exception(e);
-               } catch (IOException e) {
-                       Logger.exception(e);
-               } finally {
-                       if (!becomeSuper) {
-                               return DAResult.ERR_BY_SECURITY;
-                       }
+               if (!CommunicatorUtils.becomeSuperUser(curDev.getIDevice())) {
+                       return DAResult.ERR_BY_SECURITY;
                }
 
                SyncResult res = CommunicatorUtils.pull(curDev.getIDevice(), from, to);
index 2dbcd0b..be71dce 100644 (file)
@@ -27,35 +27,35 @@ package org.tizen.dynamicanalyzer.protocol.p30;
 
 public class ProtocolConstant30 {
        // control message id
-       public final static int MSG_KEEP_ALIVE = 0x0001;
-       public final static int MSG_START_SWAP = 0x0002;
-       public final static int MSG_STOP_SWAP = 0x0003;
-       public final static int MSG_CONFIG = 0x0004;
-       public final static int MSG_BINARY_INFO = 0x0005;
-       public final static int MSG_TARGET_INFO = 0x0007;
-       public final static int MSG_SWAP_INST_ADD = 0x0008;
-       public final static int MSG_SWAP_INST_REMOVE = 0x0009;
-       public final static int MSG_GET_SCREENSHOT = 0x0010;
-       public final static int MSG_GET_PROCESS_ADD_INFO = 0x0011;
+       public static final int MSG_KEEP_ALIVE = 0x0001;
+       public static final int MSG_START_SWAP = 0x0002;
+       public static final int MSG_STOP_SWAP = 0x0003;
+       public static final int MSG_CONFIG = 0x0004;
+       public static final int MSG_BINARY_INFO = 0x0005;
+       public static final int MSG_TARGET_INFO = 0x0007;
+       public static final int MSG_SWAP_INST_ADD = 0x0008;
+       public static final int MSG_SWAP_INST_REMOVE = 0x0009;
+       public static final int MSG_GET_SCREENSHOT = 0x0010;
+       public static final int MSG_GET_PROCESS_ADD_INFO = 0x0011;
 
        // ack message id
-       public final static int MSG_KEEP_ALIVE_ACK = 0x1001;
-       public final static int MSG_START_ACK = 0x1002;
-       public final static int MSG_STOP_ACK = 0x1003;
-       public final static int MSG_CONFIG_ACK = 0x1004;
-       public final static int MSG_BINARY_INFO_ACK = 0x1005;
-       public final static int MSG_TARGET_INFO_ACK = 0x1007;
-       public final static int MSG_SWAP_INST_ADD_ACK = 0x1008;
-       public final static int MSG_SWAP_INST_REMOVE_ACK = 0x1009;
-       public final static int MSG_GET_PROCESS_ADD_INFO_ACK = 0x1011;
+       public static final int MSG_KEEP_ALIVE_ACK = 0x1001;
+       public static final int MSG_START_ACK = 0x1002;
+       public static final int MSG_STOP_ACK = 0x1003;
+       public static final int MSG_CONFIG_ACK = 0x1004;
+       public static final int MSG_BINARY_INFO_ACK = 0x1005;
+       public static final int MSG_TARGET_INFO_ACK = 0x1007;
+       public static final int MSG_SWAP_INST_ADD_ACK = 0x1008;
+       public static final int MSG_SWAP_INST_REMOVE_ACK = 0x1009;
+       public static final int MSG_GET_PROCESS_ADD_INFO_ACK = 0x1011;
 
        /**************************************************************
-        *  flags
+        * flags
         **************************************************************/
-       
+
        // replay on / off
-       public final static int REPLAY_OFF = 0;
-       public final static int REPLAY_ON = 1;
+       public static final int REPLAY_OFF = 0;
+       public static final int REPLAY_ON = 1;
 
        // application type
        public static final int APPTYPE_TIZEN = 1;
index c835bb1..a4bccdb 100644 (file)
@@ -216,8 +216,6 @@ public class Communicator40 extends Communicator30 {
        // return true, otherwise
        @Override
        protected boolean serializeApplicationInst(ProtocolSerializer ps) {
-               super.serializeApplicationInst(ps);
-
                DeviceInfo dev = parent.getDevice();
                String pkgID = Global.getCurrentApplication().getPackageId();
                PackageInfo pkgInfo = dev.getPkgInfoByPkgID(pkgID);
index 6e4bcdd..dd3f68e 100644 (file)
@@ -29,23 +29,23 @@ import org.tizen.dynamicanalyzer.protocol.p30.ProtocolConstant30;
 
 public class ProtocolConstant40 extends ProtocolConstant30 {
        // changed from protocol 3.0
-       public final static int MSG_KEEP_ALIVE = 0x000F;
+       public static final int MSG_KEEP_ALIVE = 0x000F;
 
        // added in protocol 4.0
-       public final static int MSG_VERSION = 0x0001;
-       public final static int MSG_GET_PROBEMAP = 0x000A;
+       public static final int MSG_VERSION = 0x0001;
+       public static final int MSG_GET_PROBEMAP = 0x000A;
 
        // changed from protocol 3.0
-       public final static int MSG_KEEP_ALIVE_ACK = 0x100F;
+       public static final int MSG_KEEP_ALIVE_ACK = 0x100F;
 
        // added in protocol 4.0
-       public final static int MSG_UNKNOWN_ACK = 0x1000;
-       public final static int MSG_VERSION_ACK = 0x1001;
-       public final static int MSG_GET_PROBEMAP_ACK = 0x100A;
-       public final static int MSG_GET_SCREENSHOT_ACK = 0x1010;
+       public static final int MSG_UNKNOWN_ACK = 0x1000;
+       public static final int MSG_VERSION_ACK = 0x1001;
+       public static final int MSG_GET_PROBEMAP_ACK = 0x100A;
+       public static final int MSG_GET_SCREENSHOT_ACK = 0x1010;
 
        // function instrument type
-       public final static byte PROBE_COMMON = 0;
-       public final static byte PROBE_FBI = 1;
-       public final static byte PROBE_WEB = 3;
+       public static final byte PROBE_COMMON = 0;
+       public static final byte PROBE_FBI = 1;
+       public static final byte PROBE_WEB = 3;
 }
index 0885cdf..17671ca 100644 (file)
@@ -29,6 +29,7 @@ package org.tizen.dynamicanalyzer.swap.model.data;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.Global;
 import org.tizen.dynamicanalyzer.model.DATime;
+import org.tizen.dynamicanalyzer.protocol.Protocol;
 import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
 import org.tizen.dynamicanalyzer.util.Logger;
 
@@ -111,8 +112,11 @@ public class ProfileData extends LogData {
                        pid = getInt();
                        tid = getInt();
 
-                       probeType = getShort();
-                       probeSubType = getShort();
+                       // removed from protocol 4.0 and later
+                       if (protocolVersion == Protocol.VERSION_30.getID()) {
+                               probeType = getShort();
+                               probeSubType = getShort();
+                       }
 
                        pcAddr = getLong();
                        callerPcAddr = getLong();
@@ -125,8 +129,11 @@ public class ProfileData extends LogData {
                        pid = getInt();
                        tid = getInt();
 
-                       probeType = getShort();
-                       probeSubType = getShort();
+                       // removed from protocol 4.0 and later
+                       if (protocolVersion == Protocol.VERSION_30.getID()) {
+                               probeType = getShort();
+                               probeSubType = getShort();
+                       }
 
                        pcAddr = getLong();
                        callerPcAddr = getLong();
index 0abb5d3..ff6f3c5 100644 (file)
@@ -5,7 +5,7 @@ Selected Target|mobile-2.3
 Selected Chart List|CPU|CPU core|CPU frequency
 Default Chart List|CPU|CPU core|CPU frequency
 Options Selected Feature List|5002:0
-Default Feature List|2|3
+Default Feature List|2|3|103
 Total Overhead Range|1000000|3000000|7000000|15000000
 mobile-2.3|Protocol Version|3.0
 mobile-2.3|Available Template List|1|2|3|4|5|6|7|8|9|10