private Map<Long, Integer> fileWritingCount = new HashMap<Long, Integer>();
private Map<Long, Boolean> isFileLocking = new HashMap<Long, Boolean>();
+ // TODO: rename queue
private Queue<List<FileEvent>> queue = new ConcurrentLinkedQueue<List<FileEvent>>();
public FileChartDataMaker(FailedChecker failedChecker,
ArrayList<List<Object>> fileApiList = new ArrayList<List<Object>>();
for (int i = 0; i < size; i++) {
FileData input = (FileData) inputs.get(i);
+ // TODO: legacy code, need to check
if (ConfigurationDialogDataManager.getInstance()
.getfeatureValue(
ConfigureLabels.INCLUDE_INSIDE_CALL_FILE) == 0) {
FailedData failedData = new FailedData(input);
this.failedChecker.getFailedList().add(failedData);
} else if (apiName.equals("fdopen")) { //$NON-NLS-1$
+ // TODO: legacy code, need to check
DA_LOG.debug("fdopen");
continue;
}
key = createKey(pid, tid);
// check fileAccessList, fileStatusList, fileAccessorMap size
+ // TODO: need to return when failed.
checkHeapMemory();
switch(apiType){
break;
case LogCenterConstants.FD_API_TYPE_CLOSE:
if (errNo == 0) {
+ // TODO: legacy code, need to check
timeLineFileChartFDCount--;
if (timeLineFileChartFDCount >= 0) {
timeLineFileChart.setFDCount(-1, eventTime);
addEndAccessData(dentry, pid, tid, filePath, eventTime, fileSize,
LogCenterConstants.FD_API_TYPE_WRITE_START);
break;
+ // TODO: default
}
fileEventQueue.add(event);
break;
}
}
+ /* TODO: what to do, when search failed?
+ make the fake start log: start time = 0
+ chart: if (start time == 0) do as if start time = trace start time
+ api list: if (start time == 0) "-"
+ */
}
private String createKey(int pid, int tid) {
key.append(pid);
key.append(":");
key.append(tid);
-
+ // TODO: change the key type to long
+ // ex) long key = pid << 32; key += tid;
+
return key.toString();
}
}
}
+ // TODO: deprecate
private void addReadingCount(long key, FileAccess readAccess) {
if(fileReadingCount.get(key) != null ) {
if(fileReadingCount.get(key) > 0) {
}
}
+ // TODO: deprecate
private void deleteReadingCount(long key) {
int count = fileReadingCount.get(key);
if(count > 0) {
}
}
+ // TODO: deprecate
private void addWritingCount(long key, FileAccess writeAccess) {
if(fileWritingCount.get(key) != null ) {
if(fileWritingCount.get(key) > 0) {
}
}
+ // TODO: deprecate
private void deleteWritingCount(long key) {
int count = fileWritingCount.get(key);
if(count > 0) {
}
private void checkHeapMemory() {
+ // TODO: define the AnalyzerLimit.java
+ // TODO: test: reduce the size less than 10
if ( (fileAccessList.size() > 10000
|| fileStatusList.size() > 100000)
|| fileAccessorMap.size() > 100000) {
ToolbarArea.getInstance().stopTrace();
Display.getDefault().asyncExec(new Runnable() {
@Override
+ // TODO: legacy code, need to check
public void run() {
final Shell shell = WorkbenchUtil.getWorkbenchWindow()
.getShell();
});
}
}
-
+ // TODO: legacy code, need to check
private boolean isPrintLog(FileData input) {
String apiName = input.getApiName();
if (apiName.contains("print")) {//$NON-NLS-1$
return false;
}
+ // TODO: legacy code, need to check
private boolean isOpenMainLog(FileData input) {
String filePath = input.getFilePath();
if (filePath.contains(CommonConstants.SLASH)) {
private FileApiDB apiDB = null;
private FileStatusDB statusDB = null;
+ // TODO: comment or rename eventList
private List<FileEvent> eventList = new ArrayList<FileEvent>();
private List<FileEvent> selectedTableAPIList = new ArrayList<FileEvent>();
this.selectedTableAPIList = selectedTableAPIList;
}
+ // TODO: change the comment
/*** make network data thread ***/
@Override
protected void makeData(LogPackage pack) {
import org.tizen.dynamicanalyzer.ui.file.manager.FileChartManager;
import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
+
+// TODO: contains a lot legacy code, need to refatoring this class
public class FileApiListTable extends DAApiListTableComposite {
public FileApiListTable(Composite parent, int compStyle, int tableStyle) {
super(parent, compStyle, tableStyle);
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
import org.tizen.dynamicanalyzer.ui.file.manager.FileChartManager;
+//TODO: contains a lot legacy code, need to refatoring this class
public class FileApiListView extends DAViewComposite {
+ // TODO: comment below variables
+ // TODO: remove unused variables
private long analysisStartTime = 0;
private long analysisEndTime = 0;
private int preSelectionPId = 1;
long newAnalysisStartTime = 0;
long newAnalysisEndTime = 0;
+ // TODO: comment
if (RangeDataManager.getInstance().isBeingAnalyzed()) {
newAnalysisStartTime = RangeDataManager.getInstance()
.getAnalysisStartTime();
private List<FileChart> chartList = new ArrayList<FileChart>();
private FileChartManager fileChartManager = FileChartManager.getInstance();
+ //TODO: use the fileAccessorMap in the DataMaker
private Map<String, Long> fileAccessorMap = new HashMap<String, Long>();
private FileChartDataMaker dataMaker;
private FileApiDB apiDB;
super.callBackSizeChanged();
}
+ // starting point of processing file information for file chart
+ // 1. FileChartView->updateView : periodic, message received
+ // 2. callBackScaleChanged
+ // 3. callBackScrollChanged
public void updateChart() {
+ // TODO: find out the way of updating without clearing the chart.
clearSeries();
createChartList();
updateStatusSeries();
private void createChartList() {
FileChart parent = null;
FileChart child = null;
+ // TODO:change the dentry init value to 0
long dentry = -1;
String key = null;
List<FileEvent> eventList = dataMaker.getFileEventList();
if(eventList == null){
+ // No file event at all.
return;
}
+ /*
+ * TODO:
+ * 1. parent and child tag ??
+ * 2. key includes dentry??
+ * 3. detry value error check ??
+ * 4. check else case ??
+ */
for(FileEvent event : eventList) {
key = createKey(event.getPid(), event.getTid());
if(event.getApiType() == LogCenterConstants.FD_API_TYPE_OPEN){
}
}
+ /*
+ * Drawing the chart title
+ * 1. parent: file name: max 2line, last: ...
+ * 2. child: "pid(PID) \n tid(TID)"
+ * need to refactoring
+ */
private void createChartItem(FileChart parent, FileChart fileChart) {
DAChartBoardItem item;
DAChart chart;
+ Long.toHexString(fileChart.getTid()) + "(TID)"
);
chart = item.getChart();
+ if (chart == null) {
+ // TODO: very strange case, ask to ryu what is this case
+ }
item.setData(new FileSelectedData(fileChart.getDentry(), fileChart
.getPid(), fileChart.getTid(), false));
initFileChart(chart, false);
.getPid(), fileChart.getTid(), true, fileChart
.getFilePath(), fileChart.getFileSize()));
chart = item.getChart();
+ if (chart == null) {
+ // TODO: very strange case, ask to ryu what is this case
+ }
initFileChart(chart, true);
}
List<FileEvent> apiList = apiDB.selectAPISeries(getVisibleStartTime(),
getVisibleEndTime());
if (null == apiList) {
+ // no file event within the selected time range.
return;
}
for (FileChart chart : chartList) {
chart.updateApiSeries(apiList);
}
}
+ else { // chartList.size() <= 0
+ // No data at all
+ }
}
private FileChart getParentChart(long dentry) {
return key.toString();
}
+ // TODO: rename getVisibleSatausList => getVisibleStatusList
private List<FileStatus> getVisibleSatausList() {
return dataMaker.getFileStatusList();
}
private List<FileAccess> getVisibleAccessList() {
List<FileAccess> data = new ArrayList<FileAccess>();
for(FileAccess access : dataMaker.getFileAccessList()){
+ // TODO: use the utility API
double startTime = access.getStartTime() / TimelineConstants.MEGA_DOUBLE;
double endTime = access.getEndTime() / TimelineConstants.MEGA_DOUBLE;
if ( startTime >= getVisibleStartTime()
} else if (endTime >= getVisibleStartTime()
&& endTime <= getVisibleEndTime()) {
data.add(access);
- } else if (endTime <= 0) { // ing
+ } else if (endTime <= 0) { // not finished
data.add(access);
}
}
}
DAChartPlot plot = chart.getPlot();
if (null == plot) {
+ // TODO: very strange case, ask to ryu what is this case
return;
}
if (isParent) {
chart.addSeries(accessSeries);
plot.setBackgroundImage(ImageResources.BG_CHILD_GRADIENT);
}
-
+ // TODO: legacy code, need to understand them
plot.setAutoHeightRange(AutoRangeType.MANUAL);
plot.setAxisFont(FontResources.CHART_AXIS_FONT);
plot.setAxisRangeY(0, 101);
plot.setMarkers(getMarkers());
}
+ // TODO: legacy code, need to understand them
private void initIntervalMarkers() {
// selection marker
DAChartPlotIntervalMarker selectionMarker = new DAChartPlotIntervalMarker(
import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
public class FileChartView extends DAViewComposite {
+ // TODO: the height can be changed
public final static int FILE_CHART_HEIGHT = 40;
private final Composite contents;
(long) (((DAChartPlotIntervalMarker) fileChartBoard
.getMarkers()
.get(UICommonConstants.SELECTION_MARKER_INDEX))
+ // TODO: use utility API
.getStartVal() * TimelineConstants.MEGA_DOUBLE),
(long) (((DAChartPlotIntervalMarker) fileChartBoard
.getMarkers()
.get(UICommonConstants.SELECTION_MARKER_INDEX))
+ // TODO: use utility API
.getEndVal() * TimelineConstants.MEGA_DOUBLE),
item.getData(), null));
}
initIntervalMarkers(fileChartBoard);
stackLayout.topControl = fileChartBoard;
+ // comment : textBoxLabel
Composite textBoxLabel = new Composite(fileChartBoard.getTitleComp(),
SWT.NONE);
textBoxLabel.addPaintListener(new PaintListener() {
}
@Override
+ // TODO: need to refactoring
public void updateView(DAViewData data) {
fileChartBoard.updateChart();
if (data instanceof DASelectionData) {
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
+//TODO: contains a lot legacy code, need to refatoring this class
+// TODO: comment the contents of the detail view
+// TODO: add: process name (PID), thread function name (TID)
public class FileDetailInfoView extends DAViewComposite {
private Canvas canvas = null;
private String fileName = AnalyzerLabels.EMPTY_STRING;
private long writeSize = 0;
private long totalUseTime = 0;
private int apiCount = 0;
- private int failedApiCount = 0;
+ private int failedApiCount = 0;
private FileChartManager fileChartManager = FileChartManager.getInstance();