}
});
- if (boardStyle == BOARD_STYLE_TIME) {
- interval = DATimelineTimeRenderer.DEFAULT_INTERVAL;
- timeline = new DATimeline(this, true);
- timelineTooltip = new DefaultToolTip(timeline);
- timelineTooltip.deactivate();
- timeline.addMouseTrackListener(timelineMouseTrackAdapter);
-
- lifecycleBar = new LifecycleBar(this);
- lifecycleBarTooltip = new DefaultToolTip(lifecycleBar);
- lifecycleBarTooltip.deactivate();
- lifecycleBar.addMouseTrackListener(timelineMouseTrackAdapter);
- } else if(boardStyle == BOARD_STYLE_FRAME) {
+ if (boardStyle == BOARD_STYLE_FRAME) {
interval = DATimelineFrameRenderer.DEFAULT_INTERVAL;
timeline = new DATimeline(this, false);
timeline.setRenderer(new DATimelineFrameRenderer());
} else {
- interval = DATimelineFrameRenderer.DEFAULT_INTERVAL;
+ interval = DATimelineTimeRenderer.DEFAULT_INTERVAL;
timeline = new DATimeline(this, true);
timelineTooltip = new DefaultToolTip(timeline);
timelineTooltip.deactivate();
timeline.addMouseTrackListener(timelineMouseTrackAdapter);
- timeline.setRenderer(new DATimelineTinyTimeRenderer());
-
+
lifecycleBar = new LifecycleBar(this);
lifecycleBarTooltip = new DefaultToolTip(lifecycleBar);
lifecycleBarTooltip.deactivate();
lifecycleBar.addMouseTrackListener(timelineMouseTrackAdapter);
+
+ if (boardStyle == BOARD_STYLE_KERNEL) {
+ timeline.setRenderer(new DATimelineTinyTimeRenderer());
+ }
}
-
+
this.addListener(SWT.Resize, resizeListener);
scale = new DAScale(this, 4, SWT.NONE);
markers = null;
}
}
-
+
public double getVisibleStartTime() {
return boardManager.getVisibleStartTime();
}
protected void callBackScrollChanged() {
}
-
+
protected void callBackSizeChanged() {
}
}
public final static int TYPE_TABLE_WARNING = 0x0008;\r
public final static int TYPE_TABLE_NORMAL = 0x0010;\r
public final static int TYPE_TABLE_CALLTRACE = 0x0020;\r
+ public final static int TYPE_TABLE_CONTEXTSWITCH = 0x0040;\r
+ public final static int TYPE_TABLE_FUNCTIONFRAGMENT = 0x0080;\r
\r
public final static String CALLSTACK_KEY_PID = "pid";//$NON-NLS-1$\r
public final static String CALLSTACK_KEY_ADDR = "address";//$NON-NLS-1$\r
Logs logs = logPack.getLogs(logId);
if (null != logs) {
List<LogData> newLogs = new ArrayList<LogData>();
- newLogs.addAll(logs.getLogs());
+ newLogs.addAll(logs.getRawLogs());
SqlManager.getInstance().insert(logId, newLogs);
}
if (null != logs
&& logId == DataChannelConstants.MSG_FUNCTION_EXIT) {
List<LogData> newLogs = new ArrayList<LogData>();
- newLogs.addAll(logs.getLogs());
+ newLogs.addAll(logs.getRawLogs());
SqlManager.getInstance().updateProfileTable(newLogs);
}
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
}
String preQueryOption = " limit " + from + " " + to;//$NON-NLS-1$ //$NON-NLS-2$
- query = String.format("select %s %s from %s %s;",//$NON-NLS-1$
+ query = String.format("select %s %s from %s where %s;",//$NON-NLS-1$
preQueryOption, columns.toString(), tableName, queryOption);
semaphoreAcquire();
logs = new Logs(id);
logMap.put(id, logs);
}
- logs.getLogs().add(input);
+ logs.getRawLogs().add(input);
}
public void setLogs(int id, Logs logs) {
if (null == base) {
logMap.put(id, logs);
} else {
- base.getLogs().addAll(logs.getLogs());
+ base.getRawLogs().addAll(logs.getRawLogs());
}
}
}
logList.addAll(logMap.values());
int count = 0;
for (Logs logs : logList) {
- count += logs.getLogs().size();
+ count += logs.getRawLogs().size();
}
return count;
}
}
// getLogs -> getRawLogs
- public List<LogData> getLogs() {
+ public List<LogData> getRawLogs() {
if (null == logs) {
logs = new ArrayList<LogData>();
}
}
// cloneLogs -> getLogs
- public List<LogData> getCloneLogs() {
+ public List<LogData> getLogs() {
List<LogData> newLogs = new ArrayList<LogData>();
int size = logs.size();
for (int i = 0; i < size; i++) {
-// LogData newLog = logs.get(i).getClone();
+ // LogData newLog = logs.get(i).getClone();
LogData newLog = logs.get(i);
newLogs.add(newLog);
}
return newLogs;
}
+
+ public List<LogData> getCloneLogs() {
+ List<LogData> newLogs = new ArrayList<LogData>();
+ int size = logs.size();
+ for (int i = 0; i < size; i++) {
+ LogData newLog = null;
+ try {
+ newLog = logs.get(i).clone();
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ newLog = logs.get(i);
+ }
+
+ newLogs.add(newLog);
+ }
+ return newLogs;
+ }
}
}
+ public ContextSwitchData clone() throws CloneNotSupportedException {
+ ContextSwitchData log = (ContextSwitchData) super.clone();
+ log.pcAddr = this.pcAddr;
+ log.pid = this.pid;
+ log.tid = this.tid;
+ log.cpuNum = this.cpuNum;
+ log.contextSeqSelf = this.contextSeqSelf;
+
+ return log;
+ }
+
public void makeData(byte[] data) {
super.makeData(data);
index = MessageParser.MSG_HEADER_SIZE;
import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
-public abstract class LogData {
+public abstract class LogData implements Cloneable {
public static boolean isSWAP = false;
public static int STATE_COUNT = 4;
public LogData() {
}
+ public LogData clone() throws CloneNotSupportedException {
+ LogData log = (LogData) super.clone();
+ log.index = this.index;
+ log.id = this.id;
+ log.seq = this.seq;
+ log.time = this.time;
+ log.libName = this.libName;
+
+ return log;
+ }
+
public void makeData(byte[] data) {
isSWAP = DACommunicator.isSWAPVersion();
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jaewon Lim <jaewon81.lim@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
package org.tizen.dynamicanalyzer.swap.model.data;\r
\r
import java.util.Comparator;\r
public ProbeCommonData() {
}
+
+ public ProbeCommonData clone() throws CloneNotSupportedException {
+ ProbeCommonData log = (ProbeCommonData) super.clone();
+ log.apiId = this.apiId;
+ log.pid = this.pid;
+ log.tid = this.tid;
+ log.args = this.args;
+ log.ret = this.ret;
+ log.errno = this.errno;
+ log.internalCall = this.internalCall;
+ log.callerAddress = this.callerAddress;
+ log.reserved1 = this.reserved1;
+ log.reserved2 = this.reserved2;
+
+ return log;
+ }
@Override
public void makeData(byte[] data) {
public ProfileData() {
}
+ public ProfileData clone() throws CloneNotSupportedException {
+ ProfileData log = (ProfileData) super.clone();
+ log.pcAddr = this.pcAddr;
+ log.callerPcAddr = this.callerPcAddr;
+ log.probeType = this.probeType;
+ log.probeSubType = this.probeSubType;
+ log.pid = this.pid;
+ log.tid = this.tid;
+ log.cpuNum = this.cpuNum;
+ log.args = this.args;
+ log.ret = this.ret;
+ log.apiName = this.apiName;
+
+ log.buildType = this.buildType;
+ log.binaryPath = this.binaryPath;
+ log.callstack = this.callstack;
+
+ return log;
+ }
+
public void makeData(byte[] data) {
super.makeData(data);
switch (id) {
} else {
libName = binInfo.getTargetBinaryPath();
}
-// System.out.println("plib name : " + libName);
+ // System.out.println("plib name : " + libName);
}
}
@Override
public void updateLog(LogPackage logPack) {
Logs logs = logPack.getLogs(DataChannelConstants.MSG_PROBE_FILE);
- if (null == logs || logs.getLogs().size() == 0) {
+ if (null == logs || logs.getRawLogs().size() == 0) {
return;
}
- List<LogData> inputs = logs.getCloneLogs();
+ List<LogData> inputs = logs.getLogs();
FileChartManager.getInstance().getLogListQueue().putLog(inputs);
}
if (currentPage.getViewName().equals(pageName)
&& !latestButton.isButtonEnabled()) {
Logs logs = logPack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM);
- if (null == logs || null == logs.getLogs()
- || logs.getLogs().isEmpty()) {
+ if (null == logs || null == logs.getRawLogs()
+ || logs.getRawLogs().isEmpty()) {
return;
}
- List<LogData> inputs = logs.getLogs();
+ List<LogData> inputs = logs.getRawLogs();
int lastIndex = inputs.size() - 1;
SystemData input = (SystemData) inputs.get(lastIndex);
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.ui.common.SetRangeMarkerMouseMoveListener;
import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
-import org.tizen.dynamicanalyzer.ui.kernel.data.KernelDataPerThread;
+import org.tizen.dynamicanalyzer.ui.kernel.data.KernelSelectionData;
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
ImageResources.TIMELINE_DROPDOWN_PUSH,
ImageResources.TIMELINE_DROPDOWN_NORMAL);
callflowCombo.add(KernelPageLabels.CALL_FLOW_CHART_TITLE);
- callflowCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER);
+ callflowCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_LEFT);
callflowCombo.select(0);
callflowCombo.setEnabled(false);
callflowCombo.setComboRender(new TitleComboRenderer());
Object odata = selData.getData();
long selectionStartTime, selectionEndTime;
- if (!(odata instanceof KernelDataPerThread)) {
+ if (!(odata instanceof KernelSelectionData)) {
selectionStartTime = selData.getStartTime();
selectionEndTime = selData.getEndTime();
.getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
intervalMarker.setInterval(startTime, endTime);
} else {
- KernelDataPerThread sdata = (KernelDataPerThread) odata;
- callflowChart.setSelectedData(sdata);
+ KernelSelectionData sdata = (KernelSelectionData) odata;
+ callflowChart.setSelectedData(sdata.getData());
callflowChart.updateChart();
}
}
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
import org.tizen.dynamicanalyzer.ui.kernel.data.KernelDataMaker;
import org.tizen.dynamicanalyzer.ui.kernel.data.KernelDataPerThread;
import org.tizen.dynamicanalyzer.ui.kernel.data.KernelDataPerThreadComparator;
+import org.tizen.dynamicanalyzer.ui.kernel.data.KernelSelectionData;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
public class ContextSwitchingChart extends DAChartBoard {
+ public static final String KERNEL_CHART_DATA_TYPE = "kernel_data_type";
+
private final KernelDataMaker dataMaker = KernelDataMaker.getInstance();
public ContextSwitchingChart(Composite parent, String title) {
ColorResources.BLUE);
coreChart.addSeries(coreSeries);
- coreItem.setData(kdata);
+ coreItem.setData(new KernelSelectionData(kdata,
+ KernelSelectionData.KERNEL_DATA_TYPE_CONTEXTSWITCH));
kdata.setContextChart(coreItem);
} else {
// delete previous drawing items
ColorResources.RED);
functionChart.addSeries(functionSeries);
- functionItem.setData(kdata);
+ functionItem.setData(new KernelSelectionData(kdata,
+ KernelSelectionData.KERNEL_DATA_TYPE_FUNCTIONCALL));
kdata.setFunctionChart(functionItem);
} else if (bitem != null) {
// delete previous drawing items
for (int i = 0; i < listsize; i++) {
DAChartBoardItem item = itemList.get(i);
- KernelDataPerThread gdata = (KernelDataPerThread) item.getData();
+ KernelDataPerThread gdata = ((KernelSelectionData) item.getData())
+ .getData();
sortedmap.put(gdata, i);
}
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
ImageResources.TIMELINE_DROPDOWN_NORMAL);
contextCombo.add(KernelPageLabels.CONTEXT_SWITCH_CHART_TITLE);
contextCombo.select(0);
- contextCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER);
+ contextCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_LEFT);
contextCombo.setEnabled(false);
contextCombo.setComboRender(new TitleComboRenderer());
contextCombo.setComboPopupRender(new TitleComboPopupRenderer());
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.model.TableInput;
import org.tizen.dynamicanalyzer.sql.DBTableManager;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.ui.kernel.data.KernelDataMaker;
import org.tizen.dynamicanalyzer.ui.kernel.data.KernelDataPerThread;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DAWindowingTableComposite;
+import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
public class KernelListTable extends DAWindowingTableComposite {
private KernelDataPerThread selectedData = null;
return;
}
int size = ti.length;
- LogData startData = ((DATableDataFormat) ti[0].getData())
- .getLogData();
- LogData endData = ((DATableDataFormat) ti[size - 1].getData())
- .getLogData();
- long startTime = startData.getTime();
- long endTime = endData.getTime();
+ List<String> startData = ((DATableDataFormat) ti[0].getData())
+ .getData();
+ List<String> endData = ((DATableDataFormat) ti[size - 1]
+ .getData()).getData();
+ long startTime = Long.parseLong(startData.get(timeColumnIndex));
+ long endTime = Long.parseLong(endData.get(timeColumnIndex));
DASelectionData data = new DASelectionData(KernelListView.ID,
startTime, endTime, ti, table);
protected List<TableInput> makeTableInput() {
List<TableInput> input = new ArrayList<TableInput>();
List<List<String>> queriedData = getQueriedStringData();
- if (queriedData != null)
- ;
+ if (queriedData == null) {
+ return null;
+ }
int size = queriedData.size();
for (int i = 0; i < size; i++) {
-
+ List<String> row = queriedData.get(i);
List<String> text = new ArrayList<String>();
+ int seqnum;
+ long starttime, endtime, exectime;
+ if (isCoreSelected) {
+ seqnum = Integer.parseInt(row
+ .get(KernelDataMaker.CONTEXT_DATA_COLUMN_INDEX_SEQ));
+ starttime = Long
+ .parseLong(row
+ .get(KernelDataMaker.CONTEXT_DATA_COLUMN_INDEX_STARTTIME));
+ endtime = Long
+ .parseLong(row
+ .get(KernelDataMaker.CONTEXT_DATA_COLUMN_INDEX_ENDTIME));
+ exectime = endtime - starttime;
+ text.add(row.get(KernelDataMaker.CONTEXT_DATA_COLUMN_INDEX_SEQ));
+ text.add(row.get(KernelDataMaker.CONTEXT_DATA_COLUMN_INDEX_PID));
+ text.add(row.get(KernelDataMaker.CONTEXT_DATA_COLUMN_INDEX_TID));
+ text.add(row.get(KernelDataMaker.CONTEXT_DATA_COLUMN_INDEX_CPU));
+ text.add(Formatter.toTimeFormat(starttime));
+ text.add(Formatter.toTimeFormat(endtime));
+ text.add(Formatter.toTimeFormat(exectime));
+ text.add(row
+ .get(KernelDataMaker.CONTEXT_DATA_COLUMN_INDEX_STARTADDR));
+ text.add(row
+ .get(KernelDataMaker.CONTEXT_DATA_COLUMN_INDEX_ENDADDR));
+ text.add("");
+ } else {
+ seqnum = Integer.parseInt(row
+ .get(KernelDataMaker.FUNCTION_DATA_COLUMN_INDEX_SEQ));
+ starttime = Long
+ .parseLong(row
+ .get(KernelDataMaker.FUNCTION_DATA_COLUMN_INDEX_STARTTIME));
+ endtime = Long
+ .parseLong(row
+ .get(KernelDataMaker.FUNCTION_DATA_COLUMN_INDEX_ENDTIME));
+ exectime = endtime - starttime;
+ text.add(row
+ .get(KernelDataMaker.FUNCTION_DATA_COLUMN_INDEX_SEQ));
+ text.add(row
+ .get(KernelDataMaker.FUNCTION_DATA_COLUMN_INDEX_PID));
+ text.add(row
+ .get(KernelDataMaker.FUNCTION_DATA_COLUMN_INDEX_TID));
+ text.add(row
+ .get(KernelDataMaker.FUNCTION_DATA_COLUMN_INDEX_CPU));
+ text.add(Formatter.toTimeFormat(starttime));
+ text.add(Formatter.toTimeFormat(endtime));
+ text.add(Formatter.toTimeFormat(exectime));
+ text.add(row
+ .get(KernelDataMaker.FUNCTION_DATA_COLUMN_INDEX_STARTADDR));
+ text.add(row
+ .get(KernelDataMaker.FUNCTION_DATA_COLUMN_INDEX_ENDADDR));
+ text.add(row
+ .get(KernelDataMaker.FUNCTION_DATA_COLUMN_INDEX_FUNCNAME));
+ }
+
+ // create DATableDataFormat
+ DATableDataFormat tableData = new DATableDataFormat(seqnum);
+ tableData.getData().addAll(row);
+ if (isCoreSelected) {
+ tableData.setType(AnalyzerConstants.TYPE_TABLE_CONTEXTSWITCH);
+ } else {
+ tableData
+ .setType(AnalyzerConstants.TYPE_TABLE_FUNCTIONFRAGMENT);
+ }
+
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ tableInput.setData(tableData);
+ input.add(tableInput);
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+ long analysisStartTime = RangeDataManager.getInstance()
+ .getAnalysisStartTime();
+ long analysisEndTime = RangeDataManager.getInstance()
+ .getAnalysisEndTime();
+ if (starttime <= analysisEndTime
+ && endtime >= analysisStartTime) {
+ tableInput.setInRange(true);
+ }
+ }
}
-
- return null;
+
+ return input;
}
@Override
protected int getItemCountByPid() {
- return 0;
+ if (selectedData == null) {
+ return 0;
+ }
+
+ int itemCount = 0;
+ int selectedPid = ToolbarArea.getInstance().getSelectedPid();
+ if (selectedPid == 0 || selectedData.getPid() == selectedPid) {
+ if (isCoreSelected) {
+ itemCount = selectedData.getCoreFragmentCount();
+ } else {
+ itemCount = selectedData.getFuncFragmentCount();
+ }
+ }
+
+ return itemCount;
}
@Override
protected List<String> getDBTableColumnNames() {
- return null;
+ List<String> columnName = new ArrayList<String>();
+ columnName.add("*");
+ return columnName;
}
@Override
@Override
protected String getSelectQueryOption() {
+ String never_option = DBTableManager.COMMON_COLUMN_TID + " = -1";
+
if (selectedData == null) {
- return null;
+ return never_option;
}
- String option = "where " + DBTableManager.COMMON_COLUMN_TID + " = "
- + selectedData.getTid() + " order by "
- + DBTableManager.CUSTOM_COLUMN_START_TIME;
- return option;
+ int selectedPid = ToolbarArea.getInstance().getSelectedPid();
+ if (selectedPid == 0 || selectedData.getPid() == selectedPid) {
+ String option = DBTableManager.COMMON_COLUMN_TID + " = "
+ + selectedData.getTid() + " order by "
+ + DBTableManager.CUSTOM_COLUMN_START_TIME;
+
+ return option;
+ } else {
+ return never_option;
+ }
}
@Override
protected String getSelectQueryCountOption() {
+ String never_option = DBTableManager.COMMON_COLUMN_TID + " = -1";
+
if (selectedData == null) {
- return null;
+ return never_option;
}
-
- return null;
+ int selectedPid = ToolbarArea.getInstance().getSelectedPid();
+ if (selectedPid == 0 || selectedData.getPid() == selectedPid) {
+ String option = DBTableManager.COMMON_COLUMN_TID + " = "
+ + selectedData.getTid();
+
+ return option;
+ } else {
+ return never_option;
+ }
}
public void setSelectedData(KernelDataPerThread kdata, boolean isCore) {
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.KernelPageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.kernel.data.KernelSelectionData;
import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
import org.tizen.dynamicanalyzer.ui.widgets.table.WindowingTableColumnSizePackListener;
public class KernelListView extends DAView {
public static final String ID = KernelListView.class.getName();
- private long analysisStartTime = 0;
- private long analysisEndTime = 0;
-
int[] innerMaxWeight = { 0, 100 };
int[] outerMaxWeight = { 100, 0 };
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
tableComp = new KernelListTable(contents, SWT.NONE, SWT.MULTI
- | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL);
tableComp.setSortTypes(sortTypes);
tableComp.setColumnAlignment(columnAlignment);
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility_function);
+ tableComp.setTableToolTipEnable(false);
contents.addControlListener(new WindowingTableColumnSizePackListener(
tableComp, columnSizes));
}
public void updateView(DASelectionData selData) {
long start = selData.getStartTime();
long end = selData.getEndTime();
-
- updateView();
+ Object data = selData.getData();
+
+ if (data instanceof KernelSelectionData) {
+ KernelSelectionData sdata = (KernelSelectionData) data;
+ boolean isCore = (sdata.getType() == KernelSelectionData.KERNEL_DATA_TYPE_CONTEXTSWITCH);
+ tableComp.setSelectedData(sdata.getData(), isCore);
+ if(isCore) {
+ tableComp.setColumnVisibility(columnVisibility_core);
+ } else {
+ tableComp.setColumnVisibility(columnVisibility_function);
+ }
+ tableComp.updateTable();
+ }
+
((KernelListTable) tableComp).setSelectionByTime(start, end);
- updateView();
+ tableComp.updateTable();
}
@Override
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
name = AnalyzerLabels.COOLBAR_AREA_KERNEL;
this.setData(DAPageComposite.KEY_TOOLTIP,
- ShortCutManager.COOLBAR_AREA_NETWORK_TOOLTIP);
+ ShortCutManager.COOLBAR_AREA_KERNEL_TOOLTIP);
this.setLayout(new FillLayout());
baseForm = new SashForm(this, SWT.HORIZONTAL);
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
*\r
* Contact: \r
- * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Jaewon Lim <jaewon81.lim@samsung.com>\r
* Juyoung Kim <j0.kim@samsung.com>\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
*\r
* Contact: \r
- * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Jaewon Lim <jaewon81.lim@samsung.com>\r
* Juyoung Kim <j0.kim@samsung.com>\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
*\r
* Contact: \r
- * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Jaewon Lim <jaewon81.lim@samsung.com>\r
* Juyoung Kim <j0.kim@samsung.com>\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
int size = inputs.size();
for (int i = 0; i < size; i++) {
LogData input = (LogData) inputs.get(i);
-
+
switch (input.getId()) {
case DataChannelConstants.MSG_CONTEXT_SWITCH_EXIT: {
ContextSwitchData csdata = (ContextSwitchData) input;
int tid = csdata.getTid();
-
+
KernelDataPerThread kdata = findKernelData(tid);
if (kdata == null) { // thread id is not exist in thread id
kdata = new KernelDataPerThread(csdata.getPid(), tid,
ContextSwitchData csdata = (ContextSwitchData) input;
ContextSwitchData precore;
int tid = csdata.getTid();
-
+
KernelDataPerThread kdata = findKernelData(tid);
if (kdata == null) { // thread id is not exist
// TODO : error
break;
}
case DataChannelConstants.MSG_FUNCTION_ENTRY: {
- ProfileData fndata = (ProfileData) input;
+ ProfileData fndata = null;
+ try {
+ fndata = (ProfileData) input.clone();
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ break;
+ }
int tid = fndata.getTid();
KernelDataPerThread kdata = findKernelData(tid);
functionDataList.add(dbfuncdata);
kdata.incFuncFragmentCount();
- prefunc.peek().setTime(fndata.getTime());
- prefunc.peek().setPcAddr(fndata.getPcAddr());
- prefunc_type.set(prefunc_type.size() - 1,
- START_TYPE_RETURNED);
+ if (!prefunc.isEmpty() && !prefunc_type.isEmpty()) {
+ prefunc.peek().setTime(fndata.getTime());
+ prefunc.peek().setPcAddr(fndata.getPcAddr());
+ prefunc_type.set(prefunc_type.size() - 1,
+ START_TYPE_RETURNED);
+ }
}
}
break;
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
List<LogData> contextEntryLogList = null, contextExitLogList = null, functionEntryLogList = null, functionExitLogList = null;
Iterator<LogData> centryiter = null, cexititer = null, fentryiter = null, fexititer = null;
if (contextEntryLogs != null) {
- contextEntryLogList = contextEntryLogs.getCloneLogs();
+ contextEntryLogList = contextEntryLogs.getLogs();
centryiter = contextEntryLogList.iterator();
if (centryiter.hasNext())
pqueue.offer(centryiter.next());
}
if (contextExitLogs != null) {
- contextExitLogList = contextExitLogs.getCloneLogs();
+ contextExitLogList = contextExitLogs.getLogs();
cexititer = contextExitLogList.iterator();
if (cexititer.hasNext())
pqueue.offer(cexititer.next());
}
if (functionEntryLogs != null) {
- functionEntryLogList = functionEntryLogs.getCloneLogs();
+ functionEntryLogList = functionEntryLogs.getLogs();
fentryiter = functionEntryLogList.iterator();
if (fentryiter.hasNext())
pqueue.offer(fentryiter.next());
}
if (functionExitLogs != null) {
- functionExitLogList = functionExitLogs.getCloneLogs();
+ functionExitLogList = functionExitLogs.getLogs();
fexititer = functionExitLogList.iterator();
if (fexititer.hasNext())
pqueue.offer(fexititer.next());
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Jaewon Lim <jaewon81.lim@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.kernel.data;
+
+public class KernelSelectionData {
+ public static final int KERNEL_DATA_TYPE_NONE = 0;
+ public static final int KERNEL_DATA_TYPE_CONTEXTSWITCH = 1;
+ public static final int KERNEL_DATA_TYPE_FUNCTIONCALL = 2;
+
+ private KernelDataPerThread kernelData = null;
+ private int dataType = KERNEL_DATA_TYPE_NONE;
+
+ public KernelSelectionData(KernelDataPerThread data, int type) {
+ this.kernelData = data;
+ this.dataType = type;
+ }
+
+ public KernelDataPerThread getData() {
+ return kernelData;
+ }
+
+ public int getType() {
+ return dataType;
+ }
+}
@Override
public void updateLog(LogPackage logPack) {
Logs logs = logPack.getLogs(DataChannelConstants.MSG_PROBE_NETWORK);
- if (null == logs || logs.getLogs().size() == 0) {
+ if (null == logs || logs.getRawLogs().size() == 0) {
return;
}
- List<LogData> inputs = logs.getCloneLogs();
+ List<LogData> inputs = logs.getLogs();
NetworkChartManager.getInstance().getLogListQueue().putLog(inputs);
}
@Override
public void updateLog(LogPackage logPack) {
Logs glesLogs = logPack.getLogs(DataChannelConstants.MSG_PROBE_GLES20);
- if (glesLogs == null || glesLogs.getLogs().size() == 0) {
+ if (glesLogs == null || glesLogs.getRawLogs().size() == 0) {
return;
}
- List<LogData> logDataList = glesLogs.getLogs();
+ List<LogData> logDataList = glesLogs.getRawLogs();
for (LogData logData : logDataList) {
glDataMaker.addGLAPIData((GLES20LogData) logData);
return;
}
- List<LogData> logDataList = logs.getLogs();
+ List<LogData> logDataList = logs.getRawLogs();
for (LogData logData : logDataList) {
int index = (int) (logData.getTime() / TimelineConstants.MEGA_LONG);
int size = glDataMaker.getFrameCountInfoListSize();
Logs logs = logPack.getLogs(DataChannelConstants.LOG_USER_FUNCTION);
if (null != logs) {
if (DACommunicator.isSWAPVersion()) {
- List<LogData> profileData = logs.getLogs();
+ List<LogData> profileData = logs.getRawLogs();
int size = profileData.size();
for (int i = 0; i < size; i++) {
ProfileData input = (ProfileData) profileData.get(i);
logs = logPack.getLogs(DataChannelConstants.MSG_PROBE_FILE);
if (null != logs) {
- List<LogData> resourceInputs = logs.getLogs();
+ List<LogData> resourceInputs = logs.getRawLogs();
/* make file failed data and warning data */
// fileDataMaker.makeData(resourceInputs);
/* resource leak check */
logs = logPack.getLogs(DataChannelConstants.MSG_PROBE_MEMORY);
if (null != logs) {
- List<LogData> memoryInputs = logs.getLogs();
+ List<LogData> memoryInputs = logs.getRawLogs();
/* memory leak check */
int size = memoryInputs.size();
for (int i = 0; i < size; i++) {
@Override
public void updateLog(LogPackage logPack) {
Logs logs = logPack.getLogs(DataChannelConstants.MSG_DATA_SAMPLE);
- if (null == logs || logs.getLogs().size() == 0) {
+ if (null == logs || logs.getRawLogs().size() == 0) {
return;
}
- List<LogData> inputs = logs.getCloneLogs();
+ List<LogData> inputs = logs.getLogs();
FunctionUsageProfiler.getInstance().pushSample(inputs);
}
}
private List<LogData> getLogsFromLogPackage(LogPackage logPack,
int logCenterConstants) {
Logs logs = logPack.getLogs(logCenterConstants);
- if (null == logs || logs.getLogs().size() == 0) {
+ if (null == logs || logs.getRawLogs().size() == 0) {
return null;
}
- List<LogData> ret = logs.getCloneLogs();
+ List<LogData> ret = logs.getLogs();
return ret;
}
public List<LogData> getLogsFromLogPackage(LogPackage logPack,
int logCenterConstants) {
Logs logs = logPack.getLogs(logCenterConstants);
- if (null == logs || null == logs.getLogs() || logs.getLogs().isEmpty()) {
+ if (null == logs || null == logs.getRawLogs() || logs.getRawLogs().isEmpty()) {
return null;
}
- List<LogData> ret = logs.getLogs();
+ List<LogData> ret = logs.getRawLogs();
return ret;
}
public List<LogData> getLogsFromLogPackage(LogPackage logPack,
int logCenterConstants) {
Logs logs = logPack.getLogs(logCenterConstants);
- if (null == logs || logs.getLogs().size() == 0) {
+ if (null == logs || logs.getRawLogs().size() == 0) {
return null;
}
- List<LogData> ret = logs.getLogs();
+ List<LogData> ret = logs.getRawLogs();
return ret;
}
return;
}
- List<LogData> logDataList = logs.getLogs();
+ List<LogData> logDataList = logs.getRawLogs();
for (LogData logData : logDataList) {
parseLog((SystemData) logData);
return;
}
- List<LogData> logDataList = logs.getLogs();
+ List<LogData> logDataList = logs.getRawLogs();
for (LogData logData : logDataList) {
parseLog((SystemData) logData);
return;
}
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData logData : logList) {
parseLog((SystemData)logData);
}
return;
}
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData logData : logList) {
parseLog((SystemData) logData);
}
return;
}
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData logData : logList) {
parseLog((SystemData) logData);
return;
}
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData log : logList) {
double time = log.getTime();
Logs deviceLogs = logPack.getLogs(probeType);
List<LogData> memoryLogList = memoryLogs == null ? null : memoryLogs
- .getLogs();
+ .getRawLogs();
List<LogData> deviceLogList = deviceLogs == null ? null : deviceLogs
- .getLogs();
+ .getRawLogs();
parseLog(memoryLogList, deviceLogList);
}
return;
}
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData logData : logList) {
parseLog((SystemData) logData);
return;
}
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData logData : logList) {
parseLog((SystemData)logData);
return;
}
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData logData : logList) {
parseLog((ScreenShotData)logData);
return;
}
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData logData : logList) {
parseLog((SystemData)logData);
return;
}
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData logData : logList) {
parseLog((UIEventData)logData);
return;
}
- List<LogData> logDataList = logs.getLogs();
+ List<LogData> logDataList = logs.getRawLogs();
if (logDataList.size() <= 0) {
return;
}
Logs deviceLogs = logPack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM);
- if (deviceLogs != null && !deviceLogs.getLogs().isEmpty()) {
+ if (deviceLogs != null && !deviceLogs.getRawLogs().isEmpty()) {
deviceLogParser.parseLogPackage(logPack);
}
Logs memoryLogs = logPack
.getLogs(DataChannelConstants.MSG_PROBE_MEMORY);
- if (memoryLogs != null && !memoryLogs.getLogs().isEmpty()) {
+ if (memoryLogs != null && !memoryLogs.getRawLogs().isEmpty()) {
HeapChart.getInstance().parseLogPackage(logPack);
}
Logs recorderLogs = logPack
.getLogs(DataChannelConstants.MSG_PROBE_UIEVENT);
- if (recorderLogs != null && !recorderLogs.getLogs().isEmpty()) {
+ if (recorderLogs != null && !recorderLogs.getRawLogs().isEmpty()) {
UIEventChart.getInstance().parseLogPackage(logPack);
}
Logs customLogs = logPack
.getLogs(DataChannelConstants.MSG_PROBE_CUSTOM);
- if (customLogs != null && !customLogs.getLogs().isEmpty()) {
+ if (customLogs != null && !customLogs.getRawLogs().isEmpty()) {
customLogParser.parseLogPackage(logPack);
}
Logs lifecycleLogs = logPack
.getLogs(DataChannelConstants.MSG_PROBE_LIFECYCLE);
- if (lifecycleLogs != null && !lifecycleLogs.getLogs().isEmpty()) {
+ if (lifecycleLogs != null && !lifecycleLogs.getRawLogs().isEmpty()) {
lifecycleLogParser.parseLogPackage(logPack);
}
Logs screenShotLogs = logPack
.getLogs(DataChannelConstants.MSG_PROBE_SCREENSHOT);
- if (screenShotLogs != null && !screenShotLogs.getLogs().isEmpty()) {
+ if (screenShotLogs != null && !screenShotLogs.getRawLogs().isEmpty()) {
ScreenshotChart.getInstance().parseLogPackage(logPack);
}
}
public void parseLogPackage(LogPackage logPack) {
Logs logs = logPack.getLogs(DataChannelConstants.MSG_PROBE_CUSTOM);
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData log : logList) {
parseLog((CustomData) log);
public void parseLogPackage(LogPackage logPack) {
Logs deviceLogs = logPack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM);
- if (deviceLogs != null && deviceLogs.getLogs() != null
- && deviceLogs.getLogs().size() > 0) {
+ if (deviceLogs != null && deviceLogs.getRawLogs() != null
+ && deviceLogs.getRawLogs().size() > 0) {
List<TimelineChart> chartList = timelineChartManager.getChartList();
for (TimelineChart chart : chartList) {
if (chart.getProbeType() == DataChannelConstants.MSG_DATA_SYSTEM) {
return;
}
- List<LogData> logList = logs.getLogs();
+ List<LogData> logList = logs.getRawLogs();
for (LogData log : logList) {
parseLog((LifeCycleData) log);
public void setControlDataTFromLogPackage(LogPackage logPack) {
Logs logs = logPack.getLogs(DataChannelConstants.MSG_PROBE_UICONTROL);
- if (null == logs || logs.getLogs() == null
- || logs.getLogs().size() == 0) {
+ if (null == logs || logs.getRawLogs() == null
+ || logs.getRawLogs().size() == 0) {
return;
}
- List<LogData> inputs = logs.getCloneLogs();
+ List<LogData> inputs = logs.getLogs();
getLogListQueue().putLog(inputs);
}
public void setSceneTransformDataTFromLogPackage(LogPackage logPack) {
Logs logs = logPack.getLogs(DataChannelConstants.MSG_PROBE_SCENE);
- if (null == logs || logs.getLogs() == null
- || logs.getLogs().size() == 0) {
+ if (null == logs || logs.getRawLogs() == null
+ || logs.getRawLogs().size() == 0) {
return;
}
- List<LogData> inputs = logs.getCloneLogs();
+ List<LogData> inputs = logs.getLogs();
getLogListQueue().putLog(inputs);
}