public static String GL_STATE_PROGRAM_VIEW_VERTEX_SHADER;
public static String GL_STATE_PROGRAM_VIEW_FRAGMENT_SHADER;
-
public static String GL_TEXTURE_VIEW_TITLE;
public static String GL_TEXTURE_VIEW_CONTEXT_NAME;
public static String GL_TEXTURE_VIEW_CONTEXT_ID;
public static String GL_TEXTURE_VIEW_CONTEXT_MIN_FILTER;
public static String GL_TEXTURE_VIEW_CONTEXT_MAG_FILTER;
+ public static String GL_STATISTICS_TITLE;
+ public static String GL_STATISTICS_VIEW_API_NAME;
+ public static String GL_STATISTICS_VIEW_RATE;
+ public static String GL_STATISTICS_VIEW_COUNT;
+ public static String GL_STATISTICS_VIEW_API_TYPE;
+
+ public static String GL_REDUNDANT_TITLE;
+ public static String GL_REDUNDANT_VIEW_COUNT;
+ public static String GL_REDUNDANT_VIEW_ELAPSED_TIME;
+ public static String GL_REDUNDANT_VIEW_API_NAME;
+ public static String GL_REDUNDANT_VIEW_PARAMETER;
+
+
static {
NLS.initializeMessages(BUNDLE_NAME, GLPageLabels.class);
}
GL_API_LIST_VIEW_NAME=API
GL_API_LIST_VIEW_PARAMETER=Parameter
GL_API_LIST_VIEW_RETURN=Return
-GL_API_LIST_VIEW_ELAPSED_TIME=Elapsed time
+GL_API_LIST_VIEW_ELAPSED_TIME=Elapsed time(\u03BCs)
GL_API_LIST_VIEW_ERROR=Error
GL_API_LIST_VIEW_PID=PID
GL_API_LIST_VIEW_TID=TID
GL_TEXTURE_VIEW_CONTEXT_WRAP_S=WRAP_S
GL_TEXTURE_VIEW_CONTEXT_WRAP_T=WRAP_T
GL_TEXTURE_VIEW_CONTEXT_MIN_FILTER=MIN_FILTER
-GL_TEXTURE_VIEW_CONTEXT_MAG_FILTER=MAG_FILTER
\ No newline at end of file
+GL_TEXTURE_VIEW_CONTEXT_MAG_FILTER=MAG_FILTER
+
+GL_STATISTICS_TITLE = Statistics
+GL_STATISTICS_VIEW_API_NAME=API name
+GL_STATISTICS_VIEW_RATE=Rate
+GL_STATISTICS_VIEW_COUNT=Count
+GL_STATISTICS_VIEW_API_TYPE=API type
+
+GL_REDUNDANT_TITLE=Redundant
+GL_REDUNDANT_VIEW_COUNT= count
+GL_REDUNDANT_VIEW_ELAPSED_TIME=Elapsed time(\u03BCs)
+GL_REDUNDANT_VIEW_API_NAME=API Name
+GL_REDUNDANT_VIEW_PARAMETER=Parameter
|| viewId.equals(GLPage.contextViewID)
|| viewId.equals(GLPage.contextHistoryID)
|| viewId.equals(GLPage.programViewID)
+ || viewId.equals(GLPage.statisticsViewID)
+ || viewId.equals(GLPage.redundantViewID)
|| viewId.equals(UIPage.profilingViewID)
|| viewId.equals(RangePage.profilingViewID)
|| viewId.equals(SummaryPage.profilingViewID)) {
import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData;
import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPINameDefine;
-import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLES20ErrorDefine;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLCurrentFrameDataManger;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLES20ErrorDefine;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateShaderType;
+import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLRedundantTableView;
+import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLStatisticsTableView;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.utils.DownloadContentfileManager;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
}
@Override
+ public void updateView() {
+ }
+
+ @Override
public void updateView(DAViewData vdata) {
if (vdata instanceof GLSelectionData) {
GLSelectionData data = (GLSelectionData) vdata;
updateContextTableInfo(data);
} else if (id.equals(GLPage.programViewID)) {
updateProgramTableInfo(data);
+ } else if (id.equals(GLPage.redundantViewID)) {
+ updateRedundantTableInfo(data);
+ } else if (id.equals(GLPage.statisticsViewID)) {
+ updateStatisticsTableInfo(data);
}
}
}
- @Override
- public void updateView() {
- }
-
private void updateChartInfo(GLSelectionData data) {
int frameIndex = data.getFrameTimeIndex();
GLCurrentFrameDataManger glFrameData = GLDataManager.getInstance()
GridItem[] gridItems = (GridItem[]) data.getData();
DATableDataFormat tableDataFormat = (DATableDataFormat) gridItems[0].getData();
GLES20LogData logData = (GLES20LogData) tableDataFormat.getLogData();
+ detailText.setText(getDetailInfoOfAPI(logData.getApiName(), logData.getErrno(),
+ logData.getArgs()));
+ }
+
+ private void updateRedundantTableInfo(GLSelectionData data) {
+ GridItem[] gridItems = (GridItem[]) data.getData();
+ DATableDataFormat tableDataFormat = (DATableDataFormat) gridItems[0].getData();
+ detailText
+ .setText(getDetailInfoOfAPI(
+ (String) tableDataFormat.getData().get(
+ GLRedundantTableView.API_NAME_TABLE_INDEX),
+ 0,
+ (String) tableDataFormat.getData().get(
+ GLRedundantTableView.PARAMETER_TABLE_INDEX)));
+ }
+
+ private void updateStatisticsTableInfo(GLSelectionData data) {
+ GridItem[] gridItems = (GridItem[]) data.getData();
+ DATableDataFormat tableDataFormat = (DATableDataFormat) gridItems[0].getData();
+ StringBuffer strDetailView = new StringBuffer();
+ strDetailView.append(CommonConstants.NEW_LINE);
+ strDetailView.append(leftFormAttachment
+ + (String) tableDataFormat.getData()
+ .get(GLStatisticsTableView.API_NAME_TABLE_INDEX) + heightFormAttachment);
+ strDetailView.append(leftFormAttachment
+ + (String) tableDataFormat.getData()
+ .get(GLStatisticsTableView.API_TYPE_TABLE_INDEX) + heightFormAttachment);
+ detailText.setText(strDetailView.toString());
+ }
+ private String getDetailInfoOfAPI(String apiName, long error, String args) {
StringBuffer strDetailView = new StringBuffer();
- String apiName = logData.getApiName();
strDetailView.append(CommonConstants.NEW_LINE);
strDetailView.append(leftFormAttachment + apiName + heightFormAttachment);
- long error = logData.getErrno();
if (error == 0) {
strDetailView.append(leftFormAttachment
+ GLES20ErrorDefine.getErrorDescription(String.valueOf(error))
+ getErrorDescription(apiName, GLES20ErrorDefine.getError(error))
+ heightFormAttachment);
}
-
if (uniformDataMaker.isUniformAPI(apiName)) {
- String uniformValue = uniformDataMaker.getUniformData(apiName, logData.getArgs());
- if(null != uniformValue){
+ String uniformValue = uniformDataMaker.getUniformData(apiName, args);
+ if (null != uniformValue) {
strDetailView.append(leftFormAttachment + PROGRAM_PUNCTUATION + "uniform value"
+ heightFormAttachment);
- strDetailView.append(uniformDataMaker.getUniformData(apiName, logData.getArgs()));
+ strDetailView.append(uniformDataMaker.getUniformData(apiName, args));
}
}
- detailText.setText(strDetailView.toString());
+ return strDetailView.toString();
}
private void updateContextTableInfo(GLSelectionData data) {
import org.tizen.dynamicanalyzer.ui.opengl.table.api.GLAPIListView;
import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLContextTableView;
import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLProgramTableView;
+import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLRedundantTableView;
+import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLStatisticsTableView;
import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLTextureTableView;
import org.tizen.dynamicanalyzer.ui.page.ScreenshotTabComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
public static final String chartViewID = GLChartView.class.getName();
public static final String apiListViewID = GLAPIListView.class.getName();
public static final String detailViewID = GLDetailsView.class.getName();
-
- public static final String stateTabID = "GLStateTablID.id";//$NON-NLS-1$
- public static final String contextViewID = GLContextTableView.class
- .getName();
+ public static final String leftTabID = "GLLeftTablID.id";//$NON-NLS-1$
+ public static final String rigthTabID = "GLRightTablID.id";//$NON-NLS-1$
+ public static final String contextViewID = GLContextTableView.class.getName();
public static final String contextHistoryID = "contextHistoryID.id"; //$NON-NLS-1$
-
- public static final String programViewID = GLProgramTableView.class
- .getName();
-
- public static final String textureViewID = GLTextureTableView.class
- .getName();
+ public static final String programViewID = GLProgramTableView.class.getName();
+ public static final String textureViewID = GLTextureTableView.class.getName();
+ public static final String statisticsViewID = GLStatisticsTableView.class.getName();
+ public static final String redundantViewID = GLRedundantTableView.class.getName();
SashForm baseForm;
SashForm rightForm;
GLContextTableView glContextView;
GLProgramTableView glProgramView;
GLTextureTableView glTextureView;
+ GLStatisticsTableView glStatisticsView;
+ GLRedundantTableView glRedundantView;
public GLPage(Composite parent, int style) {
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_OPENGLES);
- this.setData(DAPageComposite.KEY_TOOLTIP,
- ShortCutManager.COOLBAR_AREA_GRAPHICS_TOOLTIP);
+ this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_GRAPHICS_TOOLTIP);
this.setLayout(new FillLayout());
-
baseForm = new SashForm(this, SWT.HORIZONTAL);
-
leftForm = new SashForm(baseForm, SWT.VERTICAL);
glChartView = new GLChartView(leftForm, SWT.NONE);
addView(glChartView);
-
bottomForm = new SashForm(leftForm, SWT.HORIZONTAL);
+ DATabComposite glLeftTabView = new DATabComposite(bottomForm, SWT.NONE, false);
+ {
+ glStatisticsView = new GLStatisticsTableView(glLeftTabView.getContentComposite(),
+ SWT.NONE);
+ addView(glStatisticsView);
+ glLeftTabView.addView(glStatisticsView, false);
+
+ glAPIListView = new GLAPIListView(glLeftTabView.getContentComposite(), SWT.NONE);
+ addView(glAPIListView);
+ glLeftTabView.addView(glAPIListView, false);
+ }
- glAPIListView = new GLAPIListView(bottomForm, SWT.NONE);
- addView(glAPIListView);
-
- DATabComposite glStateTabView = new DATabComposite(bottomForm,
- SWT.NONE, false);
- addView(stateTabID, glStateTabView);
+ DATabComposite glRightTabView = new DATabComposite(bottomForm, SWT.NONE, false);
{
- glContextView = new GLContextTableView(
- glStateTabView.getContentComposite(), SWT.NONE);
+ glRedundantView = new GLRedundantTableView(glRightTabView.getContentComposite(),
+ SWT.NONE);
+ addView(glRedundantView);
+ glRightTabView.addView(glRedundantView, false);
+
+ glContextView = new GLContextTableView(glRightTabView.getContentComposite(), SWT.NONE);
addView(glContextView);
- glStateTabView.addView(glContextView, false);
+ glRightTabView.addView(glContextView, false);
- glProgramView = new GLProgramTableView(
- glStateTabView.getContentComposite(), SWT.NONE);
+ glProgramView = new GLProgramTableView(glRightTabView.getContentComposite(), SWT.NONE);
addView(glProgramView);
- glStateTabView.addView(glProgramView, false);
+ glRightTabView.addView(glProgramView, false);
- glTextureView = new GLTextureTableView(
- glStateTabView.getContentComposite(), SWT.NONE);
+ glTextureView = new GLTextureTableView(glRightTabView.getContentComposite(), SWT.NONE);
addView(glTextureView);
- glStateTabView.addView(glTextureView, false);
+ glRightTabView.addView(glTextureView, false);
}
leftForm.setWeights(new int[] { 30, 70 });
bottomForm.setWeights(new int[] { 50, 50 });
-
rightForm = new SashForm(baseForm, SWT.VERTICAL);
- ScreenshotTabComposite tabView = new ScreenshotTabComposite(rightForm,
- SWT.NONE, GLPage.pageID);
+ ScreenshotTabComposite tabView = new ScreenshotTabComposite(rightForm, SWT.NONE,
+ GLPage.pageID);
tabView.setObservingViews(ScreenshotTabComposite.screenshotViewID,
new String[] { GLPage.apiListViewID });
tabView.setObservingViews(ScreenshotTabComposite.callstackViewID,
rightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- DataManagerRegistry
- .registerPageDataManager(GLDataManager.getInstance());
+ DataManagerRegistry.registerPageDataManager(GLDataManager.getInstance());
}
@Override
} else {
frameRateChartBoard.updateView();
}
-
}
@Override
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@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.opengl.data.DB;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.DALimit;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.database.DBColumn;
+import org.tizen.dynamicanalyzer.database.DBConstants;
+import org.tizen.dynamicanalyzer.database.DBTable;
+import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLRedundantDataType;
+
+public class GLRedundantDBTableManager extends DBTable {
+ private static final String TABLE_NAME = "GL_REDUNDANT";//$NON-NLS-1$
+ public static final String CALL_COUNT = "CALL_COUNT";//$NON-NLS-1$
+ public static final String ELAPSED_TIME = "ELAPSED_TIME";//$NON-NLS-1$
+ public static final String API_ID = "API_ID";//$NON-NLS-1$
+ public static final String ARGUMENT = "PARAMETER";//$NON-NLS-1$
+
+ public final static int TABLE_CALL_COUNT_INDEX = 0;
+ public final static int TABLE_ELAPSED_TIME_INDEX = 1;
+ public final static int TABLE_API_ID_INDEX = 2;
+ public final static int TABLE_ARGUMENT_INDEX = 3;
+
+ private static final String SELECT_QUERY = "select "//$NON-NLS-1$
+ + CALL_COUNT + CommonConstants.COMMA + ELAPSED_TIME + CommonConstants.COMMA
+ + API_ID
+ + CommonConstants.COMMA + ARGUMENT + " from " + TABLE_NAME;//$NON-NLS-1$
+
+ @Override
+ public String getTableName() {
+ return TABLE_NAME;
+ }
+
+ public GLRedundantDBTableManager() {
+ addColumn(new DBColumn(CALL_COUNT, DBConstants.NOT_NULL, DBConstants.INTEGER));
+ addColumn(new DBColumn(ELAPSED_TIME, DBConstants.NOT_NULL, DBConstants.DBTYPE_LONG));
+ addColumn(new DBColumn(API_ID, DBConstants.NOT_NULL, DBConstants.INTEGER));
+ addColumn(new DBColumn(ARGUMENT, DBConstants.NOT_NULL, "VARCHAR("
+ + DALimit.FUNCTION_ARGUMENTS_VALUE_LENGTH + ")"));//$NON-NLS-1$
+ }
+
+ public void insertRedundantData(List<GLRedundantDataType> data) {
+ List<List<Object>> insertList = new ArrayList<List<Object>>();
+ for (GLRedundantDataType rowData : data) {
+ List<Object> objectList = new ArrayList<Object>();
+ objectList.add(rowData.getCallCount());
+ objectList.add(rowData.getElapsedTime());
+ objectList.add(rowData.getApiID());
+ objectList.add(rowData.getArgs());
+ insertList.add(objectList);
+ }
+ insertData(insertList);
+ }
+
+ public List<GLRedundantDataType> select() {
+ List<List<Object>> result = SqlConnectionManager.executeQuery(SELECT_QUERY);
+ if (null == result || result.size() == 0 || result.get(0).size() == 0) {
+ return null;
+ }
+ List<GLRedundantDataType> textureList = new ArrayList<GLRedundantDataType>();
+ for (int i = 0; i < result.size(); i++) {
+ int callCount = (Integer) result.get(i).get(TABLE_CALL_COUNT_INDEX);
+ long elapsedTime = (Long) result.get(i).get(TABLE_ELAPSED_TIME_INDEX);
+ int apiID = (Integer) result.get(i).get(TABLE_API_ID_INDEX);
+ String parameter = (String) result.get(i).get(TABLE_ARGUMENT_INDEX);
+ GLRedundantDataType data = new GLRedundantDataType(apiID, parameter, callCount,
+ elapsedTime);
+ data.setCallCount(callCount);
+ textureList.add(data);
+ }
+ return textureList;
+ }
+
+ @Override
+ public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+ boolean isPrepared = true;
+
+ int columnsize = getColumnSize();
+ if (columnsize != rowData.size()) {
+ isPrepared = false;
+ } else {
+ try {
+ prep.setLong(TABLE_CALL_COUNT_INDEX + 1,
+ (Integer) (rowData.get(TABLE_CALL_COUNT_INDEX)));
+ prep.setDouble(TABLE_ELAPSED_TIME_INDEX + 1,
+ (Long) (rowData.get(TABLE_ELAPSED_TIME_INDEX)));
+ prep.setInt(TABLE_API_ID_INDEX + 1, (Integer) (rowData.get(TABLE_API_ID_INDEX)));
+ prep.setString(TABLE_ARGUMENT_INDEX + 1,
+ (String) (rowData.get(TABLE_ARGUMENT_INDEX)));
+ } catch (SQLException e) {
+ e.printStackTrace();
+ isPrepared = false;
+ }
+ }
+ return isPrepared;
+ }
+
+}
import java.util.List;
import java.util.Map;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
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.ui.opengl.GLUtil;
import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLAPIDBTableManager;
+import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLCommonStateDBTableManager;
import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLFrameRateDBTableManager;
import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLFrameTimeDBTableManager;
-import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLCommonStateDBTableManager;
+import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLRedundantDBTableManager;
import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLStateHistoryDBTableManager;
import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLStateProgramDBTableManager;
import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLStateSharingDBTableManager;
import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLStateTextureDBTableManager;
-import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLFrameRateInfo;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPIData;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLCurrentFrameDataManger;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLES20ErrorDefine;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLFrameRateInfo;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSharingContextType;
import org.tizen.dynamicanalyzer.ui.summary.SummaryDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
private static GLDataManager instance = null;
private GLStateDataManager stateDataManager = null;
+ private GLStatisticsDataManager statisticsDataManger = null;
private List<GLFrameRateInfo> frameRateDataList = null;
private List<GLSharingContextType> sharingContextList = null;
private int startFrameRateTime = 1;
protected int currentFrameIndex = 1;
private boolean isSelectFrameRateChart = true;
private long apiTimeOfPreFrameIndex = 0;
+ private String selectedAPIAtTable = CommonConstants.EMPTY;
private GLAPIDBTableManager apiDBTable = null;
private GLFrameRateDBTableManager frameRateDBTable = null;
private GLStateHistoryDBTableManager stateHistoryDBTable = null;
private GLStateTextureDBTableManager stateTextureDBTable = null;
private GLStateSharingDBTableManager stateSharingDBTable = null;
+ private GLRedundantDBTableManager redundantDBTable = null;
public static GLDataManager getInstance() {
if (instance == null) {
stateHistoryDBTable = new GLStateHistoryDBTableManager();
stateTextureDBTable = new GLStateTextureDBTableManager();
stateSharingDBTable = new GLStateSharingDBTableManager();
+ statisticsDataManger = new GLStatisticsDataManager();
+ setRedundantDBTable(new GLRedundantDBTableManager());
}
public void clear() {
stateDataManager = new GLStateDataManager();
frameRateDataList = new ArrayList<GLFrameRateInfo>();
sharingContextList = new ArrayList<GLSharingContextType>();
+ statisticsDataManger = new GLStatisticsDataManager();
startFrameRateTime = 1;
selectedContextID = -1;
currentFrameIndex = 1;
isSelectFrameRateChart = true;
apiTimeOfPreFrameIndex = 0;
+ selectedAPIAtTable = CommonConstants.EMPTY;
}
public void saveData(Map<String, String> dataMap) {
if (null != stateDataManager) {
updateFrameTimeChartEndTimeAtOpen();
stateProgramDBTable.initProgramDataAtOpen();
+ stateTextureDBTable.initTextureDataAtOpen();
+ statisticsDataManger.selectRedundantData();
}
}
public void stopProcess() {
if (null != stateDataManager) {
stateProgramDBTable.insertProgramData();
+ stateTextureDBTable.insertTextureData();
+ statisticsDataManger.insertRedundantData();
}
}
-
+
@Override
protected void onThreadStop() {
stopProcess();
public void makeGLData(Logs glesLogs) {
addAPIDBData(glesLogs);
+ addAPIStatisticsData(glesLogs);
addFrameTimeChartDBData(glesLogs);
addFrameRateChartDBData(glesLogs);
addStateDBData(glesLogs);
apiDBTable.insert(insetAPIDataList);
}
+ private void addAPIStatisticsData(Logs glesLogs) {
+ for (LogData data : glesLogs.getRawLogs()) {
+ statisticsDataManger.addAPI((GLES20LogData) data);
+ }
+ }
+
private void addFrameTimeChartDBData(Logs glesLogs) {
int currentFrameIndexOfFrameTime = currentFrameIndex;
List<List<Object>> insetFrameTimeChartDataList = new ArrayList<List<Object>>();
GLCurrentFrameDataManger currentFrameData = new GLCurrentFrameDataManger();
for (LogData data : glesLogs.getRawLogs()) {
GLES20LogData logData = (GLES20LogData) data;
- currentFrameData.addAPIData(new GLAPIData(logData,
- currentFrameIndexOfFrameTime));
+ currentFrameData.addAPIData(new GLAPIData(logData, currentFrameIndexOfFrameTime));
if (GLUtil.isLastAPIOfFrame(logData.getApiName())) {
- makeFrameTimeData(insetFrameTimeChartDataList,
- currentFrameData, currentFrameIndexOfFrameTime,
- apiTimeOfPreFrameIndex, logData.getTime());
+ makeFrameTimeData(insetFrameTimeChartDataList, currentFrameData,
+ currentFrameIndexOfFrameTime, apiTimeOfPreFrameIndex, logData.getTime());
currentFrameIndexOfFrameTime++;
apiTimeOfPreFrameIndex = logData.getTime();
}
}
}
- private void makeFrameTimeData(
- List<List<Object>> insetFrameTimeChartDataList,
- GLCurrentFrameDataManger glCurrentFrameData,
- int currentFrameIndexOfFrameTime, long apiTimeOfPreFrameIndex,
- long apiTime) {
- long frameValue = (apiTime - apiTimeOfPreFrameIndex)
- / TimelineConstants.KILO_LONG;
+ private void makeFrameTimeData(List<List<Object>> insetFrameTimeChartDataList,
+ GLCurrentFrameDataManger glCurrentFrameData, int currentFrameIndexOfFrameTime,
+ long apiTimeOfPreFrameIndex, long apiTime) {
+ long frameValue = (apiTime - apiTimeOfPreFrameIndex) / TimelineConstants.KILO_LONG;
List<Object> framTimeChartData = new ArrayList<Object>();
framTimeChartData.add(currentFrameIndexOfFrameTime);
- framTimeChartData.add(GLUtil.getTimeLineTime(glCurrentFrameData
- .getFirstLogData()));
+ framTimeChartData.add(GLUtil.getTimeLineTime(glCurrentFrameData.getFirstLogData()));
framTimeChartData.add((int) frameValue);
framTimeChartData.add(glCurrentFrameData.hasError());
framTimeChartData.add(glCurrentFrameData.getStartSeq());
return stateSharingDBTable;
}
+ public GLStatisticsDataManager getStatisticsDataManger() {
+ return statisticsDataManger;
+ }
+
public boolean isSelectFrameRateChart() {
return isSelectFrameRateChart;
}
this.startFrameRateTime = startFrameRateTime;
}
+ public String getSelectedAPIAtTable() {
+ return selectedAPIAtTable;
+ }
+
+ public void setSelectedAPIAtTable(String selectedAPIAtTable) {
+ this.selectedAPIAtTable = selectedAPIAtTable;
+ }
+
+ public GLRedundantDBTableManager getRedundantDBTable() {
+ return redundantDBTable;
+ }
+
+ public void setRedundantDBTable(GLRedundantDBTableManager redundantDBTable) {
+ this.redundantDBTable = redundantDBTable;
+ }
+
}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Sanghyun Lee <sanghyunnim.lee@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.opengl.data;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLRedundantDataType;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStatisticsDataType;
+import org.tizen.dynamicanalyzer.util.DALogger;
+
+public class GLStatisticsDataManager {
+ private static final String SPLIT = CommonConstants.SPACE + CommonConstants.CMD_SPLIT
+ + CommonConstants.SPACE;
+ private static final String STATE_CHANGE = "State Change";//$NON-NLS-1$
+ private static final String MATRIX = "Matrix";//$NON-NLS-1$
+ private static final String TEXTURE = "Texture";//$NON-NLS-1$
+ private static final String DRAW = "Draw";//$NON-NLS-1$
+ private static final String PROGRAM_AND_SHADER = "Program and Shader";//$NON-NLS-1$
+ private static final String BUFFER = "Buffer";//$NON-NLS-1$
+ private static final String GET = "Get";//$NON-NLS-1$
+ private static final String IS = "Is";//$NON-NLS-1$
+ private static final String DELETE = "Delete";//$NON-NLS-1$
+ private static final String BIND = "Bind";//$NON-NLS-1$
+ private static final String EVAS_GL = "evas_gl";//$NON-NLS-1$
+ private ConcurrentHashMap<String, GLRedundantDataType> redundantHsahMap = new ConcurrentHashMap<String, GLRedundantDataType>();
+ private double totalAPICount = 0;
+
+ public void addAPI(GLES20LogData logData) {
+ String hashKey = logData.getApiName() + logData.getArgs();
+ GLRedundantDataType savedHash = redundantHsahMap.get(hashKey);
+ if (null == savedHash) {
+ redundantHsahMap.put(
+ hashKey,
+ new GLRedundantDataType(logData.getApiId(), logData.getArgs(), 1, logData
+ .getElapsedTime()));
+ } else {
+ savedHash.addCallCount();
+ savedHash.addElapsedTime(logData.getElapsedTime());
+ }
+ totalAPICount++;
+ }
+
+ public void insertRedundantData() {
+ GLDataManager.getInstance().getRedundantDBTable()
+ .insertRedundantData(getRedundantTableData());
+ }
+
+ public void selectRedundantData() {
+ List<GLRedundantDataType> redundantList = GLDataManager.getInstance().getRedundantDBTable()
+ .select();
+ for (GLRedundantDataType data : redundantList) {
+ String hashKey = AnalyzerManager.getProject().getApiName(data.getApiID())
+ + data.getArgs();
+ GLRedundantDataType savedHash = redundantHsahMap.get(hashKey);
+ if (null == savedHash) {
+ redundantHsahMap.put(
+ hashKey,
+ new GLRedundantDataType(data.getApiID(), data.getArgs(), data
+ .getCallCount(), data.getElapsedTime()));
+ } else {
+ savedHash.setCallCount(savedHash.getCallCount() + data.getCallCount());
+ }
+ totalAPICount += data.getCallCount();
+ }
+ }
+
+ public List<GLRedundantDataType> getRedundantTableData() {
+ List<GLRedundantDataType> returnList = new ArrayList<GLRedundantDataType>();
+ for (Map.Entry<String, GLRedundantDataType> entry : redundantHsahMap.entrySet()) {
+ returnList.add(entry.getValue());
+ }
+ return returnList;
+ }
+
+ public List<GLStatisticsDataType> getStatisticsTableData() {
+ List<GLStatisticsDataType> returnList = new ArrayList<GLStatisticsDataType>();
+ LinkedHashMap<String, GLStatisticsDataType> statisticsHashMap = getStatisticDataFromRedundantHashMap();
+ for (Map.Entry<String, GLStatisticsDataType> entry : statisticsHashMap.entrySet()) {
+ returnList.add(entry.getValue());
+ }
+ return returnList;
+ }
+
+ private LinkedHashMap<String, GLStatisticsDataType> getStatisticDataFromRedundantHashMap() {
+ LinkedHashMap<String, GLStatisticsDataType> returnStatisticsHsahMap = new LinkedHashMap<String, GLStatisticsDataType>();
+ for (Map.Entry<String, GLRedundantDataType> entry : redundantHsahMap.entrySet()) {
+ GLRedundantDataType redundantDataType = entry.getValue();
+ String hashKey = redundantDataType.getAPIName();
+ GLStatisticsDataType savedHash = returnStatisticsHsahMap.get(hashKey);
+ if (null == savedHash) {
+ returnStatisticsHsahMap.put(
+ hashKey,
+ new GLStatisticsDataType(redundantDataType.getApiID(), redundantDataType
+ .getArgs(), getRate(redundantDataType.getCallCount()),
+ redundantDataType.getCallCount(), redundantDataType
+ .getElapsedTime(), getAPIType(redundantDataType
+ .getAPIName())));
+ } else {
+ savedHash.addCallCount(redundantDataType.getCallCount());
+ savedHash.setRate(getRate(savedHash.getCallCount()));
+ savedHash.addElapsedTime(redundantDataType.getElapsedTime());
+ }
+ }
+ return returnStatisticsHsahMap;
+ }
+
+ private double getRate(double callCount) {
+ return callCount / totalAPICount * 100;
+ }
+
+ private String getAPIType(String apiName) {
+ StringBuffer returnBuffer = new StringBuffer();
+ if (apiName.contains(MATRIX)) {
+ returnBuffer.append(MATRIX).append(SPLIT);
+ }
+ if (apiName.contains(TEXTURE) || apiName.contains("Tex")) {//$NON-NLS-1$
+ returnBuffer.append(TEXTURE).append(SPLIT);
+ }
+ if (apiName.contains(BUFFER)) {
+ returnBuffer.append(BUFFER).append(SPLIT);
+ }
+ if (apiName.contains(GET) || apiName.contains("glHint")) {//$NON-NLS-1$
+ returnBuffer.append(GET).append(SPLIT);
+ }
+ if (apiName.contains(IS)) {
+ returnBuffer.append(IS).append(SPLIT);
+ }
+ if (apiName.contains(DRAW) || apiName.contains("glFinish") || apiName.contains("glFlush")) {//$NON-NLS-1$//$NON-NLS-2$
+ returnBuffer.append(DRAW).append(SPLIT);
+ }
+ if (apiName.contains(DELETE)) {
+ returnBuffer.append(DELETE).append(SPLIT);
+ }
+ if (apiName.contains("Bind") || apiName.contains("Gen")) {//$NON-NLS-1$//$NON-NLS-2$
+ returnBuffer.append(BIND).append(SPLIT);
+ }
+ if (apiName.contains("Program") || apiName.contains("Shader")//$NON-NLS-1$//$NON-NLS-2$
+ || apiName.contains("Uniform") || apiName.contains("Vertex")) {//$NON-NLS-1$//$NON-NLS-2$
+ returnBuffer.append(PROGRAM_AND_SHADER).append(SPLIT);
+ }
+ if (apiName.contains("Blend") || apiName.contains("Clear") || apiName.contains("Color")//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ || apiName.contains("Cull") || apiName.contains("Depth")//$NON-NLS-1$//$NON-NLS-2$
+ || apiName.contains("Disable") || apiName.contains("Enable")//$NON-NLS-1$//$NON-NLS-2$
+ || apiName.contains("Stencil") || apiName.contains("glLineWidth")//$NON-NLS-1$//$NON-NLS-2$
+ || apiName.contains("glPixelStorei") || apiName.contains("glPolygonOffset")//$NON-NLS-1$//$NON-NLS-2$
+ || apiName.contains("glReadPixels") || apiName.contains("glSampleCoverage")//$NON-NLS-1$//$NON-NLS-2$
+ || apiName.contains("glScissor") || apiName.contains("glViewport")) {//$NON-NLS-1$//$NON-NLS-2$
+ returnBuffer.append(STATE_CHANGE).append(SPLIT);
+ }
+ if (apiName.contains(EVAS_GL)) {
+ returnBuffer.append(EVAS_GL);
+ }
+ if (returnBuffer.length() == 0) {
+ DALogger.getInstance().error("Not Define API Type of Statistics : " + apiName);
+ return CommonConstants.EMPTY;
+ }
+ if (returnBuffer.lastIndexOf(SPLIT) == returnBuffer.length() - SPLIT.length()) {
+ returnBuffer.delete(returnBuffer.length() - SPLIT.length(), returnBuffer.length());
+ }
+ return returnBuffer.toString();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@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.opengl.data.type;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
+
+public class GLRedundantDataType {
+ private int apiID = -1;
+ private String args = CommonConstants.EMPTY;
+ private int callCount = -1;
+ private long elapsedTime = 0;
+
+ public GLRedundantDataType(int apiID, String args, int callCount, long elapsedTime) {
+ this.apiID = apiID;
+ this.args = args;
+ this.elapsedTime = elapsedTime;
+ this.callCount = callCount;
+ }
+
+ public int getApiID() {
+ return apiID;
+ }
+
+ public String getAPIName() {
+ return AnalyzerManager.getProject().getApiName(apiID);
+ }
+
+ public void setApiID(int apiID) {
+ this.apiID = apiID;
+ }
+
+ public String getArgs() {
+ return args;
+ }
+
+ public void setArgs(String args) {
+ this.args = args;
+ }
+
+ public int getCallCount() {
+ return callCount;
+ }
+
+ public void addCallCount() {
+ callCount++;
+ }
+
+ public void addCallCount(int preCallCount) {
+ callCount += preCallCount;
+ }
+
+ public void setCallCount(int callCount) {
+ this.callCount = callCount;
+ }
+
+ public long getElapsedTime() {
+ return elapsedTime;
+ }
+
+ public void setElapsedTime(long elapsedTime) {
+ this.elapsedTime = elapsedTime;
+ }
+
+ public void addElapsedTime(long elapsedTime) {
+ this.elapsedTime += elapsedTime;
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@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.opengl.data.type;
+
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
+
+public class GLStatisticsDataType extends GLRedundantDataType {
+ private String apiType = CommonConstants.EMPTY;
+ private double rate = -1;
+
+ public GLStatisticsDataType(int apiID, String parameter, double rate, int callCount,
+ long elapsedTime, String apiType) {
+ super(apiID, parameter, callCount, elapsedTime);
+ this.apiType = apiType;
+ this.setRate(rate);
+ setCallCount(callCount);
+ }
+
+ public String getAPIType() {
+ return apiType;
+ }
+
+ public void setAPIType(String apiType) {
+ this.apiType = apiType;
+ }
+
+ public double getRate() {
+ return this.rate;
+ }
+
+ public void setRate(double rate) {
+ this.rate = rate;
+ }
+
+}
\ No newline at end of file
@Override
public void handleClickEvent(DACustomButton button) {
+ GLDataManager.getInstance().setSelectedAPIAtTable(CommonConstants.EMPTY);
int contextDBIndex = getSelectedStateIndex();
if (contextDBIndex < 0) {
return;
@Override
public void handleClickEvent(DACustomButton button) {
+ GLDataManager.getInstance().setSelectedAPIAtTable(CommonConstants.EMPTY);
int contextDBIndex = getSelectedStateIndex();
if (contextDBIndex < 0) {
return;
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.nl.GLPageLabels;
-import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
private Image checkImg = ImageResources.OPENGL_SHOW_ONLY_CHANGED_SELECTED;
private String[] columnNames = { GLPageLabels.GL_CONTEXT_VIEW_NAME,
- GLPageLabels.GL_CONTEXT_VIEW_DEFAULT_VALUE,
- GLPageLabels.GL_CONTEXT_VIEW_CURRENT_VALUE };
+ GLPageLabels.GL_CONTEXT_VIEW_DEFAULT_VALUE, GLPageLabels.GL_CONTEXT_VIEW_CURRENT_VALUE };
- int[] sortTypes = { AnalyzerConstants.SORT_TYPE_STRING,
- AnalyzerConstants.SORT_TYPE_STRING,
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_STRING, AnalyzerConstants.SORT_TYPE_STRING,
AnalyzerConstants.SORT_TYPE_STRING };
public GLContextTableView(Composite parent, int style) {
Composite contents = getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
- tableComp = new GLContextTable(contents, SWT.NONE, SWT.MULTI
- | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
- tableComp
- .setTableName(UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME);
+ tableComp = new GLContextTable(contents, SWT.NONE, SWT.MULTI | SWT.BORDER
+ | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ tableComp.setTableName(GLPageLabels.GL_CONTEXT_VIEW_TITLE);
tableComp.setSortTypes(sortTypes);
tableComp.setColumnAlignment(columnAlignment);
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility);
tableComp.setTableToolTipEnable(false);
-
- contents.addControlListener(new TableColumnSizePackListener(tableComp,
- columnSizes));
-
+ contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
}
@Override
String id = data.getViewID();
if ((id.equals(GLPage.apiListViewID) && data instanceof GLSelectionData)) {
GridItem[] gridItems = (GridItem[]) data.getData();
- DATableDataFormat tableDataFormat = (DATableDataFormat) gridItems[0]
- .getData();
+ DATableDataFormat tableDataFormat = (DATableDataFormat) gridItems[0].getData();
LogData logData = tableDataFormat.getLogData();
int frameIndex = ((GLSelectionData) data).getFrameTimeIndex();
String apiName = ((GLAPIData) logData).getApiName();
selectedSeq = Integer.toString(logData.getSeq());
- selectedStateValueList = GLDataManager.getInstance()
- .getContextDBTableManage()
+ selectedStateValueList = GLDataManager.getInstance().getContextDBTableManage()
.getContextData(selectedSeq, contextId);
if (null == selectedStateValueList) {
return;
}
- tableComp.setSelectedSeq(isCheckedBox, selectedSeq,
- selectedStateValueList);
+ tableComp.setSelectedSeq(isCheckedBox, selectedSeq, selectedStateValueList);
tableComp.updateTable();
tableComp.setSelectedSeq(isCheckedBox, selectedSeq, null);
- long contextID = (Long) selectedStateValueList
- .get(GLContextNameEnum.CONTEXT_ID.ordinal());
+ long contextID = (Long) selectedStateValueList.get(GLContextNameEnum.CONTEXT_ID
+ .ordinal());
String curretnContextNember = "Context_" + contextID;//$NON-NLS-1$
setTitle(curretnContextNember + " ( " + apiName + " of "//$NON-NLS-1$ //$NON-NLS-2$
+ frameIndex + " frame )");//$NON-NLS-1$
checkImg = ImageResources.OPENGL_SHOW_ONLY_CHANGED_SELECTED;
}
titleBar.redraw();
- tableComp.setSelectedSeq(isCheckedBox, selectedSeq,
- selectedStateValueList);
+ tableComp.setSelectedSeq(isCheckedBox, selectedSeq, selectedStateValueList);
tableComp.updateTable();
tableComp.setSelectedSeq(isCheckedBox, selectedSeq, null);
}
long contextID = programList.get(i).getContextId();
if (GLDataManager.getInstance().getSelectedContextID() == contextID) {
- tableInput.setInRange(true);
+ tableInput.setSecondSelection(true);
}
if (GLDataManager.getInstance().isSharingData(contextID)) {
- tableInput.setInRange(true);
+ tableInput.setSecondSelection(true);
}
}
return input;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.nl.GLPageLabels;
-import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.opengl.GLPage;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
contents.setLayout(new FillLayout());
tableComp = new GLProgramTable(contents, SWT.NONE, SWT.MULTI | SWT.BORDER
| SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
- tableComp.setTableName(UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME);
+ tableComp.setTableName(GLPageLabels.GL_PROGRAMS_VIEW_TITLE);
tableComp.setComparator(new DefaultTableComparator());
tableComp.setSortTypes(sortTypes);
tableComp.setColumnAlignment(columnAlignment);
@Override
public void updateView(DAViewData vdata) {
-
if (vdata instanceof DASelectionData) {
DASelectionData data = (DASelectionData) vdata;
String id = data.getViewID();
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@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.opengl.table.state;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+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.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.ui.opengl.GLPage;
+import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLConstantDefine;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLRedundantDataType;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class GLRedundantTable extends DATableComposite {
+
+ public GLRedundantTable(Composite parent, int style, int tableStyle) {
+ super(parent, style, tableStyle);
+ setContextMenu(AnalyzerConstants.CONTEXT_TABLE_RANGE);
+ table.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] items = table.getSelection();
+ if (null == items) {
+ return;
+ }
+ DATableDataFormat tableDataFormat = (DATableDataFormat) items[0].getData();
+ GLDataManager.getInstance().setSelectedAPIAtTable(
+ (String) tableDataFormat.getData().get(
+ GLRedundantTableView.API_NAME_TABLE_INDEX));
+ GLSelectionData selData = new GLSelectionData(GLPage.redundantViewID, 0, 0, items,
+ table, 0, 0);
+ AnalyzerManager.getCurrentPage().updateView(selData);
+ AnalyzerManager.updateView(GLPage.redundantViewID, selData);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ }
+
+ protected List<TableInput> makeTableInput() {
+ List<TableInput> input = new ArrayList<TableInput>();
+ GLDataManager.getInstance().updateSharingContextList();
+ List<GLRedundantDataType> dataList = GLDataManager.getInstance().getStatisticsDataManger()
+ .getRedundantTableData();
+ if (null == dataList) {
+ return null;
+ }
+ int size = dataList.size();
+ for (int i = 0; i < size; i++) {
+ GLRedundantDataType data = dataList.get(i);
+ List<String> text = new ArrayList<String>();
+ text.add(Integer.toString(data.getCallCount()));
+ text.add(Formatter.toTimeFormat4((data.getElapsedTime())));
+ text.add(data.getAPIName());
+ text.add(GLConstantDefine.convertEnumValue(data.getArgs(), CommonConstants.COMMA, null));
+ DATableDataFormat tableData = new DATableDataFormat(i);
+ List<Object> compareData = new ArrayList<Object>();
+ for (int j = 0; j < text.size(); j++) {
+ if (j == 1) {
+ compareData.add(String.valueOf(data.getElapsedTime()));
+ } else {
+ compareData.add(text.get(j));
+ }
+ }
+ tableData.setData(compareData);
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ tableInput.setData(tableData);
+ if (GLDataManager.getInstance().getSelectedAPIAtTable().equals(data.getAPIName())) {
+ tableInput.setSecondSelection(true);
+ }
+ input.add(tableInput);
+ }
+ return input;
+ }
+
+ public void removeSelection() {
+ table.removeAll();
+ updateTable();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@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.opengl.table.state;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.nl.GLPageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.opengl.GLPage;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
+
+public class GLRedundantTableView extends DAViewComposite {
+ public static final int COUNT_TABLE_INDEX = 0;
+ public static final int ELAPSED_TIME_TABLE_INDEX = 1;
+ public static final int API_NAME_TABLE_INDEX = 2;
+ public static final int PARAMETER_TABLE_INDEX = 3;
+ GLRedundantTable tableComp = null;
+ private int[] columnSizes = { 50, 90, 150, 150 };
+ private boolean[] columnVisibility = { true, true, true, true };
+ private int[] columnAlignment = { SWT.CENTER, SWT.CENTER, SWT.LEFT, SWT.LEFT };
+
+ private String[] columnNames = { GLPageLabels.GL_REDUNDANT_VIEW_COUNT,
+ GLPageLabels.GL_REDUNDANT_VIEW_ELAPSED_TIME, GLPageLabels.GL_REDUNDANT_VIEW_API_NAME,
+ GLPageLabels.GL_REDUNDANT_VIEW_PARAMETER };
+
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_STRING, AnalyzerConstants.SORT_TYPE_STRING };
+
+ public GLRedundantTableView(Composite parent, int style) {
+ super(parent, style, true);
+ this.setLayout(new FillLayout());
+ setTitle(GLPageLabels.GL_REDUNDANT_TITLE);
+ Composite contents = getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ tableComp = new GLRedundantTable(contents, SWT.NONE, SWT.MULTI | SWT.BORDER
+ | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ tableComp.setTableName(GLPageLabels.GL_REDUNDANT_TITLE);
+ tableComp.setComparator(new DefaultTableComparator());
+ tableComp.setSortTypes(sortTypes);
+ tableComp.setColumnAlignment(columnAlignment);
+ tableComp.setColumns(columnNames);
+ tableComp.setColumnSize(columnSizes);
+ tableComp.setColumnVisibility(columnVisibility);
+ tableComp.setTableToolTipEnable(false);
+ contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
+ }
+
+ @Override
+ public void updateView() {
+ if (!AnalyzerManager.isVisibleView(this.getID())) {
+ return;
+ }
+ if (null == tableComp) {
+ return;
+ }
+ tableComp.updateTable();
+ }
+
+ @Override
+ public void updateView(DAViewData vdata) {
+ if (null == tableComp) {
+ return;
+ }
+ if (vdata instanceof GLSelectionData) {
+ String id = ((GLSelectionData) vdata).getViewID();
+ if (id.equals(GLPage.redundantViewID) || id.equals(GLPage.statisticsViewID)
+ || id.equals(GLPage.apiListViewID)) {
+ tableComp.removeSelection();
+ tableComp.updateTable();
+ }
+ }
+ }
+
+ @Override
+ public void clear() {
+ tableComp.clear();
+ }
+
+ @Override
+ public Control getControl() {
+ return tableComp;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@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.opengl.table.state;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+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.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.ui.opengl.GLPage;
+import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStatisticsDataType;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+
+public class GLStatisticsTable extends DATableComposite {
+ public GLStatisticsTable(Composite parent, int style, int tableStyle) {
+ super(parent, style, tableStyle);
+ setContextMenu(AnalyzerConstants.CONTEXT_TABLE_RANGE);
+ table.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] items = table.getSelection();
+ if (null == items) {
+ return;
+ }
+ DATableDataFormat tableDataFormat = (DATableDataFormat) items[0].getData();
+ GLDataManager.getInstance().setSelectedAPIAtTable(
+ (String) tableDataFormat.getData().get(
+ GLStatisticsTableView.API_NAME_TABLE_INDEX));
+ GLSelectionData selData = new GLSelectionData(GLPage.statisticsViewID, 0, 0, items,
+ table, 0, 0);
+ AnalyzerManager.getCurrentPage().updateView(selData);
+ AnalyzerManager.updateView(GLPage.statisticsViewID, selData);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ }
+
+ protected List<TableInput> makeTableInput() {
+ List<TableInput> input = new ArrayList<TableInput>();
+ GLDataManager.getInstance().updateSharingContextList();
+ List<GLStatisticsDataType> dataList = GLDataManager.getInstance().getStatisticsDataManger()
+ .getStatisticsTableData();
+ if (null == dataList) {
+ return null;
+ }
+ int totalCallCount = 0;
+ int size = dataList.size();
+ for (int i = 0; i < size; i++) {
+ GLStatisticsDataType data = dataList.get(i);
+ List<String> text = new ArrayList<String>();
+ text.add(data.getAPIName());
+ text.add(String.format("%.2f", data.getRate()));//$NON-NLS-1$
+ text.add(Integer.toString(data.getCallCount()));
+ text.add(data.getAPIType());
+ DATableDataFormat tableData = new DATableDataFormat(i + 1);
+ List<Object> compareData = new ArrayList<Object>();
+ compareData.add(text.get(0));
+ compareData.add(String.format("%.0f", data.getRate() * 100));//$NON-NLS-1$
+ compareData.add(text.get(2));
+ compareData.add(text.get(3));
+ tableData.setData(compareData);
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ tableInput.setData(tableData);
+ if (GLDataManager.getInstance().getSelectedAPIAtTable().equals(data.getAPIName())) {
+ tableInput.setSecondSelection(true);
+ }
+ input.add(tableInput);
+
+ totalCallCount += data.getCallCount();
+
+ }
+ input.add(makeTotalRowInfo(size, totalCallCount));
+ return input;
+ }
+
+ private TableInput makeTotalRowInfo(int size, int totalCallCount) {
+ List<String> text = new ArrayList<String>();
+ text.add("Total (" + size + " items)");//$NON-NLS-1$//$NON-NLS-2$
+ text.add("100");//$NON-NLS-1$
+ text.add(Integer.toString(totalCallCount));
+ text.add(CommonConstants.DASH);
+ DATableDataFormat tableData = new DATableDataFormat(0);
+ List<Object> compareData = new ArrayList<Object>();
+ compareData.add(text.get(0));
+ compareData.add("10000");//$NON-NLS-1
+ compareData.add(text.get(2));
+ compareData.add(text.get(3));
+ tableData.setData(compareData);
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ tableInput.setData(tableData);
+ return tableInput;
+ }
+
+ public void removeSelection() {
+ table.removeAll();
+ updateTable();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@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.opengl.table.state;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.nl.GLPageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.opengl.GLPage;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
+
+public class GLStatisticsTableView extends DAViewComposite {
+ public static final int API_NAME_TABLE_INDEX = 0;
+ public static final int TABLE_RATE_TABLE_INDEX = 1;
+ public static final int COUNT_TABLE_INDEX = 2;
+ public static final int API_TYPE_TABLE_INDEX = 3;
+
+ GLStatisticsTable tableComp = null;
+ private int[] columnSizes = { 150, 80, 80, 200 };
+ private boolean[] columnVisibility = { true, true, true, true };
+ private int[] columnAlignment = { SWT.LEFT, SWT.CENTER, SWT.CENTER, SWT.CENTER };
+
+ private String[] columnNames = { GLPageLabels.GL_STATISTICS_VIEW_API_NAME,
+ GLPageLabels.GL_STATISTICS_VIEW_RATE, GLPageLabels.GL_STATISTICS_VIEW_COUNT,
+ GLPageLabels.GL_STATISTICS_VIEW_API_TYPE };
+
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_STRING, AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_STRING };
+
+ public GLStatisticsTableView(Composite parent, int style) {
+ super(parent, style, true);
+ this.setLayout(new FillLayout());
+ setTitle(GLPageLabels.GL_STATISTICS_TITLE);
+ Composite contents = getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ tableComp = new GLStatisticsTable(contents, SWT.NONE, SWT.MULTI | SWT.BORDER
+ | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ tableComp.setTableName(GLPageLabels.GL_STATISTICS_TITLE);
+ tableComp.setComparator(new DefaultTableComparator());
+ tableComp.setSortTypes(sortTypes);
+ tableComp.setColumnAlignment(columnAlignment);
+ tableComp.setColumns(columnNames);
+ tableComp.setColumnSize(columnSizes);
+ tableComp.setColumnVisibility(columnVisibility);
+ tableComp.setTableToolTipEnable(false);
+ contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
+ }
+
+ @Override
+ public void updateView() {
+ if (!AnalyzerManager.isVisibleView(this.getID())) {
+ return;
+ }
+ if (null == tableComp) {
+ return;
+ }
+ tableComp.updateTable();
+ }
+
+ @Override
+ public void updateView(DAViewData vdata) {
+ if (vdata instanceof GLSelectionData) {
+ String id = ((GLSelectionData) vdata).getViewID();
+ if (id.equals(GLPage.redundantViewID) || id.equals(GLPage.statisticsViewID)
+ || id.equals(GLPage.apiListViewID)) {
+ tableComp.removeSelection();
+ tableComp.updateTable();
+ }
+ }
+ }
+
+ @Override
+ public void clear() {
+ tableComp.clear();
+ }
+
+ @Override
+ public Control getControl() {
+ return tableComp;
+ }
+
+}