private static NetworkDataManager instance = new NetworkDataManager();
+ private int rid = 0;
+
private NetworkDataMaker networkDataMaker = null;
private NetworkSeriesDBManager seriesDBManager = null;
private NetworkAPIDBManager apiDBManager = null;
chartCount = 0;
accessSeriesSize = 0;
networkDataMaker.clear();
+ rid = 0;
}
public LinkedHashMap<String, String> getCheckStatusSeries() {
&& seriesType.getFdValue().equals(fd) && seriesType.getAPIType() == apiType
&& seriesType.getEndTime() < 0) {
seriesList.get(i).setEndTime(endTime);
- seriesDBManager.insert(seriesType);
+ insertToSeriesDB(seriesType);
break;
}
}
for (int i = 0; i < seriesList.size(); i++) {
NetworkSeriesType seriesType = seriesList.get(i);
if (seriesType.getEndTime() < 0) {
- seriesDBManager.insert(seriesType);
+ insertToSeriesDB(seriesType);
}
}
}
+ private void insertToSeriesDB(NetworkSeriesType insertData) {
+ List<List<Object>> insertDataList = new ArrayList<List<Object>>();
+ insertData.setRid(rid++);
+ insertDataList.add(insertData.getDBInsertData());
+ seriesDBManager.insertData(insertDataList);
+ }
+
public void openData(Map<String, String> dataMap) {
// set series list from DB
if (null == seriesList) {
+ CommonConstants.COMMA + API_ID + CommonConstants.COMMA + PID
+ " from " + TABLENAME + " where pid = '%s'"; //$NON-NLS-1$
- private static int rid = 0;
-
@Override
public String getTableName() {
return TABLENAME;
addColumn(new DBColumn(STATUS_TYPE, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
addColumn(new DBColumn(API_ID, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
addColumn(new DBColumn(PID, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- rid = 0;
- }
-
- public void insert(NetworkSeriesType insertData) {
- List<List<Object>> insertDataList = new ArrayList<List<Object>>();
- insertData.setRid(rid++);
- insertDataList.add(insertData.getDBInsertData());
- insertData(insertDataList);
}
public List<NetworkSeriesType> select(double visibleStartTime, double visibleEndTime) {
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.DBConstants;
import org.tizen.dynamicanalyzer.database.DBTable;
import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
-import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData;
-import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPINameDefine;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLBufferSizeType;
import org.tizen.dynamicanalyzer.util.Logger;
private static final String ARRAY_BUFFER_USAGE = "ARRAY_BUFFER_USAGE";//$NON-NLS-1$
private static final String ELEMENT_ARRAY_BUFFER_SIZE = "ELEMENT_ARRAY_BUFFER_SIZE";//$NON-NLS-1$
private static final String ELEMENT_ARRAY_BUFFER_USAGE = "ELEMENT_ARRAY_BUFFER_USAGE";//$NON-NLS-1$
- private final int GL_ARRAY_BUFFER = 34962;
-
- private int arrayBufferSize = 0;
- private int arrayBufferUsage = 0;
- private int elementArrayBufferSize = 0;
- private int elementArrayBufferUsage = 0;
-
- private final int CONTEXT_VALUE_PARSER_TYPE_INDEX = 0;
- private final int CONTEXT_VALUE_PARSER_SIZE_INDEX = 1;
- private final int CONTEXT_VALUE_PARSER_USAGE_INDEX = 2;
public final static int TABLE_SEQ_ID_INDEX = 0;
public final static int TABLE_CONTEXT_ID_INDEX = 1;
public final static int SELECT_ELEMENT_ARRARY_BUFFER_SIZE_INDEX = 2;
public final static int SELECT_ELEMENT_ARRARY_BUFFER_USAGE_INDEX = 3;
- int testCount = 0;
private static final String SELECT = "select "//$NON-NLS-1$
+ ARRAY_BUFFER_SIZE + CommonConstants.COMMA
+ ARRAY_BUFFER_USAGE
addColumn(new DBColumn(ELEMENT_ARRAY_BUFFER_USAGE, DBConstants.NOT_NULL,
DBConstants.DBTYPE_INT4));
setIndexColumn(TABLE_CONTEXT_ID_INDEX);
-
- arrayBufferSize = 0;
- arrayBufferUsage = 0;
- elementArrayBufferSize = 0;
- elementArrayBufferUsage = 0;
- }
-
- public void insert(GLES20LogData logData) {
- List<List<Object>> insertDataList = new ArrayList<List<Object>>();
- List<Object> data = new ArrayList<Object>();
- if (isBufferEqualZeroOfGLBindBuffer(logData)
- || updateChangedBufferSize(logData.getContextValue().trim())) {
- data.add(logData.getSeq());
- data.add(logData.getCurrentContextID());
- data.add(arrayBufferSize);
- data.add(arrayBufferUsage);
- data.add(elementArrayBufferSize);
- data.add(elementArrayBufferUsage);
- insertDataList.add(data);
- insertData(insertDataList);
- }
- }
-
- private boolean isBufferEqualZeroOfGLBindBuffer(GLES20LogData logData) {
- if (!logData.getApiName().equals(GLAPINameDefine.API_GL_BUFFER_BIND)) {
- return false;
- }
- if (!logData.getArgs().contains(CommonConstants.COMMA)) {
- return false;
- }
- String argsSplit[] = logData.getArgs().split(CommonConstants.COMMA);
- if (argsSplit.length != 2) {
- return false;
- }
- int target = Integer.parseInt(argsSplit[0].trim());
- int buffer = Integer.parseInt(argsSplit[1].trim());
- if (buffer == 0) {
- if (target == GL_ARRAY_BUFFER) {
- arrayBufferSize = 0;
- arrayBufferUsage = 0;
- } else {
- elementArrayBufferSize = 0;
- elementArrayBufferUsage = 0;
- }
- return true;
- } else {
- return false;
- }
- }
-
- private boolean updateChangedBufferSize(String memorySize) {
- boolean isChagned = false;
- if (!memorySize.contains(CommonConstants.COMMA)) {
- return isChagned;
- }
- String contextValues[] = memorySize.split(CommonConstants.COMMA);
- if (contextValues.length != 3) {
- Logger.error("GL buffer API - size of the parameter of the context log column is not 2");
- return isChagned;
- }
- if (Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_TYPE_INDEX]) == GL_ARRAY_BUFFER) {
- if (arrayBufferSize != Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX])) {
- arrayBufferSize = Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX]);
- isChagned = true;
- }
- if (arrayBufferUsage != Integer
- .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX])) {
- arrayBufferUsage = Integer
- .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX]);
- isChagned = true;
- }
- } else {
- if (elementArrayBufferSize != Integer
- .parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX])) {
- elementArrayBufferSize = Integer
- .parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX]);
- isChagned = true;
- }
- if (elementArrayBufferUsage != Integer
- .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX])) {
- elementArrayBufferUsage = Integer
- .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX]);
- isChagned = true;
- }
- }
- return isChagned;
}
public GLBufferSizeType getBufferSize(long contextID, long selectedSeq) {
public class GLCommonStateDBTableManager extends DBTable {
private static final String TABLENAME = "GL_CONTEXT";//$NON-NLS-1$
- private String[] columnName = null;
+ private final String[] columnName;
private int rid = 0;
public final static int TABLE_CONTEXT_ID_INDEX = 1;
private static final String SELECT_CONTEXT_TABLE__QUERY = "select RID, SEQUENCE_NUMBER, CONTEXT_ID, VIEWPORT, BLEND_ENABLED, BLEND_COLOR, BLEND_DEST_RGB, BLEND_DEST_ALPHA, BLEND_EQUATION_RGB, BLEND_EQUATION_ALPHA, BLEND_SRC_RGB, BLEND_SRC_ALPHA, CULLING_ENABLED, CULLING_ORIENTATION, CULLING_MODE, DEPTH_ENABLED, DEPTH_FUNC, DEPTH_RANGE_N, DEPTH_RANGE_F, DITHER_ENABLED, FRAME_BUFFER_BINDING, LINE_WIDTH, POLY_ENABLED, POLY_FACTOR, POLY_UNITS, SCISSOR_ENABLED, SCISSOR, STENCIL_ENABLED, STENCIL_FRONT_FUNC, STENCIL_FRONT_REF, STENCIL_FRONT_MASK, STENCIL_FRONT_S_FAIL, STENCIL_FRONT_D_FAIL, STENCIL_FRONT_D_PASS, STENCIL_BACK_FUNC, STENCIL_BACK_REF, STENCIL_BACK_MASK, STENCIL_BACK_S_FAIL, STENCIL_BACK_D_FAIL, STENCIL_BACK_D_PASS, PACK_ALIGN, UNPACK_ALIGN, GVA_ENABLED, GVA_SIZE, GVA_TYPE, GVA_NORMAL, GVA_STRIDE, GVA_POINTER, GVA_V0, GVA_V1, GVA_V2, GVA_V3, VBO_ARRAY_BINDING, VBO_ARRAY_ID, VBO_ARRAY_SIZE, VBO_ARRAY_DATA, VBO_ARRAY_USAGE, VBO_ELEMENT_BINDING, VBO_ELEMENT_ID, VBO_ELEMENT_SIZE, VBO_ELEMENT_DATA, VBO_ELEMENT_USAGE, TEXTURE_ACTIVE from "//$NON-NLS-1$
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.GLDataManager;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSharingContextType;
import org.tizen.dynamicanalyzer.util.Logger;
savedSharingInfoList = new ArrayList<GLSharingContextType>();
}
- public void insertSharingData(List<GLSharingContextType> sharingInfoList) {
- List<List<Object>> insertList = new ArrayList<List<Object>>();
- for (int i = 0; i < sharingInfoList.size(); i++) {
- GLSharingContextType insertSharingType = sharingInfoList.get(i);
- if (!isSavedSharingData(insertSharingType)) {
- List<Object> objectList = new ArrayList<Object>();
- objectList.add(insertSharingType.getContextId());
- objectList.add(insertSharingType.getSharingContextId());
- insertList.add(objectList);
- savedSharingInfoList.add(insertSharingType);
- }
- }
- insertData(insertList);
- GLDataManager.getInstance().updateSharingContextList();
- }
-
- private boolean isSavedSharingData(GLSharingContextType insertSharingType) {
- for (int j = 0; j < savedSharingInfoList.size(); j++) {
- GLSharingContextType savedSharingType = savedSharingInfoList.get(j);
- if (savedSharingType.getContextId() == insertSharingType.getContextId()
- && savedSharingType.getSharingContextId() == insertSharingType
- .getSharingContextId()) {
- return true;
- }
- }
- return false;
- }
-
public List<GLSharingContextType> selectSharingData() {
ResultSet rs = SqlConnectionManager.executeQueryRS(SELECT_QUERY);
if (rs == null) {
package org.tizen.dynamicanalyzer.ui.opengl.data;
+import java.util.ArrayList;
+import java.util.List;
+
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPINameDefine;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class GLCommonStateDataMaker {
+ private final int GL_ARRAY_BUFFER = 34962;
+ private final int CONTEXT_VALUE_PARSER_TYPE_INDEX = 0;
+ private final int CONTEXT_VALUE_PARSER_SIZE_INDEX = 1;
+ private final int CONTEXT_VALUE_PARSER_USAGE_INDEX = 2;
+
private GLStateDataManager glStateDataManager = null;
+ private int arrayBufferSize = 0;
+ private int arrayBufferUsage = 0;
+ private int elementArrayBufferSize = 0;
+ private int elementArrayBufferUsage = 0;
+
public GLCommonStateDataMaker(GLStateDataManager glStateDataManager) {
this.glStateDataManager = glStateDataManager;
}
GLContextNameEnum.VBO_ELEMENT_USAGE.ordinal(),
currentContextValue.vboElementUsage);
}
- GLDataManager.getInstance().getBufferSizeDBTable().insert(logData);
+ insertToBufferSizeDB(logData);
} else if (logData.getApiName().equals(GLAPINameDefine.API_GL_BUFFER_BIND)) {
if (parameters.length != 2) {
Logger.error("GL extract API parameter : " + GLAPINameDefine.API_GL_BUFFER_BIND);
return;
}
if (Integer.parseInt(parameters[1]) == 0) {
- GLDataManager.getInstance().getBufferSizeDBTable().insert(logData);
+ insertToBufferSizeDB(logData);
return;
}
GLContextNameEnum.VBO_ELEMENT_BINDING.ordinal(),
currentContextValue.vboElementBinding);
}
- GLDataManager.getInstance().getBufferSizeDBTable().insert(logData);
+ insertToBufferSizeDB(logData);
} else if (logData.getApiName().equals(GLAPINameDefine.API_GL_BUFFER_DATA)) {
if (parameters.length != 4) {
Logger.error("GL extract API parameter : " + GLAPINameDefine.API_GL_BUFFER_DATA);
GLContextNameEnum.VBO_ELEMENT_USAGE.ordinal(),
currentContextValue.vboElementUsage);
}
- GLDataManager.getInstance().getBufferSizeDBTable().insert(logData);
+ insertToBufferSizeDB(logData);
}
}
}
}
+ public void insertToBufferSizeDB(GLES20LogData logData) {
+ List<List<Object>> insertDataList = new ArrayList<List<Object>>();
+ List<Object> data = new ArrayList<Object>();
+ if (isBufferEqualZeroOfGLBindBuffer(logData)
+ || updateChangedBufferSize(logData.getContextValue().trim())) {
+ data.add(logData.getSeq());
+ data.add(logData.getCurrentContextID());
+ data.add(arrayBufferSize);
+ data.add(arrayBufferUsage);
+ data.add(elementArrayBufferSize);
+ data.add(elementArrayBufferUsage);
+ insertDataList.add(data);
+ GLDataManager.getInstance().getBufferSizeDBTable().insertData(insertDataList);
+ }
+ }
+
+ private boolean isBufferEqualZeroOfGLBindBuffer(GLES20LogData logData) {
+ if (!logData.getApiName().equals(GLAPINameDefine.API_GL_BUFFER_BIND)) {
+ return false;
+ }
+ if (!logData.getArgs().contains(CommonConstants.COMMA)) {
+ return false;
+ }
+ String argsSplit[] = logData.getArgs().split(CommonConstants.COMMA);
+ if (argsSplit.length != 2) {
+ return false;
+ }
+ int target = Integer.parseInt(argsSplit[0].trim());
+ int buffer = Integer.parseInt(argsSplit[1].trim());
+ if (buffer == 0) {
+ if (target == GL_ARRAY_BUFFER) {
+ arrayBufferSize = 0;
+ arrayBufferUsage = 0;
+ } else {
+ elementArrayBufferSize = 0;
+ elementArrayBufferUsage = 0;
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private boolean updateChangedBufferSize(String memorySize) {
+ boolean isChanged = false;
+ if (!memorySize.contains(CommonConstants.COMMA)) {
+ return isChanged;
+ }
+ String contextValues[] = memorySize.split(CommonConstants.COMMA);
+ if (contextValues.length != 3) {
+ Logger.error("GL buffer API - size of the parameter of the context log column is not 2");
+ return isChanged;
+ }
+ if (Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_TYPE_INDEX]) == GL_ARRAY_BUFFER) {
+ if (arrayBufferSize != Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX])) {
+ arrayBufferSize = Integer.parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX]);
+ isChanged = true;
+ }
+ if (arrayBufferUsage != Integer
+ .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX])) {
+ arrayBufferUsage = Integer
+ .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX]);
+ isChanged = true;
+ }
+ } else {
+ if (elementArrayBufferSize != Integer
+ .parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX])) {
+ elementArrayBufferSize = Integer
+ .parseInt(contextValues[CONTEXT_VALUE_PARSER_SIZE_INDEX]);
+ isChanged = true;
+ }
+ if (elementArrayBufferUsage != Integer
+ .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX])) {
+ elementArrayBufferUsage = Integer
+ .parseInt(contextValues[CONTEXT_VALUE_PARSER_USAGE_INDEX]);
+ isChanged = true;
+ }
+ }
+ return isChanged;
+ }
}
public class GLContextSharingDataMaker {
private GLStateDataManager glStateDataManager = null;
+ List<GLSharingContextType> savedSharingInfoList = new ArrayList<GLSharingContextType>();
+
public GLContextSharingDataMaker(GLStateDataManager glStateDataManager) {
this.glStateDataManager = glStateDataManager;
}
.next();
insertSharingInfoList.addAll(getInsertSharingInfoList(e.getValue()));
}
- GLDataManager.getInstance().getStateSharingDBTableManage()
- .insertSharingData(insertSharingInfoList);
+ insertSharingDataToDB(insertSharingInfoList);
+ }
+
+ public void insertSharingDataToDB(List<GLSharingContextType> sharingInfoList) {
+ List<List<Object>> insertList = new ArrayList<List<Object>>();
+ for (int i = 0; i < sharingInfoList.size(); i++) {
+ GLSharingContextType insertSharingType = sharingInfoList.get(i);
+ if (!isSavedSharingData(insertSharingType)) {
+ List<Object> objectList = new ArrayList<Object>();
+ objectList.add(insertSharingType.getContextId());
+ objectList.add(insertSharingType.getSharingContextId());
+ insertList.add(objectList);
+ savedSharingInfoList.add(insertSharingType);
+ }
+ }
+
+ GLDataManager.getInstance().getStateSharingDBTableManage().insertData(insertList);
+ GLDataManager.getInstance().updateSharingContextList();
+ }
+
+ private boolean isSavedSharingData(GLSharingContextType insertSharingType) {
+ for (int j = 0; j < savedSharingInfoList.size(); j++) {
+ GLSharingContextType savedSharingType = savedSharingInfoList.get(j);
+ if (savedSharingType.getContextId() == insertSharingType.getContextId()
+ && savedSharingType.getSharingContextId() == insertSharingType
+ .getSharingContextId()) {
+ return true;
+ }
+ }
+ return false;
}
private List<GLSharingContextType> getInsertSharingInfoList(GLContextDataManager contextValue) {