From 21caedf17049da19450c5d0ba5d8e5e8563a8cee Mon Sep 17 00:00:00 2001 From: "phjwithyou.park" Date: Tue, 17 Jul 2012 16:48:35 +0900 Subject: [PATCH] =?utf8?q?[Title]=20Print=20Called=20Function=20On=20File?= =?utf8?q?=20Chart=20Except(=20Open,=20=E1=85=9FClose,=20Error=20)=20[Type?= =?utf8?q?]=20Feature=20[Module]=20File=20Page=20-=20File=20Chart=20[Prior?= =?utf8?q?ity]=20Normal=20[CQ#]=20[Redmine#]=205790=20[Problem]=20[Cause]?= =?utf8?q?=20[Solution]=20[TestCase]?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../org/tizen/dynamicanalyzer/AnalyzerManager.java | 11 +++++ .../dynamicanalyzer/model/FileChartItemData.java | 19 ++++++++ .../fileChart/DAFileChartCellRenderer.java | 27 +++++++++++ .../views/filePage/fileChart/FileChartManager.java | 53 ++++++++++++++++++++-- 4 files changed, 107 insertions(+), 3 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/AnalyzerManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/AnalyzerManager.java index 9a577e4..e9a1b0f 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/AnalyzerManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/AnalyzerManager.java @@ -74,6 +74,8 @@ public class AnalyzerManager { private static int imageListSize = 0; private static LeakDetector leakDetector = null; private static FailedChecker failedChecker = null; + private static FailedChecker calledChecker = null; + private static FunctionUsageProfiler functionUserProfiler = null; private static Thread stopLogProcessThread = null; private static Thread startStopThread = null; @@ -175,6 +177,7 @@ public class AnalyzerManager { leakDetector = null; failedChecker = null; + calledChecker = null; functionUserProfiler = null; StopLogProcessThread.count = 0; stopLogProcessThread = null; @@ -455,6 +458,14 @@ public class AnalyzerManager { } return failedChecker; } + + public static FailedChecker getCalledFunctionChecker() { + if (null == calledChecker) { + calledChecker = new FailedChecker(); + } + return calledChecker; + } + public static FunctionUsageProfiler getFunctionUserProfiler() { if (null == functionUserProfiler) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/FileChartItemData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/FileChartItemData.java index 572abdb..03b7fdd 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/FileChartItemData.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/FileChartItemData.java @@ -11,6 +11,7 @@ public class FileChartItemData { private List children = null; private List data = null; private List failedData = null; + private List calledFunctionData = null; private boolean closed = false; private String parentKey = null; @@ -89,6 +90,13 @@ public class FileChartItemData { return null; } + public List getCalledFunctionData() { + if (null == calledFunctionData) { + calledFunctionData = new ArrayList(); + } + return calledFunctionData; + } + public List getFailedData() { if (null == failedData) { failedData = new ArrayList(); @@ -179,6 +187,17 @@ public class FileChartItemData { return output; } + public List getCalledFunctionRelations() { + List output = new ArrayList(); + int size = getCalledFunctionData().size(); + for (int i = 0; i < size; i++) { + FailedData ffd = calledFunctionData.get(i); + String seq = ffd.getLogData(LogCenterConstants.SEQUENCE_NUMBER_INDEX); + output.add(seq); + } + return output; + } + public boolean isAllChildrenClosed() { if (!hasChild()) { return false; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/DAFileChartCellRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/DAFileChartCellRenderer.java index f38d2ce..8233026 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/DAFileChartCellRenderer.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/DAFileChartCellRenderer.java @@ -299,6 +299,33 @@ public class DAFileChartCellRenderer extends DefaultCellRenderer { failedRect.width, failedRect.height, true); } } + + List fileCalledFunctionList = data.getCalledFunctionData(); + size = fileCalledFunctionList.size(); + startTime = start; + x = rect.x + FileChartManager.FILE_CHART_START_MARGIN; + y = (rect.y + 7); + for (int i = 0; i < size; i++) { + int fx = x; + int fy = y; + int fWidth = 1; + int height = rect.height - 14; + + FailedData ffd = fileCalledFunctionList.get(i); + long time = Long.parseLong(ffd.getLogData(LogCenterConstants.TIME_INDEX)); + + if (startTime < time && time < end) { + fx += AnalyzerUtil.getWidth(time - startTime); + + System.out.print("fx["+fx+"] fy ["+fy+"] cWidth["+fWidth+"] height ["+height+"]\n"); + + Rectangle failedRect = new Rectangle(fx, fy, fWidth, height); + gc.setForeground(ColorResources.ITEM_BLUE_BRIGHT); + gc.setBackground(ColorResources.ITEM_BLUE_DARK); + gc.fillGradientRectangle(failedRect.x, failedRect.y,failedRect.width, failedRect.height, true); + } + } + } private int getToggleIndent(GridItem item) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/FileChartManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/FileChartManager.java index 3e59421..802dbe1 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/FileChartManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/filePage/fileChart/FileChartManager.java @@ -305,6 +305,32 @@ public class FileChartManager { // read / write } else if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_READ) || fdApiType.equals(LogCenterConstants.FD_API_TYPE_WRITE)) { + + + // Print Called Function On File Chart Except( Open, ᅟClose, Error ) + FailedData ffd = new FailedData(input); + FileChartItemData fcid = getFDRegister().get(fd); + if (null == fcid) { + System.out.print("ERROR - parentFailed 1\n"); + ffd = null; + continue; + } + path = fcid.getParentKey(); + if (path.isEmpty()) { + System.out.print("ERROR - parentFailed 2\n"); + System.out.println(); + } + fcid.getCalledFunctionData().add(ffd); + + FileChartItemData parentCalled = getFileRegister().get(path); + if (null == parentCalled) { + System.out.print("ERROR - parentFailed 3\n"); + parentCalled = createNewFileData(path); + } + parentCalled.getCalledFunctionData().add(ffd); + AnalyzerManager.getCalledFunctionChecker().getFailedList().add(ffd); + + long time = Long.parseLong(input .get(LogCenterConstants.TIME_INDEX)); FileChartItemData child = getFDRegister().get(fd); @@ -350,9 +376,30 @@ public class FileChartManager { System.out.println("why"); //$NON-NLS-1$ e.printStackTrace(); } - } else if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_OTHERS)) { - // FIXME : - // System.out.println("file util api later added...."); + } else{ + // Print Called Function On File Chart Except( Open, ᅟClose, Error ) + FailedData ffd = new FailedData(input); + FileChartItemData fcid = getFDRegister().get(fd); + if (null == fcid) { + System.out.print("ERROR - parentFailed 1\n"); + ffd = null; + continue; + } + path = fcid.getParentKey(); + if (path.isEmpty()) { + System.out.print("ERROR - parentFailed 2\n"); + System.out.println(); + } + fcid.getCalledFunctionData().add(ffd); + + FileChartItemData parentCalled = getFileRegister().get(path); + if (null == parentCalled) { + System.out.print("ERROR - parentFailed 3\n"); + parentCalled = createNewFileData(path); + } + parentCalled.getCalledFunctionData().add(ffd); + AnalyzerManager.getCalledFunctionChecker().getFailedList().add(ffd); + } } -- 2.7.4