package org.tizen.dynamicanalyzer.ui.timeline.calltrace;
-import org.eclipse.nebula.widgets.grid.Grid;
+import java.util.List;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.swap.logparser.Logs;
+import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
+import org.tizen.dynamicanalyzer.swap.model.data.UserFunctionData;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DAWindowingTableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class CallTraceView extends DAView {
public static final String ID = CallTraceView.class.getName();
- private DAWindowingTableComposite tableComp;
+ private DATableComposite tableComp;
private String[] columnNames = { TimelinePageLabels.CALL_TRACE_VIEW_TIME,
TimelinePageLabels.CALL_TRACE_VIEW_TID,
setMaxWeight(innerMaxWeight, outerMaxWeight);
}
- // @Override
- // public void updateView(DASelectionData selData) {
- // long start = selData.getStartTime();
- // long end = selData.getEndTime();
- // updateView();
- // ((CallTraceTable) tableComp).setSelectionByTime(start, end);
- // updateView();
- // /* only callstack update */
- // // timeline view and tabcomp top view : callstack
- // if (selData.getViewId().equals(TimelineView.ID)) {
- // DATabComposite tabView = (DATabComposite) AnalyzerUtil.getView(
- // TimelinePage.ID, DATabComposite.ID);
- // Composite comp = tabView.getTopComposite();
- // if (comp instanceof CallstackView) {
- // ((CallstackView) comp).updateView();
- // }
- // }
- // }
-
@Override
public void updateView(DASelectionData selData) {
long start = selData.getStartTime();
long end = selData.getEndTime();
-
- int selectionIndex = SqlManager.getInstance().getSelectionIndex(
- tableComp, start);
- int selectionCount = SqlManager.getInstance().getSelectionItemCount(
- tableComp, start, end);
-
- selectionIndex = ((selectionIndex < 0) && (selectionCount > 0)) ? 0
- : selectionIndex;
- tableComp.getTable().getVerticalBar().setSelection(selectionIndex);
updateView();
-
- Grid table = tableComp.getTable();
- if (selectionIndex >= 0) {
- if (selectionCount > 0) {
- int selections[] = new int[selectionCount];
- for (int i = 0; i < selectionCount; i++) {
- selections[i] = selectionIndex + i;
- }
- table.setSelection(selections);
- } else {
- int selections[] = new int[0];
- table.setSelection(selections);
- int itemCount = table.getItemCount();
- if (selectionIndex >= itemCount) {
- selectionIndex = itemCount - 1;
- }
- table.setSelection(selectionIndex);
- }
- }
+ ((CallTraceTable) tableComp).setSelectionByTime(start, end);
+ updateView();
/* only callstack update */
// timeline view and tabcomp top view : callstack
if (selData.getViewId().equals(TimelineView.ID)) {
}
}
+// @Override
+// public void updateView(DASelectionData selData) {
+// long start = selData.getStartTime();
+// long end = selData.getEndTime();
+//
+// int selectionIndex = SqlManager.getInstance().getSelectionIndex(
+// tableComp, start);
+// int selectionCount = SqlManager.getInstance().getSelectionItemCount(
+// tableComp, start, end);
+//
+// selectionIndex = ((selectionIndex < 0) && (selectionCount > 0)) ? 0
+// : selectionIndex;
+// tableComp.getTable().getVerticalBar().setSelection(selectionIndex);
+// updateView();
+//
+// Grid table = tableComp.getTable();
+// if (selectionIndex >= 0) {
+// if (selectionCount > 0) {
+// int selections[] = new int[selectionCount];
+// for (int i = 0; i < selectionCount; i++) {
+// selections[i] = selectionIndex + i;
+// }
+// table.setSelection(selections);
+// } else {
+// int selections[] = new int[0];
+// table.setSelection(selections);
+// int itemCount = table.getItemCount();
+// if (selectionIndex >= itemCount) {
+// selectionIndex = itemCount - 1;
+// }
+// table.setSelection(selectionIndex);
+// }
+// }
+// /* only callstack update */
+// // timeline view and tabcomp top view : callstack
+// if (selData.getViewId().equals(TimelineView.ID)) {
+// DATabComposite tabView = (DATabComposite) AnalyzerUtil.getView(
+// TimelinePage.ID, DATabComposite.ID);
+// Composite comp = tabView.getTopComposite();
+// if (comp instanceof CallstackView) {
+// ((CallstackView) comp).updateView();
+// }
+// }
+// }
+
@Override
public void updateView() {
tableComp.updateTable();
@Override
public void clear() {
tableComp.getTable().removeAll();
- tableComp.clean();
}
@Override
@Override
public void updateLog(LogPackage logPack) {
- // Logs logs = logPack.getLogs(LogCenterConstants.LOG_USER_FUNCTION);
- // if (null == logs) {
- // logs = logPack.getLogs(DataChannelConstants.MSG_FUNCTION_ENTRY);
- // }
- // if (null == logs || null == logs.getLogs() ||
- // logs.getLogs().isEmpty()) {
- // return;
- // }
- // List<LogData> inputs = logs.getLogs();
- //
- // int size = inputs.size();
- // for (int i = 0; i < size; i++) {
- // if (logs.getId() == DataChannelConstants.MSG_FUNCTION_ENTRY) {
- // ProfileData pData = (ProfileData) inputs.get(i);
- // UserFunctionManager.getInstance().addLog(pData);
- // } else if (logs.getId() == LogCenterConstants.LOG_USER_FUNCTION) {
- // UserFunctionData input = (UserFunctionData) inputs.get(i);
- // int type = input.getType();
- // if (type == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER) {
- // UserFunctionManager.getInstance().addLog(input);
- // }
- // }
- //
- // }
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_USER_FUNCTION);
+ if (null == logs) {
+ logs = logPack.getLogs(DataChannelConstants.MSG_FUNCTION_ENTRY);
+ }
+ if (null == logs || null == logs.getLogs() || logs.getLogs().isEmpty()) {
+ return;
+ }
+ List<LogData> inputs = logs.getLogs();
+
+ int size = inputs.size();
+ for (int i = 0; i < size; i++) {
+ if (logs.getId() == DataChannelConstants.MSG_FUNCTION_ENTRY) {
+ ProfileData pData = (ProfileData) inputs.get(i);
+ UserFunctionManager.getInstance().addLog(pData);
+ } else if (logs.getId() == LogCenterConstants.LOG_USER_FUNCTION) {
+ UserFunctionData input = (UserFunctionData) inputs.get(i);
+ int type = input.getType();
+ if (type == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER) {
+ UserFunctionManager.getInstance().addLog(input);
+ }
+ }
+
+ }
}
}