[Title] fix column of thread API, ui function profiling, function usage profiling...
authorwoojin <woojin2.jung@samsung.com>
Fri, 1 Nov 2013 21:37:53 +0000 (06:37 +0900)
committerwoojin <woojin2.jung@samsung.com>
Fri, 1 Nov 2013 21:37:53 +0000 (06:37 +0900)
[Desc.] 1. thread API : ordering, column size change 2. ui function profiling, function usage profiling : elapsed time format change
[Issue]

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ProfilingTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadAPIListTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadAPIListView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/profiling/UIFunctionProfilingDataChecker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/Formatter.java

index b38dfa3..f95604f 100644 (file)
@@ -249,14 +249,14 @@ public class ProfilingTable extends DATreeComposite {
                        if (0 == input.getExclusiveElapsedTime()) {
                                exeTime = CommonConstants.DASH;
                        } else {
-                               exeTime = Formatter.toTimeFormat(input
+                               exeTime = Formatter.toTimeFormat4(input
                                                .getExclusiveElapsedTime());
                        }
 
                        if (0 == input.getElapsedTime()) {
                                inExeTime = CommonConstants.DASH;
                        } else {
-                               inExeTime = Formatter.toTimeFormat(input.getElapsedTime());
+                               inExeTime = Formatter.toTimeFormat4(input.getElapsedTime());
                        }
                } catch (NumberFormatException e) {
                        // FIXME
index 728e5c3..b309e09 100644 (file)
@@ -127,15 +127,15 @@ public class ThreadAPIListTable extends DAApiListTableComposite {
                        contentText.add(Integer.toString(contentTemp.getPid()));
                        contentData.add(Integer.toString(contentTemp.getPid()));
                        
+                       contentText.add(Long.toString(contentTemp.getTid()));
+                       contentData.add(Long.toString(contentTemp.getTid()));
+                       
                        contentText.add(contentTemp.getApiName());
                        contentData.add(contentTemp.getApiName());
                        
                        contentText.add(contentTemp.getArgs());
                        contentData.add(contentTemp.getArgs());
                        
-                       contentText.add(Long.toString(contentTemp.getTid()));
-                       contentData.add(Long.toString(contentTemp.getTid()));
-                       
                        contentText.add(contentTemp.getHexReturn());
                        contentData.add(Long.toString(contentTemp.getReturn()));
                        
index df1e977..b391ce8 100644 (file)
@@ -54,13 +54,13 @@ public class ThreadAPIListView extends DAView {
                        ThreadPageLabels.THREAD_API_LIST_VIEW_INDEX,
                        ThreadPageLabels.THREAD_API_LIST_VIEW_TIME,
                        ThreadPageLabels.THREAD_API_LIST_VIEW_PID,
+                       ThreadPageLabels.THREAD_API_LIST_VIEW_THREAD_ID,
                        ThreadPageLabels.THREAD_API_LIST_VIEW_NAME,
                        ThreadPageLabels.THREAD_API_LIST_VIEW_PARAMETER,
-                       ThreadPageLabels.THREAD_API_LIST_VIEW_THREAD_ID,
-                       ThreadPageLabels.THREAD_API_LIST_VIEW_RETURN,
+                                               ThreadPageLabels.THREAD_API_LIST_VIEW_RETURN,
                        ThreadPageLabels.THREAD_API_LIST_VIEW_ERRNO };
 
-       private int[] columnSizes = { 35, 70,70, 120, 250, 70, 100, 100 };
+       private int[] columnSizes = { 35, 70, 45, 45, 180, 240, 75, 100 };
 
        private int[] columnAlignment = { SWT.RIGHT, SWT.LEFT,SWT.LEFT, SWT.LEFT, SWT.LEFT,
                        SWT.LEFT, SWT.LEFT, SWT.LEFT };
@@ -68,10 +68,10 @@ public class ThreadAPIListView extends DAView {
        int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
                        AnalyzerConstants.SORT_TYPE_NUM,
                        AnalyzerConstants.SORT_TYPE_NUM,
-                       AnalyzerConstants.SORT_TYPE_STRING,
-                       AnalyzerConstants.SORT_TYPE_STRING,
                        AnalyzerConstants.SORT_TYPE_NUM,
                        AnalyzerConstants.SORT_TYPE_STRING,
+                       AnalyzerConstants.SORT_TYPE_STRING,
+                                               AnalyzerConstants.SORT_TYPE_STRING,
                        AnalyzerConstants.SORT_TYPE_STRING };
 
 //     int[] sourceColumns = { LogCenterConstants.SEQUENCE_NUMBER_INDEX,
index 578378a..43f7826 100644 (file)
@@ -93,10 +93,10 @@ public class UIFunctionProfilingDataChecker {
                                inAvgTime = getAvgTime(Integer.parseInt(inTime),
                                                input.getCallCount(), 2);
                                inTime = Formatter.toTimeFormat2(inTime);
-                               exeTime = Formatter.toTimeFormat(input.getElapsedTime());
+                               exeTime = Formatter.toTimeFormat4(input.getElapsedTime());
                                exeAvgTime = getAvgTime(input.getElapsedTime(),
                                                input.getCallCount(), 1);
-                               inExeTime = Formatter.toTimeFormat(input
+                               inExeTime = Formatter.toTimeFormat4(input
                                                .getExclusiveElapsedTime());
                                inExeAvgTime = getAvgTime(input.getExclusiveElapsedTime(),
                                                input.getCallCount(), 1);
@@ -192,7 +192,7 @@ public class UIFunctionProfilingDataChecker {
                        time = (nTime / nCount);
                }
                if (nType == 1) {
-                       strRetrun = Formatter.toTimeFormat(time);
+                       strRetrun = Formatter.toTimeFormat4(time);
                } else {
                        strRetrun = Formatter.toTimeFormat2(time);
                }
index 92af11d..c896526 100644 (file)
@@ -196,7 +196,9 @@ public class Formatter {
                }
                long ms = longTime % 1000;
                longTime /= 1000;
-               long second = longTime % 60;
+//             second can exceed 60 because it's the biggest unit here (minute is not used)            
+//             long second = longTime % 60;
+               long second = longTime;         
 
                String strSecond = Long.toString(second);
                if (strSecond.length() < 2) {
@@ -234,6 +236,46 @@ public class Formatter {
                return output;
        }
 
+       public static String toTimeFormat4(Object time) {
+               long longTime = -1;
+               if (time instanceof Long || time instanceof Integer) {
+                       longTime = (Long) time;
+               } else if (time instanceof String) {
+                       longTime = Long.parseLong((String) time);
+               } else {
+                       return null;
+               }
+
+               longTime /= 1000;
+               long ms = longTime % 1000;
+               longTime /= 1000;
+//             second can exceed 60 because it's the biggest unit here (minute is not used)            
+//             long second = longTime % 60;
+               long second = longTime;
+//             longTime /= 60;
+//             long minute = longTime % 60;
+//             String strMinute = Long.toString(minute);
+//             if (strMinute.length() < 2) {
+//                     strMinute = "0" + strMinute; //$NON-NLS-1$
+//             }
+
+               String strSecond = Long.toString(second);
+               if (strSecond.length() < 2) {
+                       strSecond = "0" + strSecond; //$NON-NLS-1$
+               }
+
+               String strMs = Long.toString(ms);
+               if (strMs.length() == 2) {
+                       strMs = "0" + strMs; //$NON-NLS-1$
+               } else if (strMs.length() == 1) {
+                       strMs = "00" + strMs; //$NON-NLS-1$
+               }
+
+//             String output = strMinute + ":" + strSecond + "." + strMs; //$NON-NLS-1$ //$NON-NLS-2$
+               String output = strSecond + "." + strMs; //$NON-NLS-1$ //$NON-NLS-2$            
+               return output;
+       }
+       
        public static String toPercentageFormat(Double input) {
                String ret = String.format("%.2f", input); //$NON-NLS-1$
                ret += " %"; //$NON-NLS-1$