}
private void updateTableInfo(GLSelectionData data) {
- List<List<Object>> apiList = GLDataManager.getInstance().getCurrentAPITableData();
- if (null == apiList || apiList.size() == 0 || apiList.get(0).size() == 0) {
+ List<GLAPIData> apiList = GLDataManager.getInstance().getCurrentAPITableData();
+ if (null == apiList || apiList.size() == 0) {
return;
}
GLCurrentFrameDataManger glFrameData = new GLCurrentFrameDataManger();
- for (List<Object> listItem : apiList) {
- glFrameData.addAPIData(new GLAPIData(listItem));
+ for (GLAPIData listItem : apiList) {
+ glFrameData.addAPIData(listItem);
}
StringBuffer strDetailView = new StringBuffer();
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
-import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLFrameRateDBTableManager;
+import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLChartDBType;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
public void updateView(double startIndex, double endIndex) {
frameRateSeries.getSeriesItemList().clear();
- List<List<Object>> chartDataList = GLDataManager.getInstance().getFrameRateDBTableManager()
- .selectFrameRate(startIndex, endIndex);
- if (null == chartDataList || chartDataList.size() == 0 || chartDataList.get(0).size() == 0) {
+ List<GLChartDBType> chartDataList = GLDataManager.getInstance()
+ .getFrameRateDBTableManager().selectFrameRate(startIndex, endIndex);
+ if (null == chartDataList) {
return;
- }
- checkStartFrameRateTime(startIndex, chartDataList);
-
- for (int i = 0; i < chartDataList.size(); i++) {
- List<Object> chartData = chartDataList.get(i);
- addData((Integer) chartData.get(GLFrameRateDBTableManager.TABLE_CHART_TIME_INDEX),
- (Integer) chartData.get(GLFrameRateDBTableManager.TABLE_FRAME_INDEX_INDEX),
- (Integer) chartData.get(GLFrameRateDBTableManager.TABLE_FRAME_COUNT_INDEX),
- (Boolean) chartData.get(GLFrameRateDBTableManager.TABLE_ERROR_INFO_INDEX));
+ } else {
+ checkStartFrameRateTime(startIndex, chartDataList);
+ for (int i = 0; i < chartDataList.size(); i++) {
+ GLChartDBType chartData = chartDataList.get(i);
+ addData(chartData.getChartTime(), chartData.getFrameIndex(),
+ chartData.getFrameCount(), chartData.isErrno());
+ }
}
}
- private void checkStartFrameRateTime(double startIndex, List<List<Object>> chartDataList) {
+ private void checkStartFrameRateTime(double startIndex, List<GLChartDBType> chartDataList) {
if (startIndex != 0) {
return;
}
- int frameRateStartTime = (Integer) chartDataList.get(0).get(
- GLFrameRateDBTableManager.TABLE_CHART_TIME_INDEX);
+ int frameRateStartTime = chartDataList.get(0).getChartTime();
if (GLDataManager.getInstance().getStartFrameRateTime() < frameRateStartTime) {
GLDataManager.getInstance().setStartFrameRateTime(frameRateStartTime);
}
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
-import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLFrameTimeDBTableManager;
+import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLChartDBType;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType;
private GLFrameTimeChart() {
chartName = GLPageLabels.GL_CHART_TITLE_FRAME_TIME;
chartIcon = ImageResources.CHART_FRAME_TIME;
- frameTimeSeries = new DAChartSeries(chartName,
- DAChartSeries.SERIES_STYLE_BAR,
+ frameTimeSeries = new DAChartSeries(chartName, DAChartSeries.SERIES_STYLE_BAR,
ColorResources.SERIES_COLOR_CPU_APP);
}
@Override
- public DAChartBoardItem createBoardItem(DAChartBoard chartBoard,
- boolean enablePopupMenu) {
- DAChartBoardItem item = super.createBoardItem(chartBoard,
- enablePopupMenu);
+ public DAChartBoardItem createBoardItem(DAChartBoard chartBoard, boolean enablePopupMenu) {
+ DAChartBoardItem item = super.createBoardItem(chartBoard, enablePopupMenu);
chart.addSeries(frameTimeSeries);
chart.getPlot().setSeriesHeightRange(true);
public void updateView(double startIndex, double endIndex) {
frameTimeSeries.getSeriesItemList().clear();
- List<List<Object>> chartDataList = GLDataManager.getInstance()
- .getFrameTimeDBTableManager()
- .selectFrameTime(startIndex, endIndex);
+ List<GLChartDBType> chartDataList = GLDataManager.getInstance()
+ .getFrameTimeDBTableManager().selectFrameTime(startIndex, endIndex);
if (null == chartDataList) {
return;
} else {
for (int i = 0; i < chartDataList.size(); i++) {
- List<Object> chartData = chartDataList.get(i);
- addData((Integer) chartData
- .get(GLFrameTimeDBTableManager.TABLE_CHART_TIME_INDEX),
- (Integer) chartData
- .get(GLFrameTimeDBTableManager.TABLE_VALUE_INDEX),
- (Boolean) chartData
- .get(GLFrameTimeDBTableManager.TABLE_ERROR_INFO_INDEX));
+ GLChartDBType chartData = chartDataList.get(i);
+ addData(chartData.getChartTime(), chartData.getFrameMakingTime(),
+ chartData.isErrno());
}
}
}
package org.tizen.dynamicanalyzer.ui.opengl.data.DB;
import java.sql.PreparedStatement;
+import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
private static final String LIB_NAME = DBConstants.COMMON_COLUMN_CALLER_LIB_NAME;
public final static int TABLE_SEQ_INDEX = 0;
- public final static int TABLE_FRAME_INDEX_INDEX = 1;
- public final static int TABLE_CONTEXT_ID_INDEX = 2;
+ public final static int TABLE_CONTEXT_ID_INDEX = 1;
+ public final static int TABLE_FRAME_INDEX_INDEX = 2;
public final static int TABLE_TIME_INDEX = 3;
public final static int TABLE_API_ID_INDEX = 4;
public final static int TABLE_ARGUMENT_INDEX = 5;
public final static int TABLE_LIB_NAME_INDEX = 12;
private static final String SELECT_API_TABLE_QUERY_FROM_FRAME_RATE_CHART = "select "//$NON-NLS-1$
- + SEQ + CommonConstants.COMMA + FRAME_INDEX + CommonConstants.COMMA
- + CONTEXT_ID
+ + SEQ + CommonConstants.COMMA + CONTEXT_ID + CommonConstants.COMMA
+ + FRAME_INDEX
+ CommonConstants.COMMA + TIME + CommonConstants.COMMA + API_ID
+ CommonConstants.COMMA
+ ARGUMENT + CommonConstants.COMMA + RET + CommonConstants.COMMA
+ TID + CommonConstants.COMMA + CALLER_PC_ADDRESS + CommonConstants.COMMA
+ LIB_NAME
+ " from "//$NON-NLS-1$
- + TABLENAME + " where '%s' <= "//$NON-NLS-1$
- + FRAME_INDEX + " and " + FRAME_INDEX + " <= '%s'";//$NON-NLS-1$
+ + TABLENAME + " where " + FRAME_INDEX + " between '%s' and '%s'";//$NON-NLS-1$
@Override
public String getTableName() {
addColumn(new DBColumn(PID, DBConstants.NOT_NULL, DBConstants.INTEGER));
addColumn(new DBColumn(TID, DBConstants.NOT_NULL, DBConstants.INTEGER));
addColumn(new DBColumn(CALLER_PC_ADDRESS, DBConstants.NOT_NULL, DBConstants.LONG));
- addColumn(new DBColumn(LIB_NAME, DBConstants.NOT_NULL, DBConstants.TEXT_LIB_NAME));
+ addColumn(new DBColumn(LIB_NAME, DBConstants.NOT_NULL, DBConstants.INTEGER));
setIndexColumn(TABLE_FRAME_INDEX_INDEX);
}
insertData(insertDataList);
}
- public List<List<Object>> selectOpenGLAPIData(int frameStartIndex, int frameEndIndex) {
+ public List<GLAPIData> selectOpenGLAPIData(int frameStartIndex, int frameEndIndex) {
String query = String.format(SELECT_API_TABLE_QUERY_FROM_FRAME_RATE_CHART, frameStartIndex,
frameEndIndex);
- List<List<Object>> result = SqlConnectionManager.executeQuery(query);
- if (null == result || result.size() == 0 || result.get(0).size() == 0) {
+ ResultSet rs = SqlConnectionManager.executeQueryRS(query);
+ if (rs == null) {
+ SqlConnectionManager.releaseResultSet(rs);
return null;
}
- return result;
+ List<GLAPIData> returnValue = new ArrayList<GLAPIData>();
+ try {
+ while (rs.next()) {
+ GLAPIData data = new GLAPIData();
+ data.setSeq(rs.getInt(TABLE_SEQ_INDEX + 1));
+ data.setContextID(rs.getLong(TABLE_CONTEXT_ID_INDEX + 1));
+ data.setFrameIndex(rs.getInt(TABLE_FRAME_INDEX_INDEX + 1));
+ data.setTime(rs.getLong(TABLE_TIME_INDEX + 1));
+ data.setApiId(rs.getInt(TABLE_API_ID_INDEX + 1));
+ data.setArgs(rs.getString(TABLE_ARGUMENT_INDEX + 1));
+ data.setReturn(rs.getString(TABLE_RET_INDEX + 1));
+ data.setElapsedTime(rs.getLong(TABLE_ELAPSED_TIMEQ_INDEX + 1));
+ data.setErrNo(rs.getLong(TABLE_ERROR_INDEX + 1));
+ data.setPid(rs.getInt(TABLE_PID_INDEX + 1));
+ data.setTid(rs.getInt(TABLE_TID_INDEX + 1));
+ data.setCallerAddress(rs.getLong(TABLE_CALLER_PC_ADDRESS_INDEX + 1));
+ data.setBinaryId(rs.getInt(TABLE_LIB_NAME_INDEX + 1));
+ returnValue.add(data);
+ }
+ SqlConnectionManager.releaseResultSet(rs);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ return returnValue;
}
@Override
} else {
try {
prep.setInt(TABLE_SEQ_INDEX + 1, (Integer) (rowData.get(TABLE_SEQ_INDEX)));
- prep.setLong(TABLE_FRAME_INDEX_INDEX + 1,
- (Long) (rowData.get(TABLE_FRAME_INDEX_INDEX)));
- prep.setInt(TABLE_CONTEXT_ID_INDEX + 1,
- (Integer) (rowData.get(TABLE_CONTEXT_ID_INDEX)));
+ prep.setLong(TABLE_CONTEXT_ID_INDEX + 1,
+ (Long) (rowData.get(TABLE_CONTEXT_ID_INDEX)));
+ prep.setInt(TABLE_FRAME_INDEX_INDEX + 1,
+ (Integer) (rowData.get(TABLE_FRAME_INDEX_INDEX)));
prep.setLong(TABLE_TIME_INDEX + 1, (Long) (rowData.get(TABLE_TIME_INDEX)));
prep.setInt(TABLE_API_ID_INDEX + 1, (Integer) (rowData.get(TABLE_API_ID_INDEX)));
prep.setString(TABLE_ARGUMENT_INDEX + 1,
prep.setInt(TABLE_TID_INDEX + 1, (Integer) (rowData.get(TABLE_TID_INDEX)));
prep.setLong(TABLE_CALLER_PC_ADDRESS_INDEX + 1,
(Long) (rowData.get(TABLE_CALLER_PC_ADDRESS_INDEX)));
- prep.setString(TABLE_LIB_NAME_INDEX + 1,
- (String) (rowData.get(TABLE_LIB_NAME_INDEX)));
+ prep.setInt(TABLE_LIB_NAME_INDEX + 1, (Integer) (rowData.get(TABLE_LIB_NAME_INDEX)));
} catch (SQLException e) {
e.printStackTrace();
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 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.DB;
+
+public class GLChartDBType {
+ private int chartTime = 0;
+ private int frameIndex = 0;
+ private int frameCount = 0;
+ private int frameRateTime = 0;
+ private int frameMakingTime = 0;
+ private boolean errno = false;
+ private int PID = 0;
+
+ public int getChartTime() {
+ return chartTime;
+ }
+
+ public void setChartTime(int chartTime) {
+ this.chartTime = chartTime;
+ }
+
+ public boolean isErrno() {
+ return errno;
+ }
+
+ public void setErrno(boolean errno) {
+ this.errno = errno;
+ }
+
+ public int getFrameMakingTime() {
+ return frameMakingTime;
+ }
+
+ public void setFrameMakingTime(int frameMakingTime) {
+ this.frameMakingTime = frameMakingTime;
+ }
+
+ public int getFrameRateTime() {
+ return frameRateTime;
+ }
+
+ public void setFrameRateTime(int frameRateTime) {
+ this.frameRateTime = frameRateTime;
+ }
+
+ public int getPID() {
+ return PID;
+ }
+
+ public void setPID(int pID) {
+ PID = pID;
+ }
+
+ public int getFrameIndex() {
+ return frameIndex;
+ }
+
+ public void setFrameIndex(int frameIndex) {
+ this.frameIndex = frameIndex;
+ }
+
+ public int getFrameCount() {
+ return frameCount;
+ }
+
+ public void setFrameCount(int frameCount) {
+ this.frameCount = frameCount;
+ }
+
+}
package org.tizen.dynamicanalyzer.ui.opengl.data.DB;
import java.sql.PreparedStatement;
+import java.sql.ResultSet;
import java.sql.SQLException;
+import java.util.ArrayList;
import java.util.List;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
public final static int TABLE_PID_INDEX = 4;
private static final String SELECT_FRAME_RATE_TABLE_QUERY = "select "//$NON-NLS-1$
- + CHART_TIME + CommonConstants.COMMA
- + FRAME_COUNT
- + CommonConstants.COMMA + FRAME_INDEX
+ + CHART_TIME + CommonConstants.COMMA + FRAME_COUNT
+ CommonConstants.COMMA
- + ERROR_INFO + CommonConstants.COMMA + PID + " from "//$NON-NLS-1$
- + TABLENAME + " where '%s' <= " + CHART_TIME + " and " + CHART_TIME//$NON-NLS-1$ //$NON-NLS-2$
- + " <= '%s'";//$NON-NLS-1$
+ + FRAME_INDEX + CommonConstants.COMMA + ERROR_INFO + CommonConstants.COMMA
+ + PID
+ + " from "//$NON-NLS-1$
+ + TABLENAME + " WHERE " + CHART_TIME + " BETWEEN '%s' and '%s'";//$NON-NLS-1$
private static final String SELECT_PID_FRAME_RATE_TABLE_QUERY = "select "//$NON-NLS-1$
- + CHART_TIME + CommonConstants.COMMA
- + FRAME_COUNT
- + CommonConstants.COMMA + FRAME_INDEX
+ + CHART_TIME + CommonConstants.COMMA + FRAME_COUNT
+ CommonConstants.COMMA
- + ERROR_INFO + CommonConstants.COMMA + PID + " from "//$NON-NLS-1$
- + TABLENAME + " where '%s' <= " + CHART_TIME + " and " + CHART_TIME//$NON-NLS-1$ //$NON-NLS-2$
- + " <= '%s' and " + PID + " = '%s'";//$NON-NLS-1$
+ + FRAME_INDEX + CommonConstants.COMMA + ERROR_INFO + CommonConstants.COMMA
+ + PID
+ + " from "//$NON-NLS-1$
+ + TABLENAME + " where +" + CHART_TIME + " BETWEEN ' %s'and '%s' and " + PID + " = '%s'";//$NON-NLS-1$
@Override
public String getTableName() {
}
public GLFrameRateDBTableManager() {
- addColumn(new DBColumn(CHART_TIME, DBConstants.NOT_NULL,
- DBConstants.INTEGER));
- addColumn(new DBColumn(FRAME_COUNT, DBConstants.NOT_NULL,
- DBConstants.INTEGER));
- addColumn(new DBColumn(FRAME_INDEX, DBConstants.NOT_NULL,
- DBConstants.INTEGER));
- addColumn(new DBColumn(ERROR_INFO, DBConstants.NOT_NULL,
- DBConstants.BOOLEAN));
+ addColumn(new DBColumn(CHART_TIME, DBConstants.PRIMARY_KEY, DBConstants.INTEGER));
+ addColumn(new DBColumn(FRAME_COUNT, DBConstants.NOT_NULL, DBConstants.INTEGER));
+ addColumn(new DBColumn(FRAME_INDEX, DBConstants.NOT_NULL, DBConstants.INTEGER));
+ addColumn(new DBColumn(ERROR_INFO, DBConstants.NOT_NULL, DBConstants.BOOLEAN));
addColumn(new DBColumn(PID, DBConstants.NOT_NULL, DBConstants.INTEGER));
setIndexColumn(TABLE_CHART_TIME_INDEX);
}
}
public GLFrameRateInfo selectFrameCountInfo(int startIndex, int endIndex) {
- String query = String.format(SELECT_FRAME_RATE_TABLE_QUERY, startIndex,
- endIndex);
+ String query = String.format(SELECT_FRAME_RATE_TABLE_QUERY, startIndex, endIndex);
List<List<Object>> result = SqlConnectionManager.executeQuery(query);
if (null == result || result.size() == 0 || result.get(0).size() == 0) {
return null;
for (int i = 0; i < result.size(); i++) {
if (i == 0) {
- startFrameIndex = (Integer) (result.get(i)
- .get(TABLE_FRAME_INDEX_INDEX));
+ startFrameIndex = (Integer) (result.get(i).get(TABLE_FRAME_INDEX_INDEX));
}
if (i == result.size() - 1) {
endFrameIndex = startFrameIndex
return returnData;
}
- public List<List<Object>> selectFrameRate(double startIndex, double endIndex) {
- String query = String.format(SELECT_FRAME_RATE_TABLE_QUERY, startIndex,
- endIndex);
+ public List<GLChartDBType> selectFrameRate(double startIndex, double endIndex) {
+ String query = String.format(SELECT_FRAME_RATE_TABLE_QUERY, startIndex, endIndex);
if (ToolbarArea.getInstance().getSelectedPid() != 0) {
- query = String.format(SELECT_PID_FRAME_RATE_TABLE_QUERY,
- startIndex, endIndex, ToolbarArea.getInstance()
- .getSelectedPid());
+ query = String.format(SELECT_PID_FRAME_RATE_TABLE_QUERY, startIndex, endIndex,
+ ToolbarArea.getInstance().getSelectedPid());
}
- return SqlConnectionManager.executeQuery(query);
+ ResultSet rs = SqlConnectionManager.executeQueryRS(query);
+ if (rs == null) {
+ SqlConnectionManager.releaseResultSet(rs);
+ return null;
+ }
+
+ List<GLChartDBType> returnValue = new ArrayList<GLChartDBType>();
+ try {
+ while (rs.next()) {
+ GLChartDBType chartData = new GLChartDBType();
+ chartData.setChartTime(rs.getInt(TABLE_CHART_TIME_INDEX + 1));
+ chartData.setFrameCount(rs.getInt(TABLE_FRAME_COUNT_INDEX + 1));
+ chartData.setFrameIndex(rs.getInt(TABLE_FRAME_INDEX_INDEX + 1));
+ chartData.setErrno(rs.getBoolean(TABLE_ERROR_INFO_INDEX + 1));
+ returnValue.add(chartData);
+ }
+ SqlConnectionManager.releaseResultSet(rs);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ return returnValue;
}
@Override
(Integer) (rowData.get(TABLE_FRAME_INDEX_INDEX)));
prep.setBoolean(TABLE_ERROR_INFO_INDEX + 1,
(Boolean) (rowData.get(TABLE_ERROR_INFO_INDEX)));
- prep.setInt(TABLE_PID_INDEX + 1,
- (Integer) (rowData.get(TABLE_PID_INDEX)));
+ prep.setInt(TABLE_PID_INDEX + 1, (Integer) (rowData.get(TABLE_PID_INDEX)));
} catch (SQLException e) {
e.printStackTrace();
isPrepared = false;
package org.tizen.dynamicanalyzer.ui.opengl.data.DB;
import java.sql.PreparedStatement;
+import java.sql.ResultSet;
import java.sql.SQLException;
+import java.util.ArrayList;
import java.util.List;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
public static final String CHART_TIME = "CHART_TIME";//$NON-NLS-1$
public static final String FRAME_RATE = "FRAME_RATE_TIME";//$NON-NLS-1$
- public static final String VALUE = "VALUE";//$NON-NLS-1$
+ public static final String FRAME_MAKING_TIME = "FRAME_MAKING_TIME";//$NON-NLS-1$
public static final String ERROR_INFO = "ERROR_INFO";//$NON-NLS-1$
- public static final String START_SEQ = "START_SEQ";//$NON-NLS-1$
- public static final String END_SEQ = "END_SEQ";//$NON-NLS-1$
public static final String PID = DBConstants.COMMON_COLUMN_PID;
public final static int TABLE_CHART_TIME_INDEX = 0;
public final static int TABLE_FRAME_RATE_INDEX = 1;
- public final static int TABLE_VALUE_INDEX = 2;
+ public final static int TABLE_FRAME_MAKING_TIME_INDEX = 2;
public final static int TABLE_ERROR_INFO_INDEX = 3;
- public final static int TABLE_START_SEQ_INDEX = 4;
- public final static int TABLE_END_SEQ_INDEX = 5;
- public final static int TABLE_PID_INDEX = 6;
+ public final static int TABLE_PID_INDEX = 4;
- private static final String SELECT_TOTAL_FRAME_TIME_TABLE_QUERY = "select "//$NON-NLS-1$
- + CHART_TIME + CommonConstants.COMMA
- + FRAME_RATE
- + CommonConstants.COMMA + VALUE
- + CommonConstants.COMMA
- + ERROR_INFO + CommonConstants.COMMA
- + START_SEQ
- + CommonConstants.COMMA + END_SEQ + " from "//$NON-NLS-1$
+ private static final String SELECT_COUNT_FRAME_TIME_TABLE_QUERY = "select count(*) from "
+ TABLENAME;
private static final String SELECT_FRAME_TIME_TABLE_QUERY = "select "//$NON-NLS-1$
- + CHART_TIME + CommonConstants.COMMA
- + FRAME_RATE
- + CommonConstants.COMMA + VALUE
+ + CHART_TIME + CommonConstants.COMMA + FRAME_RATE
+ CommonConstants.COMMA
- + ERROR_INFO + CommonConstants.COMMA
- + START_SEQ
- + CommonConstants.COMMA + END_SEQ + " from "//$NON-NLS-1$
- + TABLENAME + " where '%s' <= " + CHART_TIME + " and "//$NON-NLS-1$//$NON-NLS-2$
- + CHART_TIME + " <= '%s'";//$NON-NLS-1$
+ + FRAME_MAKING_TIME + CommonConstants.COMMA + ERROR_INFO + " from "//$NON-NLS-1$
+ + TABLENAME + " where " + CHART_TIME + " between '%s' and '%s'";//$NON-NLS-1$
private static final String SELECT_PID_FRAME_TIME_TABLE_QUERY = "select "//$NON-NLS-1$
- + CHART_TIME + CommonConstants.COMMA
- + FRAME_RATE
- + CommonConstants.COMMA + VALUE
+ + CHART_TIME + CommonConstants.COMMA + FRAME_RATE
+ CommonConstants.COMMA
- + ERROR_INFO + CommonConstants.COMMA
- + START_SEQ
- + CommonConstants.COMMA + END_SEQ + " from "//$NON-NLS-1$
- + TABLENAME + " where '%s' <= " + CHART_TIME + " and "//$NON-NLS-1$//$NON-NLS-2$
- + CHART_TIME + " <= '%s' and " + PID + " = '%s'";//$NON-NLS-1$
+ + FRAME_MAKING_TIME + CommonConstants.COMMA + ERROR_INFO + " from "//$NON-NLS-1$
+ + TABLENAME + " where " + CHART_TIME + " between '%s' and '%s' and " + PID + " = '%s'";//$NON-NLS-1$
@Override
public String getTableName() {
}
public GLFrameTimeDBTableManager() {
- addColumn(new DBColumn(CHART_TIME, DBConstants.PRIMARY_KEY,
- DBConstants.INTEGER));
- addColumn(new DBColumn(FRAME_RATE, DBConstants.NOT_NULL,
- DBConstants.INTEGER));
- addColumn(new DBColumn(VALUE, DBConstants.NOT_NULL, DBConstants.INTEGER));
- addColumn(new DBColumn(ERROR_INFO, DBConstants.NOT_NULL,
- DBConstants.BOOLEAN));
- addColumn(new DBColumn(START_SEQ, DBConstants.NOT_NULL,
- DBConstants.INTEGER));
- addColumn(new DBColumn(END_SEQ, DBConstants.NOT_NULL,
- DBConstants.INTEGER));
+ addColumn(new DBColumn(CHART_TIME, DBConstants.NOT_NULL, DBConstants.INTEGER));
+ addColumn(new DBColumn(FRAME_RATE, DBConstants.NOT_NULL, DBConstants.INTEGER));
+ addColumn(new DBColumn(FRAME_MAKING_TIME, DBConstants.NOT_NULL, DBConstants.INTEGER));
+ addColumn(new DBColumn(ERROR_INFO, DBConstants.NOT_NULL, DBConstants.BOOLEAN));
addColumn(new DBColumn(PID, DBConstants.NOT_NULL, DBConstants.INTEGER));
setIndexColumn(TABLE_CHART_TIME_INDEX);
}
public int getFrameSize() {
- List<List<Object>> result = SqlConnectionManager
- .executeQuery(SELECT_TOTAL_FRAME_TIME_TABLE_QUERY);
- if (null == result || result.size() == 0 || result.get(0).size() == 0) {
- return 0;
- } else {
- return result.size();
+ int returnValue = 0;
+ ResultSet rs = SqlConnectionManager.executeQueryRS(SELECT_COUNT_FRAME_TIME_TABLE_QUERY);
+ if (rs == null) {
+ SqlConnectionManager.releaseResultSet(rs);
+ return returnValue;
+ }
+ try {
+ while (rs.next()) {
+ returnValue = rs.getInt(1);
+ }
+ SqlConnectionManager.releaseResultSet(rs);
+ } catch (SQLException e) {
+ e.printStackTrace();
}
+ return returnValue;
}
- public List<List<Object>> selectFrameTime(double startIndex, double endIndex) {
- String query = String.format(SELECT_FRAME_TIME_TABLE_QUERY, startIndex,
- endIndex);
+ public List<GLChartDBType> selectFrameTime(double startIndex, double endIndex) {
+ String query = String.format(SELECT_FRAME_TIME_TABLE_QUERY, startIndex, endIndex);
if (ToolbarArea.getInstance().getSelectedPid() != 0) {
- query = String.format(SELECT_PID_FRAME_TIME_TABLE_QUERY,
- startIndex, endIndex, ToolbarArea.getInstance()
- .getSelectedPid());
+ query = String.format(SELECT_PID_FRAME_TIME_TABLE_QUERY, startIndex, endIndex,
+ ToolbarArea.getInstance().getSelectedPid());
+ }
+ ResultSet rs = SqlConnectionManager.executeQueryRS(query);
+ if (rs == null) {
+ SqlConnectionManager.releaseResultSet(rs);
+ return null;
}
- return SqlConnectionManager.executeQuery(query);
+ List<GLChartDBType> returnValue = new ArrayList<GLChartDBType>();
+ try {
+ while (rs.next()) {
+ GLChartDBType chartData = new GLChartDBType();
+ chartData.setChartTime(rs.getInt(TABLE_CHART_TIME_INDEX + 1));
+ chartData.setFrameMakingTime(rs.getInt(TABLE_FRAME_MAKING_TIME_INDEX + 1));
+ chartData.setErrno(rs.getBoolean(TABLE_ERROR_INFO_INDEX + 1));
+ returnValue.add(chartData);
+ }
+ SqlConnectionManager.releaseResultSet(rs);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ return returnValue;
}
@Override
(Integer) (rowData.get(TABLE_CHART_TIME_INDEX)));
prep.setInt(TABLE_FRAME_RATE_INDEX + 1,
(Integer) (rowData.get(TABLE_FRAME_RATE_INDEX)));
- prep.setInt(TABLE_VALUE_INDEX + 1,
- (Integer) (rowData.get(TABLE_VALUE_INDEX)));
+ prep.setInt(TABLE_FRAME_MAKING_TIME_INDEX + 1,
+ (Integer) (rowData.get(TABLE_FRAME_MAKING_TIME_INDEX)));
prep.setBoolean(TABLE_ERROR_INFO_INDEX + 1,
(Boolean) (rowData.get(TABLE_ERROR_INFO_INDEX)));
- prep.setInt(TABLE_START_SEQ_INDEX + 1,
- (Integer) (rowData.get(TABLE_START_SEQ_INDEX)));
- prep.setInt(TABLE_END_SEQ_INDEX + 1,
- (Integer) (rowData.get(TABLE_END_SEQ_INDEX)));
- prep.setInt(TABLE_PID_INDEX + 1,
- (Integer) (rowData.get(TABLE_PID_INDEX)));
+ prep.setInt(TABLE_PID_INDEX + 1, (Integer) (rowData.get(TABLE_PID_INDEX)));
} catch (SQLException e) {
e.printStackTrace();
package org.tizen.dynamicanalyzer.ui.opengl.data.DB;
import java.sql.PreparedStatement;
+import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
}
public List<GLRedundantDataType> select() {
- List<List<Object>> result = SqlConnectionManager.executeQuery(SELECT_QUERY);
- if (null == result || result.size() == 0 || result.get(0).size() == 0) {
+ ResultSet rs = SqlConnectionManager.executeQueryRS(SELECT_QUERY);
+ if (rs == null) {
+ SqlConnectionManager.releaseResultSet(rs);
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);
+ try {
+ while (rs.next()) {
+ GLRedundantDataType data = new GLRedundantDataType();
+ data.setCallCount(rs.getInt(TABLE_CALL_COUNT_INDEX + 1));
+ data.setElapsedTime(rs.getLong(TABLE_ELAPSED_TIME_INDEX + 1));
+ data.setApiID(rs.getInt(TABLE_API_ID_INDEX + 1));
+ data.setArgs(rs.getString(TABLE_ARGUMENT_INDEX + 1));
+ textureList.add(data);
+ }
+ SqlConnectionManager.releaseResultSet(rs);
+ } catch (SQLException e) {
+ e.printStackTrace();
}
return textureList;
}
package org.tizen.dynamicanalyzer.ui.opengl.data.DB;
import java.sql.PreparedStatement;
+import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.database.DBColumn;
import org.tizen.dynamicanalyzer.database.DBConstants;
import org.tizen.dynamicanalyzer.database.DBTable;
private static final String TABLENAME = "GL_HISTORY";//$NON-NLS-1$
public static final String CONTEXT_ID = "CONTEXT_ID";//$NON-NLS-1$
- public static final String CONTEXT_DB_INDEX = "CONTEXT_DB_INDEX";//$NON-NLS-1$
- public static final String CHANGE_SEQ = "CHANGE_SEQ";//$NON-NLS-1$
+ public static final String CONTEXT_DB_INDEX = "RENDER_STATE_ID";//$NON-NLS-1$
+ public static final String CHANGE_SEQ = "CHANGE_SEQUENCE_NUMBER";//$NON-NLS-1$
public static final String FRAME_RATE_INDEX = "FRAME_RATE_INDEX";//$NON-NLS-1$
public static final String FRAME_TIME_INDEX = "FRAME_TIME_INDEX";//$NON-NLS-1$
public final static int TABLE_FRAME_RATE_INDEX_INDEX = 3;
public final static int TABLE_FRAME_TIME_INDEX_INDEX = 4;
- private static final String SELECT_LAST_CHANGED_SEQ_QUERY = "select "
- + CONTEXT_ID + CommonConstants.COMMA + CONTEXT_DB_INDEX
- + CommonConstants.COMMA + CHANGE_SEQ + CommonConstants.COMMA
- + FRAME_RATE_INDEX + CommonConstants.COMMA + FRAME_TIME_INDEX
- + " from " + TABLENAME + " where " + CONTEXT_ID + " = '%s' and "//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
- + CONTEXT_DB_INDEX + " = '%s' and " + CHANGE_SEQ//$NON-NLS-1$
- + " < '%s' order by " + CHANGE_SEQ + " desc";//$NON-NLS-1$//$NON-NLS-2$
-
- private static final String SELECT_NEXT_CHANGED_SEQ_QUERY = "select "//$NON-NLS-1$
- + CONTEXT_ID + CommonConstants.COMMA
- + CONTEXT_DB_INDEX
- + CommonConstants.COMMA + CHANGE_SEQ
- + CommonConstants.COMMA
- + FRAME_RATE_INDEX + CommonConstants.COMMA
- + FRAME_TIME_INDEX
- + " from " + TABLENAME + " where " + CONTEXT_ID + " = '%s' and "//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
- + CONTEXT_DB_INDEX + " = '%s' and " + CHANGE_SEQ//$NON-NLS-1$
- + " > '%s' order by " + CHANGE_SEQ + " desc";//$NON-NLS-1$//$NON-NLS-2$
+ private static final String SELECT_LAST_CHANGED_SEQ_QUERY = "select CONTEXT_ID,RENDER_STATE_ID,CHANGE_SEQUENCE_NUMBER,FRAME_RATE_INDEX,FRAME_TIME_INDEX "
+ + "from GL_HISTORY "
+ + "where CONTEXT_ID = '%s'and RENDER_STATE_ID = '%s'and "
+ + "CHANGE_SEQUENCE_NUMBER = (select MAX(CHANGE_SEQUENCE_NUMBER) "
+ + "from GL_HISTORY "
+ + "where CONTEXT_ID = '%s' and RENDER_STATE_ID = '%s' and CHANGE_SEQUENCE_NUMBER < '%s')";
+
+ private static final String SELECT_NEXT_CHANGED_SEQ_QUERY = "select CONTEXT_ID,RENDER_STATE_ID,CHANGE_SEQUENCE_NUMBER,FRAME_RATE_INDEX,FRAME_TIME_INDEX "
+ + "from GL_HISTORY "
+ + "where CONTEXT_ID = '%s'and RENDER_STATE_ID = '%s'and "
+ + "CHANGE_SEQUENCE_NUMBER = (select MIN(CHANGE_SEQUENCE_NUMBER) "
+ + "from GL_HISTORY "
+ + "where CONTEXT_ID = '%s' and RENDER_STATE_ID = '%s' and CHANGE_SEQUENCE_NUMBER > '%s')";
@Override
public String getTableName() {
}
public GLStateHistoryDBTableManager() {
- addColumn(new DBColumn(CONTEXT_ID, DBConstants.NOT_NULL,
- DBConstants.LONG));
- addColumn(new DBColumn(CONTEXT_DB_INDEX, DBConstants.NOT_NULL,
- DBConstants.INTEGER));
- addColumn(new DBColumn(CHANGE_SEQ, DBConstants.NOT_NULL,
- DBConstants.LONG));
- addColumn(new DBColumn(FRAME_RATE_INDEX, DBConstants.NOT_NULL,
- DBConstants.INTEGER));
- addColumn(new DBColumn(FRAME_TIME_INDEX, DBConstants.NOT_NULL,
- DBConstants.INTEGER));
+ addColumn(new DBColumn(CONTEXT_ID, DBConstants.NOT_NULL, DBConstants.LONG));
+ addColumn(new DBColumn(CONTEXT_DB_INDEX, DBConstants.NOT_NULL, DBConstants.INTEGER));
+ addColumn(new DBColumn(CHANGE_SEQ, DBConstants.NOT_NULL, DBConstants.LONG));
+ addColumn(new DBColumn(FRAME_RATE_INDEX, DBConstants.NOT_NULL, DBConstants.INTEGER));
+ addColumn(new DBColumn(FRAME_TIME_INDEX, DBConstants.NOT_NULL, DBConstants.INTEGER));
setIndexColumn(TABLE_CHANGE_SEQ_INDEX);
}
- public void insertData(long contextId, int stateIndex, long seq,
- int frameRateIndex, int frameTimeIndex) {
+ public void insertData(long contextId, int stateIndex, long seq, int frameRateIndex,
+ int frameTimeIndex) {
List<List<Object>> insertList = new ArrayList<List<Object>>();
List<Object> objectList = new ArrayList<Object>();
objectList.add(contextId);
insertData(insertList);
}
- public List<Object> selectLastChangedSeq(long contextId, int stateIndex,
- long seq) {
- String query = String.format(SELECT_LAST_CHANGED_SEQ_QUERY, contextId,
- stateIndex, seq);
- List<List<Object>> result = SqlConnectionManager.executeQuery(query);
- if (null == result || result.size() == 0 || result.get(0).size() == 0) {
+ public List<Object> selectLastChangedSeq(long contextId, int stateIndex, long seq) {
+ String query = String.format(SELECT_LAST_CHANGED_SEQ_QUERY, contextId, stateIndex,
+ contextId, stateIndex, seq);
+ ResultSet rs = SqlConnectionManager.executeQueryRS(query);
+ if (rs == null) {
+ SqlConnectionManager.releaseResultSet(rs);
return null;
}
- return result.get(0);
+ return getDBData(rs);
+ }
+
+ private List<Object> getDBData(ResultSet rs) {
+ List<Object> returnValue = new ArrayList<Object>();
+ try {
+ while (rs.next()) {
+ returnValue.add(rs.getLong(TABLE_CONTEXT_ID_INDEX + 1));
+ returnValue.add(rs.getInt(TABLE_CONTEXT_DB_INDEX_INDEX + 1));
+ returnValue.add(rs.getLong(TABLE_CHANGE_SEQ_INDEX + 1));
+ returnValue.add(rs.getInt(TABLE_FRAME_RATE_INDEX_INDEX + 1));
+ returnValue.add(rs.getInt(TABLE_FRAME_TIME_INDEX_INDEX + 1));
+ }
+ SqlConnectionManager.releaseResultSet(rs);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ return returnValue;
}
- public List<Object> selectNextChangedSeq(long contextId, int stateIndex,
- long seq) {
- String query = String.format(SELECT_NEXT_CHANGED_SEQ_QUERY, contextId,
- stateIndex, seq);
- List<List<Object>> result = SqlConnectionManager.executeQuery(query);
- if (null == result || result.size() == 0 || result.get(0).size() == 0) {
+ public List<Object> selectNextChangedSeq(long contextId, int stateIndex, long seq) {
+ String query = String.format(SELECT_NEXT_CHANGED_SEQ_QUERY, contextId, stateIndex,
+ contextId, stateIndex, seq);
+ ResultSet rs = SqlConnectionManager.executeQueryRS(query);
+ if (rs == null) {
+ SqlConnectionManager.releaseResultSet(rs);
return null;
}
- return result.get(0);
+ return getDBData(rs);
}
@Override
package org.tizen.dynamicanalyzer.ui.opengl.data.DB;
import java.sql.PreparedStatement;
+import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
if (null == result || result.size() == 0 || result.get(0).size() == 0) {
return;
}
- for (int i = 0; i < result.size(); i++) {
- if ((Integer) result.get(i).get(TABLE_TYPE_INDEX) == TYPE_PROGRAM) {
- initProgramData(i, result);
- } else {
- initSraderData(i, result);
+ ResultSet rs = SqlConnectionManager.executeQueryRS(SELECT_QUERY);
+ if (rs == null) {
+ SqlConnectionManager.releaseResultSet(rs);
+ return;
+ }
+ try {
+ while (rs.next()) {
+ if (rs.getInt(TABLE_TYPE_INDEX + 1) == TYPE_PROGRAM) {
+ initProgramData(rs);
+ } else {
+ initSraderData(rs);
+ }
}
+ SqlConnectionManager.releaseResultSet(rs);
+ } catch (SQLException e) {
+ e.printStackTrace();
}
}
- private void initProgramData(int index, List<List<Object>> result) {
- GLStateProgramType programType = new GLStateProgramType((Integer) result.get(index).get(
- TABLE_ID_INDEX));
- programType.setDeleteStatus((Integer) result.get(index).get(TABLE_DELETE_STATUS_INDEX));
- programType.setLinkStatus((Integer) result.get(index).get(TABLE_LINK_STATUS_INDEX));
- programType.setFragmentShaderId((Integer) result.get(index).get(TABLE_FRAGMENT_ID_INDEX));
- programType.setVertexShaderId((Integer) result.get(index).get(TABLE_VERTEX_ID_INDEX));
- programType.setContextId((Long) result.get(index).get(TABLE_CONTEXT_NAME_INDEX));
- GLDataManager.getInstance().getStateDataManager().getProgramMakeObject()
- .addProgramList(programType);
+ private void initProgramData(ResultSet rs) {
+ GLStateProgramType programType;
+ try {
+ programType = new GLStateProgramType(rs.getInt(TABLE_ID_INDEX + 1));
+ programType.setDeleteStatus(rs.getInt(TABLE_DELETE_STATUS_INDEX + 1));
+ programType.setLinkStatus(rs.getInt(TABLE_LINK_STATUS_INDEX + 1));
+ programType.setFragmentShaderId(rs.getInt(TABLE_FRAGMENT_ID_INDEX + 1));
+ programType.setVertexShaderId(rs.getInt(TABLE_VERTEX_ID_INDEX + 1));
+ programType.setContextId(rs.getLong(TABLE_CONTEXT_NAME_INDEX + 1));
+ GLDataManager.getInstance().getStateDataManager().getProgramMakeObject()
+ .addProgramList(programType);
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
- private void initSraderData(int index, List<List<Object>> result) {
- GLStateShaderType shaderType = new GLStateShaderType((Long) result.get(index).get(
- TABLE_CONTEXT_NAME_INDEX), (Integer) result.get(index).get(TABLE_ID_INDEX));
- shaderType.setShaderSrc((String) result.get(index).get(TABLE_SHADER_SRC_INDEX));
- shaderType.setDeleteStatus((Integer) result.get(index).get(TABLE_DELETE_STATUS_INDEX));
- shaderType.setCompileStatus((Integer) result.get(index).get(TABLE_LINK_STATUS_INDEX));
- GLDataManager.getInstance().getStateDataManager().getProgramMakeObject()
- .addShaderList(shaderType);
+ private void initSraderData(ResultSet rs) {
+ GLStateShaderType shaderType;
+ try {
+ shaderType = new GLStateShaderType(rs.getLong(TABLE_CONTEXT_NAME_INDEX + 1),
+ rs.getInt(TABLE_ID_INDEX + 1));
+ shaderType.setShaderSrc(rs.getString(TABLE_SHADER_SRC_INDEX + 1));
+ shaderType.setDeleteStatus(rs.getInt(TABLE_DELETE_STATUS_INDEX + 1));
+ shaderType.setCompileStatus(rs.getInt(TABLE_COMPILE_STATUS_INDEX + 1));
+ GLDataManager.getInstance().getStateDataManager().getProgramMakeObject()
+ .addShaderList(shaderType);
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
public void insertProgramData() {
List<List<Object>> returnObjectList = new ArrayList<List<Object>>();
List<GLStateShaderType> shaderList = GLDataManager.getInstance().getStateDataManager()
.getProgramMakeObject().getShaderList();
- if(null == shaderList){
+ if (null == shaderList) {
return returnObjectList;
}
for (int i = 0; i < shaderList.size(); i++) {
package org.tizen.dynamicanalyzer.ui.opengl.data.DB;
import java.sql.PreparedStatement;
+import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
}
public List<GLSharingContextType> selectSharingData() {
- List<List<Object>> result = SqlConnectionManager.executeQuery(SELECT_QUERY);
- if (null == result || result.size() == 0 || result.get(0).size() == 0) {
+ ResultSet rs = SqlConnectionManager.executeQueryRS(SELECT_QUERY);
+ if (rs == null) {
+ SqlConnectionManager.releaseResultSet(rs);
return null;
}
-
List<GLSharingContextType> sharingInfoList = new ArrayList<GLSharingContextType>();
- for (int i = 0; i < result.size(); i++) {
- sharingInfoList.add(new GLSharingContextType((Long) result.get(i).get(
- TABLE_CONTEXT_ID_INDEX), (Long) result.get(i).get(
- TABLE_SHARING_CONTEXT_ID_INDEX)));
+ try {
+ while (rs.next()) {
+ sharingInfoList.add(new GLSharingContextType(
+ rs.getLong(TABLE_CONTEXT_ID_INDEX + 1), rs
+ .getLong(TABLE_SHARING_CONTEXT_ID_INDEX + 1)));
+ }
+ SqlConnectionManager.releaseResultSet(rs);
+ } catch (SQLException e) {
+ e.printStackTrace();
}
-
return sharingInfoList;
}
package org.tizen.dynamicanalyzer.ui.opengl.data.DB;
import java.sql.PreparedStatement;
+import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
public void initTextureDataAtOpen() {
List<GLStateTextureType> selectedList = select();
- if(null == selectedList){
+ if (null == selectedList) {
return;
}
for (GLStateTextureType type : selectedList) {
}
public List<GLStateTextureType> select() {
- List<List<Object>> result = SqlConnectionManager.executeQuery(SELECT_QUERY);
- if (null == result || result.size() == 0 || result.get(0).size() == 0) {
+ ResultSet rs = SqlConnectionManager.executeQueryRS(SELECT_QUERY);
+ if (rs == null) {
+ SqlConnectionManager.releaseResultSet(rs);
return null;
}
-
List<GLStateTextureType> textureList = new ArrayList<GLStateTextureType>();
- for (int i = 0; i < result.size(); i++) {
- long contextID = (Long) result.get(i).get(TABLE_CONTEXT_ID_INDEX);
- int seq = (Integer) result.get(i).get(TABLE_CHANGE_SEQ_INDEX);
- int unitType = (Integer) result.get(i).get(TABLE_TEXTURE_UNIT_TYPE_INDEX);
- int textureId = (Integer) result.get(i).get(TABLE_TEXTURE_OBJ_ID_INDEX);
- int magFilter = (Integer) result.get(i).get(TABLE_TEXTURE_OBJ_MAG_FUNC_INDEX);
- int minFilter = (Integer) result.get(i).get(TABLE_TEXTURE_OBJ_MIN_FUNC_INDEX);
- int wrapS = (Integer) result.get(i).get(TABLE_TEXTURE_OBJ_WRAP_S_INDEX);
- int wrapT = (Integer) result.get(i).get(TABLE_TEXTURE_OBJ_WRAP_T_INDEX);
-
- GLStateTextureType textureType = new GLStateTextureType(textureId, contextID, seq);
- textureType.setMagFilter(magFilter);
- textureType.setMinFilter(minFilter);
- textureType.setWrapS(wrapS);
- textureType.setWrapT(wrapT);
- textureType.setType(unitType);
- textureList.add(textureType);
+ try {
+ while (rs.next()) {
+ long contextID = rs.getLong(TABLE_CONTEXT_ID_INDEX + 1);
+ int seq = rs.getInt(TABLE_CHANGE_SEQ_INDEX + 1);
+ int unitType = rs.getInt(TABLE_TEXTURE_UNIT_TYPE_INDEX + 1);
+ int textureId = rs.getInt(TABLE_TEXTURE_OBJ_ID_INDEX + 1);
+ int magFilter = rs.getInt(TABLE_TEXTURE_OBJ_MAG_FUNC_INDEX + 1);
+ int minFilter = rs.getInt(TABLE_TEXTURE_OBJ_MIN_FUNC_INDEX + 1);
+ int wrapS = rs.getInt(TABLE_TEXTURE_OBJ_WRAP_S_INDEX + 1);
+ int wrapT = rs.getInt(TABLE_TEXTURE_OBJ_WRAP_T_INDEX + 1);
+
+ GLStateTextureType textureType = new GLStateTextureType(textureId, contextID, seq);
+ textureType.setMagFilter(magFilter);
+ textureType.setMinFilter(minFilter);
+ textureType.setWrapS(wrapS);
+ textureType.setWrapT(wrapT);
+ textureType.setType(unitType);
+ textureList.add(textureType);
+ }
+ SqlConnectionManager.releaseResultSet(rs);
+ } catch (SQLException e) {
+ e.printStackTrace();
}
return textureList;
}
private boolean isSelectFrameRateChart = true;
private long apiTimeOfPreFrameIndex = 0;
private String selectedAPIAtTable = CommonConstants.EMPTY;
- private List<List<Object>> currentAPITableData = null;
+ private List<GLAPIData> currentAPITableData = null;
private int chartSelectedStartIndexForAPITable = -1;
private int chartSelectedEndIndexForAPITable = -1;
frameRateDataList = new ArrayList<GLFrameRateInfo>();
sharingContextList = new ArrayList<GLSharingContextType>();
statisticsDataManger = new GLStatisticsDataManager();
- currentAPITableData = new ArrayList<List<Object>>();
+ currentAPITableData = new ArrayList<GLAPIData>();
startFrameRateTime = 1;
selectedContextID = -1;
currentFrameIndex = 1;
@Override
protected void onThreadStop() {
-
+
}
@Override
for (LogData data : glesLogs.getRawLogs()) {
GLES20LogData logData = (GLES20LogData) data;
if (checkFailedAPI(logData)) {
- SummaryDataManager.getInstance().getFailedApiDataMaker()
- .makeData(logData);
+ SummaryDataManager.getInstance().getFailedApiDataMaker().makeData(logData);
}
}
}
int currentFrameIndexOfState = currentFrameIndex;
for (LogData data : glesLogs.getRawLogs()) {
GLES20LogData logData = (GLES20LogData) data;
- stateDataManager.extractGLAPIParameter(logData,
- currentFrameIndexOfState);
+ stateDataManager.extractGLAPIParameter(logData, currentFrameIndexOfState);
if (GLUtil.isLastAPIOfFrame(logData.getApiName())) {
currentFrameIndexOfState++;
}
List<GLAPIData> insetAPIDataList = new ArrayList<GLAPIData>();
for (LogData data : glesLogs.getRawLogs()) {
GLES20LogData logData = (GLES20LogData) data;
- insetAPIDataList
- .add(new GLAPIData(logData, currentFrameIndexOfAPI));
+ insetAPIDataList.add(new GLAPIData(logData, currentFrameIndexOfAPI));
if (GLUtil.isLastAPIOfFrame(logData.getApiName())) {
currentFrameIndexOfAPI++;
}
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();
}
hasFailedAPIofCurrentFrame = true;
}
if (GLUtil.isLastAPIOfFrame(logData.getApiName())) {
- makeFrameRateChartDataList(logData,
- currentFrameIndexOfFrameRate,
+ makeFrameRateChartDataList(logData, currentFrameIndexOfFrameRate,
hasFailedAPIofCurrentFrame);
hasFailedAPIofCurrentFrame = false;
currentFrameIndexOfFrameRate++;
}
}
- 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());
- framTimeChartData.add(glCurrentFrameData.getEndSeq());
framTimeChartData.add(glCurrentFrameData.getPid());
glCurrentFrameData.initFrameIndex();
insetFrameTimeChartDataList.add(framTimeChartData);
}
public void updateSharingContextList() {
- this.sharingContextList = GLDataManager.getInstance()
- .getStateSharingDBTableManage().selectSharingData();
+ this.sharingContextList = GLDataManager.getInstance().getStateSharingDBTableManage()
+ .selectSharingData();
}
public boolean isSharingData(long itemContextId) {
}
for (int i = 0; i < sharingContextList.size(); i++) {
long contextId = sharingContextList.get(i).getContextId();
- long sharingContextId = sharingContextList.get(i)
- .getSharingContextId();
- if (contextId == selectedContextID
- && sharingContextId == itemContextId) {
+ long sharingContextId = sharingContextList.get(i).getSharingContextId();
+ if (contextId == selectedContextID && sharingContextId == itemContextId) {
return true;
}
}
this.selectedContextID = selectedContextID;
}
- public List<List<Object>> getCurrentAPITableData(int frameStartIndex,
- int frameEndIndex) {
- if (currentAPITableData != null
- && chartSelectedStartIndexForAPITable == frameStartIndex
+ public List<GLAPIData> getCurrentAPITableData(int frameStartIndex, int frameEndIndex) {
+ if (currentAPITableData != null && chartSelectedStartIndexForAPITable == frameStartIndex
&& chartSelectedEndIndexForAPITable == frameEndIndex) {
return currentAPITableData;
}
chartSelectedStartIndexForAPITable = frameStartIndex;
chartSelectedEndIndexForAPITable = frameEndIndex;
- currentAPITableData = getAPIDataMagerInstance().selectOpenGLAPIData(
- frameStartIndex, frameEndIndex);
+ currentAPITableData = getAPIDataMagerInstance().selectOpenGLAPIData(frameStartIndex,
+ frameEndIndex);
return currentAPITableData;
}
- public List<List<Object>> getCurrentAPITableData() {
+ public List<GLAPIData> getCurrentAPITableData() {
return currentAPITableData;
}
import java.util.ArrayList;
import java.util.List;
+import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.project.BinaryInfo;
import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData;
-import org.tizen.dynamicanalyzer.ui.opengl.data.DB.GLAPIDBTableManager;
public class GLAPIData extends GLES20LogData {
private int frameIndex = 0;
+ private int binaryId = 0;
+
+ public GLAPIData() {
- public GLAPIData(List<Object> data) {
- setSeq((Integer) data.get(GLAPIDBTableManager.TABLE_SEQ_INDEX));
- setFrameIndex((Integer) data.get(GLAPIDBTableManager.TABLE_FRAME_INDEX_INDEX));
- setContextID((Long) data.get(GLAPIDBTableManager.TABLE_CONTEXT_ID_INDEX));
- setTime((Long) data.get(GLAPIDBTableManager.TABLE_TIME_INDEX));
- setApiId((Integer) data.get(GLAPIDBTableManager.TABLE_API_ID_INDEX));
- setArgs((String) data.get(GLAPIDBTableManager.TABLE_ARGUMENT_INDEX));
- setReturn((String) data.get(GLAPIDBTableManager.TABLE_RET_INDEX));
- setElapsedTime((Long) data.get(GLAPIDBTableManager.TABLE_ELAPSED_TIMEQ_INDEX));
- setErrNo((Long) data.get(GLAPIDBTableManager.TABLE_ERROR_INDEX));
- setPid((Integer) data.get(GLAPIDBTableManager.TABLE_PID_INDEX));
- setTid((Integer) data.get(GLAPIDBTableManager.TABLE_TID_INDEX));
- setCallerAddress((Long) data.get(GLAPIDBTableManager.TABLE_CALLER_PC_ADDRESS_INDEX));
- setLibName((String) data.get(GLAPIDBTableManager.TABLE_LIB_NAME_INDEX));
}
public GLAPIData(GLES20LogData logData, int currentFrameIndex) {
setPid(logData.getPid());
setTid(logData.getTid());
setCallerAddress(logData.getCallerPcAddr());
- setLibName(logData.getLibName());
+ setBinaryID(logData.getLibName());
+ }
+
+ public String getLibName() {
+ BinaryInfo binInfo = Global.getProject().getDeviceStatusInfo().getBinaryInfo(getBinaryId());
+ libName = binInfo.getTargetBinaryPath();
+ return libName;
}
public void setContextID(long id) {
data.add(getPid());
data.add(getTid());
data.add(getCallerPcAddr());
- data.add(getLibName());
+ data.add(getBinaryId());
return data;
}
+ public int getBinaryId() {
+ return binaryId;
+ }
+
+ public void setBinaryId(int binaryId) {
+ this.binaryId = binaryId;
+ }
+
+ public void setBinaryID(String binaryPath) {
+ BinaryInfo binInfo = Global.getProject().getDeviceStatusInfo().getBinaryInfo(binaryPath);
+ this.binaryId = binInfo.getID();
+ }
+
}
private int callCount = -1;
private long elapsedTime = 0;
+ public GLRedundantDataType() {
+
+ }
+
public GLRedundantDataType(int apiID, String args, int callCount, long elapsedTime) {
this.apiID = apiID;
this.args = args;
if (items == null || items.length == 0) {
return;
}
- DATableDataFormat dataFormat = (DATableDataFormat) items[0]
- .getData();
+ DATableDataFormat dataFormat = (DATableDataFormat) items[0].getData();
if (dataFormat.getLogData() instanceof GLAPIData == false) {
return;
}
long time = glAPIType.getTime();
int frameIndex = glAPIType.getFrameIndex();
long contextId = glAPIType.getContextID();
- GLDataManager.getInstance().setSelectedAPIAtTable(
- glAPIType.getApiName());
- GLSelectionData selData = new GLSelectionData(
- GLPage.apiListViewID, time, time, items, table,
- frameIndex, contextId);
+ GLDataManager.getInstance().setSelectedAPIAtTable(glAPIType.getApiName());
+ GLSelectionData selData = new GLSelectionData(GLPage.apiListViewID, time, time,
+ items, table, frameIndex, contextId);
AnalyzerManager.getCurrentPage().updateView(selData);
AnalyzerManager.updateView(GLPage.apiListViewID, selData);
}
protected List<TableInput> makeTableInput() {
List<TableInput> input = new ArrayList<TableInput>();
- List<List<Object>> apiList = GLDataManager.getInstance()
- .getCurrentAPITableData(startFrameIndex, endFrameIndex);
+ List<GLAPIData> apiList = GLDataManager.getInstance().getCurrentAPITableData(
+ startFrameIndex, endFrameIndex);
if (null == apiList) {
return null;
}
int size = apiList.size();
for (int i = 0; i < size; i++) {
- GLAPIData glApiType = new GLAPIData(apiList.get(i));
+ GLAPIData glApiType = apiList.get(i);
String seq = Integer.toString(glApiType.getSeq());
List<String> text = new ArrayList<String>();
text.add(seq);
text.add(Integer.toString(glApiType.getFrameIndex()));
text.add(String.valueOf(Formatter.toTimeFormat(glApiType.getTime())));
text.add(glApiType.getApiName());
- text.add(GLConstantDefine.convertEnumValue(glApiType.getArgs(),
- CommonConstants.COMMA, null));
+ text.add(GLConstantDefine.convertEnumValue(glApiType.getArgs(), CommonConstants.COMMA,
+ null));
text.add(glApiType.getReturn());
text.add(String.valueOf(glApiType.getElapsedTime()));
text.add(GLES20ErrorDefine.getError(glApiType.getErrno()));
text.add(String.valueOf(glApiType.getPid()));
text.add(String.valueOf(glApiType.getTid()));
- DATableDataFormat tableData = new DATableDataFormat(
- Long.parseLong(seq));
+ DATableDataFormat tableData = new DATableDataFormat(Long.parseLong(seq));
List<Object> compareData = new ArrayList<Object>();
for (int j = 0; j < text.size(); j++) {
compareData.add(text.get(j));
tableInput.setText(text);
tableInput.setData(glApiType);
tableInput.setData(tableData);
- if (!GLES20ErrorDefine.getError(glApiType.getErrno()).contains(
- "SUCCESS")) {//$NON-NLS-1$
+ if (!GLES20ErrorDefine.getError(glApiType.getErrno()).contains("SUCCESS")) {//$NON-NLS-1$
tableInput.setFailed(true);
}
- if (GLDataManager.getInstance().getSelectedAPIAtTable()
- .equals(glApiType.getApiName())) {
+ if (GLDataManager.getInstance().getSelectedAPIAtTable().equals(glApiType.getApiName())) {
tableInput.setSecondSelection(true);
}
input.add(tableInput);
int frameIndex = glAPIType.getFrameIndex();
long contextId = glAPIType.getContextID();
- GLSelectionData selData = new GLSelectionData(GLPage.apiListViewID,
- time, time, items, table, frameIndex, contextId);
+ GLSelectionData selData = new GLSelectionData(GLPage.apiListViewID, time, time, items,
+ table, frameIndex, contextId);
AnalyzerManager.getCurrentPage().updateView(selData);
}
}
- public void updateTableFromContext(int startFrameIndex, int endFrameIndex,
- String seq) {
+ public void updateTableFromContext(int startFrameIndex, int endFrameIndex, String seq) {
if (startFrameIndex >= 0) {
this.startFrameIndex = startFrameIndex;
}
for (int ii = 0; ii < nSize; ii++) {
if (table.getItem(ii).getText(0).equals(seq)) {
table.setSelection(ii);
- table.getVerticalBar().setSelection(
- getScrollSelectionIndex(table, ii));
+ table.getVerticalBar().setSelection(getScrollSelectionIndex(table, ii));
updateTable();
}
}
int frameIndex = glAPIType.getFrameIndex();
long contextId = glAPIType.getContextID();
- GLSelectionData selData = new GLSelectionData(GLPage.apiListViewID,
- time, time, items, table, frameIndex, contextId);
+ GLSelectionData selData = new GLSelectionData(GLPage.apiListViewID, time, time, items,
+ table, frameIndex, contextId);
AnalyzerManager.getCurrentPage().updateView(selData);
}