[Title] snapshot image viewer fixed
authorLee <jy.exe.lee@samsung.com>
Wed, 28 Nov 2012 08:02:22 +0000 (17:02 +0900)
committerLee <jy.exe.lee@samsung.com>
Wed, 28 Nov 2012 08:02:22 +0000 (17:02 +0900)
[Desc.] image viewer fixed, range view blocked
[Issue] -

21 files changed:
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogCenterConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/MessageProcess.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FilePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallStackManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallstackTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/ImageViewer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/range/RangePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/SummaryPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/DATimelineTabComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/TimelinePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/UIPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DATabComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/ImageUtil.java

index 6862e85..9b1f697 100644 (file)
@@ -44,6 +44,7 @@ public class AnalyzerConstants {
        public static final String TEMP_FOLDER_NAME = "temp"; //$NON-NLS-1$\r
        public static final String TEMP_FOLDER_RUN_PREFIX = ".RUN"; //$NON-NLS-1$\r
        public static final String IMAGE_FOLDER_NAME = "img"; //$NON-NLS-1$\r
+       public static final String SMALL_IMAGE_FOLDER_NAME = "small"; //$NON-NLS-1$\r
        public static final String ICON_WORKBENCH_FOLDER_NAME = "icons"; //$NON-NLS-1$\r
        public static final String XML_FOLDER_NAME = "xml"; //$NON-NLS-1$\r
        public static final String CONFIG_FOLDER_NAME = "config"; //$NON-NLS-1$\r
index e038d96..c07b63c 100644 (file)
@@ -253,8 +253,6 @@ public class OpenTraceHandler extends AbstractHandler {
                        return false;\r
                }\r
 \r
-               // HashMap<Long, String> apiHash =\r
-               // LogSpliter.getCallStackApiByAddrMap();\r
                HashMap<Long, CallStackUnit> apiHash = CallStackManager.getInstance()\r
                                .getCallStackApiByAddrMap();\r
                try {\r
@@ -398,7 +396,8 @@ public class OpenTraceHandler extends AbstractHandler {
                                DBTableManager.TABLE_INDEX_PROFILING_DATA);\r
                String tableName = profilingData.getTableName();\r
                ResultSet rs = SqlManager.selectAllFromTable(tableName);\r
-               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance().getProfileDataMaker();\r
+               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
+                               .getProfileDataMaker();\r
                if (null == rs || profiler == null) {\r
                        return false;\r
                }\r
index f1eddef..da20768 100644 (file)
@@ -40,7 +40,7 @@ public class LogCenterConstants {
        public static final int LOG_DEVICE = 9;
        public static final int LOG_SAMPLE = 11;
        public static final int LOG_THREAD = 12;
-//     public static final int LOG_SYSTEM = 12;
+       // public static final int LOG_SYSTEM = 12;
        public static final int LOG_CUSTOM_CHART = 13;
 
        public static final int TYPE_CALLSTACK = 99;
@@ -81,7 +81,7 @@ public class LogCenterConstants {
        public static final int UI_EVENT_Y = 15;
        public static final int UI_EVENT_INFO1 = 16;
        public static final int UI_EVENT_INFO2 = 17;
-       
+
        /* log user function : 4 */
        public static final int USER_FUNCTION_BINARY_RANGE_START_INDEX = 12;
        public static final int USER_FUNCTION_BINARY_RANGE_END_INDEX = 13;
@@ -118,6 +118,9 @@ public class LogCenterConstants {
        public static final String FD_API_WAIT = "13"; //$NON-NLS-1$
        public static final String FD_API_INTERNAL_USE = "14"; //$NON-NLS-1$
 
+       /* Log snapshot */
+       public static final int SNAPSHOT_IMAGE_PATH_INDEX = 12;
+
        /* Log UserInterface Scene Transforms : 8 */
        public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_SCENE_NAME_INDEX = 12;
        public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_FORM_NAME_INDEX = 13;
@@ -158,17 +161,17 @@ public class LogCenterConstants {
        public static final int DEVICE_THREAD_COUNT_INDEX = 30;
        public static final int DEVICE_THREAD_LOAD_INDEX = 31;
        public static final int DEVICE_THREAD_RESERVED_INDEX = 32;
-       
+
        /* thread log : 12 */
        public static final int THREAD_PTHREAD_ID_INDEX = 12;
        public static final int THREAD_OSPTHREAD_ID_INDEX = 13;
        public static final int THREAD_TYPE_INDEX = 14;
        public static final int THREAD_API_TYPE_INDEX = 15;
-       
+
        public static final int THREAD_TYPE_PTHREAD = 0;
        public static final int THREAD_TYPE_OSP = 1;
        public static final int THREAD_TYPE_MAIN = 2;
-       
+
        public static final int THREAD_API_TYPE_NEW = 0;
        public static final int THREAD_API_TYPE_START = 1;
        public static final int THREAD_API_TYPE_STOP = 2;
@@ -178,7 +181,7 @@ public class LogCenterConstants {
        public static final int THREAD_API_TYPE_INTERNAL_START = 6;
        public static final int THREAD_API_TYPE_INTERNAL_STOP = 7;
        public static final int THREAD_API_TYPE_OTHER = 8;
-       
+
        /* internal log */
        public static final int INTERNAL_CALL = 1;
        public static final int USER_CALL = 2;
index b0261a5..5c9144e 100644 (file)
@@ -97,8 +97,12 @@ public class LogInserter implements Runnable {
                                        packCount++;
                                        for (int i = 0; i < size; i++) {
                                                LogCenter logCenter = logcs.get(i);
+                                               Logs newLogs = new Logs(logCenter.getId());
                                                Logs logs = logPack.getLogs(logCenter.getId());
-                                               getLogPackage().putLogs(logs);
+                                               if (null != logs) {
+                                                       newLogs.getLogs().addAll(logs.getCloneLogs());
+                                                       getLogPackage().putLogs(logs);
+                                               }
                                        } // for
                                } else {
                                        Thread.sleep(AnalyzerConstants.LOG_CHECK_INTERVAL);
index 944ea26..51c144f 100644 (file)
@@ -25,6 +25,7 @@
  */
 package org.tizen.dynamicanalyzer.logparser;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -33,6 +34,7 @@ import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.SymbolManager;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.model.ImageInfo;
 import org.tizen.dynamicanalyzer.model.LogCenter;
 import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
@@ -42,6 +44,9 @@ import org.tizen.dynamicanalyzer.ui.info.range.StopProcessManager;
 import org.tizen.dynamicanalyzer.ui.page.BaseView;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.ImageUtil;
+import org.tizen.sdblib.SyncService;
+import org.tizen.sdblib.SyncService.SyncResult;
 
 public class LogParser implements Runnable {
        private final String OSP_MAIN = "OspMain"; //$NON-NLS-1$
@@ -50,6 +55,12 @@ public class LogParser implements Runnable {
        private static boolean dropCallTraceLog = false;
        private static LogQueue logQueue = null;
 
+       private int SMALL_IMG_WIDTH = 40;
+       private int SMALL_IMG_HEIGHT = 66;
+
+       private int DEFAULT_IMG_WIDTH = 480;
+       private int DEFAULT_IMG_HEIGHT = 800;
+
        /** thread **/
        // range of values??
        private String pid = null;
@@ -199,8 +210,14 @@ public class LogParser implements Runnable {
 
                                /* user callstack create by entry and exit */
                                CallStackManager.getInstance().makeUserCallstack(slicedLog);
-
-                       } else if (log.length > 1) {
+                       } else if (Integer.parseInt(logId) == LogCenterConstants.LOG_DEVICE) {
+                               pushLog(logId, slicedLog, logPack);
+                       } else {
+                               if (Integer.parseInt(logId) == LogCenterConstants.LOG_SNAPSHOT) {
+                                       String remoteImgPath = new String(
+                                                       slicedLog[LogCenterConstants.SNAPSHOT_IMAGE_PATH_INDEX]);
+                                       processImage(remoteImgPath);
+                               }
                                pushLog(logId, slicedLog, logPack);
                                CallStackManager.getInstance().makeCallstackWithoutBacktrace(
                                                slicedLog);
@@ -210,8 +227,6 @@ public class LogParser implements Runnable {
                                }
 
                                AnalyzerManager.getFailedChecker().check(slicedLog);
-                       } else {
-                               pushLog(logId, slicedLog, logPack);
                        }
                }
                AnalyzerManager.getProject().setLastLogNum(lastLogSeqNumber);
@@ -219,6 +234,45 @@ public class LogParser implements Runnable {
                updateLog(logPack);
        }
 
+       private void processImage(final String from) {
+               final String fileName = getImageName(from);
+               final String to = AnalyzerManager.getProject().getSavePath()
+                               + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
+                               + File.separator + fileName;
+
+               new Thread(null, new Runnable() {
+                       @Override
+                       public void run() {
+                               SyncResult res = DACommunicator.pull(from, to);
+                               if (null != res && SyncService.RESULT_OK == res.getCode()) {
+                                       DACommunicator.remove(from);
+                                       /* image resizing */
+                                       String smallImagePath = AnalyzerManager.getProject()
+                                                       .getSavePath()
+                                                       + File.separator
+                                                       + AnalyzerConstants.IMAGE_FOLDER_NAME
+                                                       + File.separator
+                                                       + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME
+                                                       + File.separator + fileName;
+                                       ImageUtil.resize(to, to, DEFAULT_IMG_WIDTH,
+                                                       DEFAULT_IMG_HEIGHT);
+                                       ImageUtil.resize(to, smallImagePath, SMALL_IMG_WIDTH,
+                                                       SMALL_IMG_HEIGHT);
+                               } else {
+                                       System.out.println("Failed to get '" + from + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
+                               }
+                       }
+               }, AnalyzerConstants.MESSAGE_INTERNAL_IMAGE_THREAD).start();
+
+       }
+
+       private String getImageName(String fullPath) {
+               String name = null;
+               name = fullPath
+                               .substring(fullPath.lastIndexOf(CommonConstants.SLASH) + 1);
+               return name;
+       }
+
        private void updateLog(LogPackage logPack) {
                if (null == logPack || logPack.isEmpty()) {
                        return;
index 7380f12..5aeebe9 100644 (file)
@@ -125,17 +125,14 @@ public class MessageProcess {
                                if (!AnalyzerManager.hasSampleThread()) {
                                        AnalyzerManager.setSampleThread(true);
                                }
-                               System.out.println("sample get!");
-                               System.out.println(ToolbarArea.getInstance().getTime());
-                               System.out.println("sample time get!");
                                processUserProfiling(messages[1]);
                                break;
                        case AnalyzerConstants.MSG_DEVICE_LOG: /* device info : 4 */
                        case AnalyzerConstants.MSG_LOG: /* log : 5 */
-                               // if (AnalyzerConstants.MSG_LOG == messageIndex) {
-                               // System.out
-                               // .println("count " + messageCount + ": " + message);
-                               // }
+//                              if (AnalyzerConstants.MSG_LOG == messageIndex) {
+//                              System.out
+//                              .println("count " + messageCount + ": " + message);
+//                              }
                                buffer.add(messages[1]);
                                messageCount += 1;
                                break;
index 0d2dfb7..466bfb5 100755 (executable)
@@ -193,6 +193,13 @@ public class Project {
                        imgFolder.mkdirs();
                }
 
+               File samallImage = new File(savePath + File.separator
+                               + AnalyzerConstants.IMAGE_FOLDER_NAME + File.separator
+                               + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME);
+               if (!samallImage.isDirectory()) {
+                       samallImage.mkdirs();
+               }
+
                initLogCenters(null);
                AnalyzerManager.setProject(this);
 
index e63450d..f0c7eb3 100644 (file)
@@ -40,6 +40,7 @@ import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.DAView;
 import org.tizen.dynamicanalyzer.nl.FilePageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
@@ -101,6 +102,9 @@ public class FileApiListView extends DAView {
 
        @Override
        public void updateView(DASelectionData data) {
+               if (data.getViewId().equals(DATabComposite.ID)) {
+                       return;
+               }
                Grid fileChart = (Grid) data.getControl();
                GridItem[] items = fileChart.getSelection();
                GridItem item = items[0];
index 7b8e1c6..99438b6 100644 (file)
@@ -77,7 +77,7 @@ public class FilePage extends DAPageComposite {
                leftForm.setWeights(new int[] { 60, 40 });
 
                rightForm = new SashForm(baseForm, SWT.VERTICAL);
-               DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE, TAB_ID);
+               DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE);
                addView(tabView);
                {
                        SnapshotView currentView = new SnapshotView(
index 1e80b35..11482d7 100644 (file)
@@ -45,36 +45,36 @@ public class CallStackManager {
        class DuplicateUserCall {
                private CallStackUnit dupCallstackUnit = null;
                private int dupCallcount = 0;
-               
+
                public DuplicateUserCall(CallStackUnit callStackUnit) {
                        dupCallstackUnit = callStackUnit;
                        dupCallcount = 1;
                }
-               
+
                public CallStackUnit getDupCallstackUnit() {
                        return dupCallstackUnit;
                }
-               
+
                public int getDupCallCount() {
                        return dupCallcount;
                }
-               
+
                public void increaseDupCallCount() {
                        dupCallcount++;
                }
-               
+
                public void decreaseDupCallCount() {
                        dupCallcount--;
                }
        }
-       
+
        private static CallStackManager instance;
        private HashMap<Long, CallStackUnit> callstackApiByAddrMap;
        private HashMap<Integer, CallStackData> callstackDataBySeqMap;
        private String userFunctionBin = null;
        private HashMap<Integer, List<CallStackUnit>> userCallstackByTidMap;
        private HashMap<Integer, DuplicateUserCall> dupUserCallByTidMap;
-       
+
        public static CallStackManager getInstance() {
                if (null == instance) {
                        instance = new CallStackManager();
@@ -94,7 +94,7 @@ public class CallStackManager {
                String strCallerAddr = input[LogCenterConstants.CALLER_PCADDR_INDEX];
                String strSeq = input[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
                String strTid = input[LogCenterConstants.THREAD_ID_INDEX];
-               
+
                int seq = Integer.parseInt(strSeq);
                int tid = Integer.parseInt(strTid);
 
@@ -118,14 +118,15 @@ public class CallStackManager {
                }
 
                // insert call count
-//             FunctionUsageProfiler profiler = AnalyzerManager
-//                             .getFunctionUserProfiler();
-               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance().getProfileDataMaker();
+               // FunctionUsageProfiler profiler = AnalyzerManager
+               // .getFunctionUserProfiler();
+               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+                               .getProfileDataMaker();
                profiler.makeFupDataForCallTrace(selfCallstackUnit, input);
 
                List<CallStackUnit> userCallstack = getUserCallstack(tid);
                int size = userCallstack.size();
-               
+
                CallStackUnit callerCallstackUnit = addrMap.get(callerAddr);
                if (null == callerCallstackUnit) {
                        String strCallerFuncName = SymbolManager.addr2func(binPath,
@@ -165,7 +166,8 @@ public class CallStackManager {
                                                callerCsa.setFunctionStartAddr(callerCsa.getAddr());
                                                callerCsa.setAddr(callerAddr);
                                        } else {
-                                               callerCsa.setFunctionStartAddr(userCallstack.get(size - 1).getAddr());
+                                               callerCsa.setFunctionStartAddr(userCallstack.get(
+                                                               size - 1).getAddr());
                                                userCallstack.set(size - 1, callerCsa);
                                        }
                                }
@@ -180,7 +182,8 @@ public class CallStackManager {
                        CallStackUnit removeCallStackUnit = userCallstack.get(size - 1);
                        if (selfCallstackUnit.getFunctionName().equals(
                                        removeCallStackUnit.getFunctionName())) {
-//                     if(selfCallstackUnit.getAddr() == removeCallStackUnit.getAddr()) {
+                               // if(selfCallstackUnit.getAddr() ==
+                               // removeCallStackUnit.getAddr()) {
                                userCallstack.remove(size - 1);
                                if (size - 2 > 0) {
                                        CallStackUnit checkCallStackUnit = userCallstack
@@ -191,20 +194,22 @@ public class CallStackManager {
                                        }
                                }
                                size = userCallstack.size();
-                               if(size > 0) {
-                                       CallStackUnit prevCallstackUnit = userCallstack.get(size - 1);
-                                       long prevSelfAddr = prevCallstackUnit.getFunctionStartAddr();
+                               if (size > 0) {
+                                       CallStackUnit prevCallstackUnit = userCallstack
+                                                       .get(size - 1);
+                                       long prevSelfAddr = prevCallstackUnit
+                                                       .getFunctionStartAddr();
                                        CallStackUnit callerCsa = addrMap.get(prevSelfAddr);
-                                       if(null == callerCsa) {
+                                       if (null == callerCsa) {
                                                prevCallstackUnit.setAddr(prevSelfAddr);
                                        } else {
                                                userCallstack.set(size - 1, callerCsa);
                                        }
                                }
                        }
-                       if(AnalyzerManager.isOsp()) {
+                       if (AnalyzerManager.isOsp()) {
                                String apiName = input[LogCenterConstants.APINAME_INDEX];
-                               if(apiName.equals("OspMain")) {
+                               if (apiName.equals("OspMain")) {
                                        LogParser.setDropCallTraceLog(true);
                                }
                        }
@@ -292,14 +297,30 @@ public class CallStackManager {
 
                int seq = Integer.parseInt(strSeq);
                int tid = Integer.parseInt(strTid);
-               long callerAddr = Long.parseLong(strCallerAddr);
+               long callerAddr = 0;
+               if (!strCallerAddr.isEmpty()) {
+                       callerAddr = Long.parseLong(strCallerAddr);
+               } else {
+                       CallStackData callstackData = new CallStackData(seq);
+                       getCallStackDataBySeqMap().put(seq, callstackData);
+                       return;
+               }
 
-               List<CallStackUnit> probeCallstack = new ArrayList<CallStackUnit>(getUserCallstack(tid));
+               // long callerAddr = 0;
+               // try
+               // {
+               // callerAddr = Long.parseLong(strCallerAddr);
+               // }catch (Exception e) {
+               // System.out.println();
+               // }
+
+               List<CallStackUnit> probeCallstack = new ArrayList<CallStackUnit>(
+                               getUserCallstack(tid));
                int size = probeCallstack.size();
-               
+
                CallStackData callstackData = new CallStackData(seq);
 
-               if((size == 0) || (!AnalyzerManager.isInBinaryRange(strCallerAddr))) {
+               if ((size == 0) || (!AnalyzerManager.isInBinaryRange(strCallerAddr))) {
                        CallStackUnit callbackApi = new CallStackUnit(
                                        LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
                                        LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL);
@@ -321,43 +342,44 @@ public class CallStackManager {
                                String strCallerSymbol = getUserFunctionPosition()
                                                + AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
                                                + strCallerFuncName;
-                               callerCallstackUnit = new CallStackUnit(callerAddr, strCallerSymbol);
+                               callerCallstackUnit = new CallStackUnit(callerAddr,
+                                               strCallerSymbol);
                                addrMap.put(callerAddr, callerCallstackUnit);
                        }
 
                        CallStackUnit topUserCallstack = probeCallstack.get(size - 1);
-                       if(callerCallstackUnit.getFunctionName().equals(
+                       if (callerCallstackUnit.getFunctionName().equals(
                                        topUserCallstack.getFunctionName())) {
                                probeCallstack.set(size - 1, callerCallstackUnit);
-                       }
-                       else {
-                               System.out.println("bug : probe caller is not the same as top of user callstack");
+                       } else {
+                               System.out
+                                               .println("bug : probe caller is not the same as top of user callstack");
                        }
                }
-                       
+
                size = probeCallstack.size();
                for (int i = size - 1; i >= 0; i--) {
                        callstackData.getAddrs().add(probeCallstack.get(i).getAddr());
                }
                getCallStackDataBySeqMap().put(seq, callstackData);
-       
+
        }
-       
+
        // check irregular enter/exit log (multiple logs from 1 function call)
-       public boolean isIrregularUserCall(String[] input) { 
-               HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();      
+       public boolean isIrregularUserCall(String[] input) {
+               HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();
                HashMap<Integer, DuplicateUserCall> dupUserCallMap = getDupUserCallByTidMap();
-               
+
                boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
                String baseAddr = AnalyzerManager.getProject().getBaseAddress();
                String binPath = AnalyzerManager.getProject().getBinaryPath();
                if (null == binPath || binPath.isEmpty()) {
                        return false;
                }
-       
+
                String strSelfAddr = input[LogCenterConstants.PCADDR_INDEX];
                String strTid = input[LogCenterConstants.THREAD_ID_INDEX];
-               
+
                int tid = Integer.parseInt(strTid);
                long selfAddr = Long.parseLong(strSelfAddr);
 
@@ -379,33 +401,37 @@ public class CallStackManager {
                String strEventType = input[LogCenterConstants.USER_FUNCTION_TYPE_INDEX];
                int eventType = Integer.parseInt(strEventType);
 
-               if(size > 0) {
+               if (size > 0) {
                        if (eventType == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER) {
-                               CallStackUnit topCallstackUnit = userCallstack.get(size -1);
-                               if(topCallstackUnit.equals(selfCallstackUnit)) {
+                               CallStackUnit topCallstackUnit = userCallstack.get(size - 1);
+                               if (topCallstackUnit.equals(selfCallstackUnit)) {
                                        DuplicateUserCall dupUserCall = dupUserCallMap.get(tid);
-                                       if(null == dupUserCall) {
+                                       if (null == dupUserCall) {
                                                dupUserCall = new DuplicateUserCall(selfCallstackUnit);
                                                dupUserCallMap.put(tid, dupUserCall);
                                        } else {
-                                               if(dupUserCall.getDupCallstackUnit().equals(selfCallstackUnit)) {
+                                               if (dupUserCall.getDupCallstackUnit().equals(
+                                                               selfCallstackUnit)) {
                                                        dupUserCall.increaseDupCallCount();
                                                } else {
-                                                       System.out.println("makeUserCallstack : dup callstack check error");
+                                                       System.out
+                                                                       .println("makeUserCallstack : dup callstack check error");
                                                }
                                        }
                                        return true;
                                }
                        } else if (eventType == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_EXIT) {
                                DuplicateUserCall dupUserCall = dupUserCallMap.get(tid);
-                               if(null != dupUserCall) {
-                                       if(dupUserCall.getDupCallstackUnit().equals(selfCallstackUnit)) {
+                               if (null != dupUserCall) {
+                                       if (dupUserCall.getDupCallstackUnit().equals(
+                                                       selfCallstackUnit)) {
                                                dupUserCall.decreaseDupCallCount();
-                                               if(0 == dupUserCall.getDupCallCount()) {
+                                               if (0 == dupUserCall.getDupCallCount()) {
                                                        dupUserCallMap.remove(tid);
                                                }
                                        } else {
-                                               System.out.println("makeUserCallstack : dup callstack check error");
+                                               System.out
+                                                               .println("makeUserCallstack : dup callstack check error");
                                        }
                                        return true;
                                }
@@ -414,7 +440,6 @@ public class CallStackManager {
                return false;
        }
 
-
        public HashMap<Long, CallStackUnit> getCallStackApiByAddrMap() {
                if (null == callstackApiByAddrMap) {
                        callstackApiByAddrMap = new HashMap<Long, CallStackUnit>();
@@ -428,7 +453,7 @@ public class CallStackManager {
                }
                return callstackDataBySeqMap;
        }
-       
+
        public HashMap<Integer, DuplicateUserCall> getDupUserCallByTidMap() {
                if (null == dupUserCallByTidMap) {
                        dupUserCallByTidMap = new HashMap<Integer, DuplicateUserCall>();
@@ -439,10 +464,11 @@ public class CallStackManager {
        public String getUserFunctionPosition() {
                if (userFunctionBin == null || userFunctionBin.isEmpty()) {
                        if (AnalyzerManager.isOsp()) {
-                               userFunctionBin = new String(DACommunicator.getSelectedApp().getExecPath()
-                                               + ".exe"); //$NON-NLS-1$
+                               userFunctionBin = new String(DACommunicator.getSelectedApp()
+                                               .getExecPath() + ".exe"); //$NON-NLS-1$
                        } else {
-                               userFunctionBin = new String(DACommunicator.getSelectedApp().getExecPath());
+                               userFunctionBin = new String(DACommunicator.getSelectedApp()
+                                               .getExecPath());
                        }
                }
                return userFunctionBin;
@@ -472,13 +498,13 @@ public class CallStackManager {
                return false;
        }
 
-       public boolean isUserCall(String input)
-       {
+       public boolean isUserCall(String input) {
                if (!input.contains(LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC)) {
                        return true;
                }
                return false;
        }
+
        public String getPCAddrBySeq(int seq) {
                HashMap<Integer, CallStackData> cdMap = getCallStackDataBySeqMap();
                if (null == cdMap) {
index edfc894..a3e8065 100644 (file)
@@ -60,8 +60,7 @@ public class CallstackTable extends DATableComposite {
                        public void widgetSelected(SelectionEvent e) {
                                AnalyzerManager.getCurrentPage().controlSelection(
                                                DATabComposite.ID);
-                               table.setFocus();
-                               GridItem[] sels = table.getSelection();
+                                               GridItem[] sels = table.getSelection();
                                if (sels.length < 0) {
                                        return;
                                }
index efd9183..a438faa 100644 (file)
@@ -56,7 +56,7 @@ import org.tizen.dynamicanalyzer.common.SnapshotConstants;
 import org.tizen.dynamicanalyzer.model.ImageInfo;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.ui.timeline.DATimelineTabComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
 
 public class ImageViewer extends Composite {
 
@@ -215,9 +215,9 @@ public class ImageViewer extends Composite {
                int ix = 1, iy = 1;
 
                if (imgData.imgHeight > imgData.imgWidth) {
-                       ix = (bounds.width - imgData.imgWidth) / 2;
+                       ix = (bounds.width - defaultChildWidth * 2) / 2;
                } else {
-                       iy = (bounds.height - imgData.imgHeight) / 2;
+                       iy = (bounds.height - defaultChildHeight * 2) / 2;
                }
 
                imgData.gc.drawImage(image, 0, 0, imgData.imgWidth, imgData.imgHeight,
@@ -228,13 +228,13 @@ public class ImageViewer extends Composite {
                } else if (state == MOUSE_RIGHT && rightEnable) {
                        Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER.getBounds();
                        imgData.gc.drawImage(ImageResources.SNAPSHOT_RIGHT_HOVER,
-                                       rect.width, 0);
+                                       bounds.width - rect.width, 0);
                } else if (state == MOUSE_DOWN_LEFT && leftEnable) {
                        imgData.gc.drawImage(ImageResources.SNAPSHOT_LEFT_PUSH, 0, 0);
                } else if (state == MOUSE_DOWN_RIGHT && rightEnable) {
                        Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER.getBounds();
                        imgData.gc.drawImage(ImageResources.SNAPSHOT_RIGHT_PUSH,
-                                       rect.width, 0);
+                                       bounds.width - rect.width, 0);
                }
        }
 
@@ -386,13 +386,14 @@ public class ImageViewer extends Composite {
        private void widgetSelected(String timeStr) {
                long time = Long.parseLong(timeStr);
                AnalyzerManager.getCurrentPage().updatePage(
-                               new DASelectionData(DATimelineTabComposite.ID, time, time,
+                               new DASelectionData(DATabComposite.ID, time, time,
                                                null, null));
        }
 
        private void leftArrowAction() {
                List<ImageInfo> imageList = AnalyzerManager.getImageList();
                ImageInfo imgInfo = imageList.get(--currentImageIndex);
+               System.out.println("left");
                drawSnapshot(imgInfo.getTime());
                widgetSelected(imgInfo.getTime());
        }
@@ -403,6 +404,7 @@ public class ImageViewer extends Composite {
                        return;
                }
                ImageInfo imgInfo = imageList.get(++currentImageIndex);
+               System.out.println("right");
                drawSnapshot(imgInfo.getTime());
                widgetSelected(imgInfo.getTime());
        }
@@ -496,8 +498,8 @@ public class ImageViewer extends Composite {
                                                        }
                                                        return;
                                                }
-                                               int x = (shellMaxWidth - childWidth) / 20;
-                                               int y = (shellMaxHeight - childHeight) / 20;
+                                               int x = (shellMaxWidth - childWidth) / 10;
+                                               int y = (shellMaxHeight - childHeight) / 10;
                                                childShellWidth += x;
                                                childShellHeight += y;
 
index fd2de22..1ec7246 100644 (file)
@@ -50,7 +50,7 @@ public class BaseView extends ViewPart {
 
        @Override
        public void createPartControl(Composite parent) {
-               tabView = new DATabComposite(parent, SWT.DOUBLE_BUFFERED, null);
+               tabView = new DATabComposite(parent, SWT.DOUBLE_BUFFERED);
                tabView.setTabWidth(120);
                {
                        Composite timelinePage = new TimelinePage(
index a824142..e303629 100644 (file)
@@ -83,7 +83,7 @@ public class RangePage extends DAPageComposite {
                addView(leakView);
 
                // INFO_VIEW_INDEX = 2;
-               DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE, TAB_ID);
+               DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE);
                addView(tabView);
                {
                        SnapshotView currentView = new SnapshotView(
index 9d92e1e..8af3621 100644 (file)
@@ -86,7 +86,7 @@ public class SummaryPage extends DAPageComposite {
                addView(leakView);
 
                // INFO_VIEW_INDEX = 2;
-               DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE, TAB_ID);
+               DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE);
                addView(tabView);
                {
                        SnapshotView currentView = new SnapshotView(
index f192e92..f688ff0 100644 (file)
@@ -75,7 +75,7 @@ public class ThreadPage extends DAPageComposite {
 
                rightForm = new SashForm(baseForm, SWT.VERTICAL);
                // INFO_VIEW_INDEX = 2;
-               DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE, TAB_ID);
+               DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE);
                addView(tabView);
                {
                        SnapshotView currentView = new SnapshotView(
index c526bdd..e367422 100644 (file)
@@ -44,7 +44,7 @@ public class DATimelineTabComposite extends DATabComposite {
        public static final String ID = DATimelineTabComposite.class.getName();\r
 \r
        public DATimelineTabComposite(Composite parent, int style) {\r
-               super(parent, style, ID);\r
+               super(parent, style);\r
        }\r
 \r
        public void updateLog(LogPackage logPack) {\r
@@ -63,7 +63,9 @@ public class DATimelineTabComposite extends DATabComposite {
        }\r
 \r
        public void updateView(DASelectionData data) {\r
-\r
+               if (data.getViewId().equals(SnapshotView.ID)) {\r
+                       return;\r
+               }\r
                RangeView rangeView = (RangeView) getTab(RangeView.ID);\r
                SnapshotView snapshotView = (SnapshotView) getTab(SnapshotView.ID);\r
 \r
index ff848ba..b4f8c82 100644 (file)
@@ -41,6 +41,7 @@ import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
 import org.tizen.dynamicanalyzer.ui.timeline.calltrace.CallTraceView;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
 
 public class TimelinePage extends DAPageComposite {
        public static final String ID = TimelinePage.class.getName();
@@ -71,8 +72,9 @@ public class TimelinePage extends DAPageComposite {
                rightForm = new SashForm(leftForm, SWT.VERTICAL);
 
                // index 1 : INFO_INDEX
-               DATimelineTabComposite tabView = new DATimelineTabComposite(rightForm,
-                               SWT.NONE);
+//             DATimelineTabComposite tabView = new DATimelineTabComposite(rightForm,
+//                             SWT.NONE);
+               DATabComposite tabView = new DATabComposite(rightForm,SWT.NONE);
                addView(tabView);
                {
                        SnapshotView currentView = new SnapshotView(
index 42a3e15..82a8b58 100644 (file)
@@ -45,7 +45,6 @@ import org.tizen.dynamicanalyzer.ui.userinterface.scene.UITransformListView;
 import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
 
 public class UIPage extends DAPageComposite {
-
        SashForm baseForm;
        SashForm upperForm;
        SashForm bottomForm;
@@ -75,7 +74,7 @@ public class UIPage extends DAPageComposite {
                                SWT.NONE);
                addView(topLeftSencond);
 
-               DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE, TAB_ID);
+               DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE);
                addView(tabView);
                {
                        SnapshotView currentView = new SnapshotView(
index 13b632a..067fd1b 100644 (file)
@@ -69,7 +69,7 @@ public class DATabComposite extends DAView {
 
        private int tabWidth = LONG_TAB_WIDTH;
 
-       public DATabComposite(Composite parent, int style, String ID) {
+       public DATabComposite(Composite parent, int style) {
                super(parent, style);
                childrenMap = new HashMap<String, Composite>();
                buttonMap = new HashMap<String, DACustomButton>();
index 8e3b6c6..887152f 100644 (file)
@@ -40,13 +40,18 @@ import org.eclipse.swt.graphics.ImageData;
 
 public class ImageUtil {
 
-       public static void resize(String origFile, String newFile, int width,
+       public static void resize(String originFilePath, String newFilePath, int width,
+                       int height) {
+               resize(originFilePath, newFilePath, width, height, null);
+       }
+
+       public static void resize(String originFilePath, String newFilePath, int width,
                        int height, Color color) {
                BufferedImage bufferedImage = null;
                BufferedImage targetBufferedImage = null;
 
-               File image = new File(origFile);
-               File destImage = new File(newFile);
+               File image = new File(originFilePath);
+               File destImage = new File(newFilePath);
 
                try {
                        bufferedImage = ImageIO.read(image);
@@ -59,15 +64,17 @@ public class ImageUtil {
                        Image scaledImage = bufferedImage.getScaledInstance(width, height,
                                        Image.SCALE_DEFAULT);
 
-                       targetBufferedImage = new BufferedImage(width, width,
+                       targetBufferedImage = new BufferedImage(width, height,
                                        BufferedImage.TYPE_INT_RGB);
                        Graphics g = targetBufferedImage.getGraphics();
                        g.drawImage(scaledImage, 0, 0, null);
-                       g.setColor(color);
-                       g.drawLine(0, 0, 0, 49);
-                       g.drawLine(0, 0, 49, 0);
-                       g.drawLine(49, 0, 49, 49);
-                       g.drawLine(0, 49, 49, 49);
+                       if (null != color) {
+                               g.setColor(color);
+                               g.drawLine(0, 0, 0, 49);
+                               g.drawLine(0, 0, 49, 0);
+                               g.drawLine(49, 0, 49, 49);
+                               g.drawLine(0, 49, 49, 49);
+                       }
                        g.dispose();
 
                        ImageIO.write(targetBufferedImage, "PNG", destImage); //$NON-NLS-1$