Add DALogger to the dynamicanalyzer common pkg and change System.out.println() to the DA_LOG.xxx() format.
Add AutoTestManager for auto testing. (necessary to supplement.)
Change-Id: Id84239dcb56db4338691eb398f3ec9e05ac26507
Signed-off-by: seokgil.kang <seokgil.kang@samsung.com>
import org.tizen.dynamicanalyzer.appearance.DesignConstants;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
public class DATabComposite extends DABaseComposite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static final int LONG_TAB_WIDTH = 70;
public static final int SHORT_TAB_WIDTH = 70;
int index = children.indexOf(tab);
DATabButton button = buttons.get(index);
if (null == tab || null == button) {
- System.out.println("tab create bug!!"); // for log //$NON-NLS-1$
+ DA_LOG.debug("tab create bug!!"); // for log //$NON-NLS-1$
return;
}
Export-Package: org.tizen.dynamicanalyzer.callback,
org.tizen.dynamicanalyzer.constant,
org.tizen.dynamicanalyzer.util
+Import-Package: org.tizen.common.core.application
}
}
}
+
+ public static void executeCallback(String key, String[] msg) {
+ List<IExecutionCallback> clist = callbackMap.get(key);
+ if(clist != null) {
+ int size = clist.size();
+ for(int i = 0; i < size; i++) {
+ IExecutionCallback cb = clist.get(i);
+ cb.execute(msg);
+ }
+ }
+ }
}
// main execute function
public void execute();
+ public void execute(String[] msg);
+
}
--- /dev/null
+package org.tizen.dynamicanalyzer.util;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.common.core.application.InstallPathConfig;
+import org.tizen.dynamicanalyzer.util.CommonUtil;
+
+public class DALogger {
+ public enum testState {
+ START, END
+ };
+
+ private static DALogger instance;
+
+ public final static int ERROR = 0;
+ public final static int WARNING = 1;
+ public final static int INFO = 2;
+ public final static int CHECK = 3;
+ public final static int DEBUG = 4;
+ public final static int PERFORMANCE = 5;
+
+ private final static String separator = " | ";
+ private final static int PERFORMANCE_TEST_COUNT = 20;
+
+ private int logLevel; // INFO(release), DEBUG(develop), PERFORMANCE(test)
+ private SimpleDateFormat dateFormat;
+
+ private File outputFile = null;
+ private FileWriter fileWriter = null;
+ private BufferedWriter bufWriter = null;
+ private PrintWriter printWriter = null;
+
+ private String performanceSaveFilename = "DA_Autotest_Result.xsd";
+
+ // for performance test
+ private HashMap<String, List<Long>> startTimeMap;
+ private HashMap<String, Integer> testCountMap;
+ private HashMap<String, Integer> testTotalCountMap;
+ private HashMap<String, Long> totalSpentTimeMap;
+ private HashMap<String, List<Long>> subThreadStartTimeMap;
+ private HashMap<String, Integer> subThreadStartCountMap;
+
+ public DALogger() {
+ init();
+ }
+
+ public synchronized static DALogger getInstance() {
+ if(instance == null) {
+ instance = new DALogger();
+ }
+ return instance;
+ }
+
+ private void init() {
+ // TODO : logLevel setting (temporary hard coding)
+ logLevel = DEBUG;
+// logLevel = PERFORMANCE;
+// logLevel = ConfigureManager.getInstance().getValueInt(
+// ConfigureLabels.INTERNAL_LOG_LEVEL);
+ dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
+ }
+
+ private boolean checkLevel(int logType) {
+ if (logLevel >= logType) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private boolean openWriter() {
+ if (InstallPathConfig.getUserDataPath() == null) {
+ System.out.println("user data path is null !!");
+ return false;
+ }
+
+ StringBuilder savePath = new StringBuilder();
+ savePath.append(InstallPathConfig.getUserDataPath());
+ savePath.append(File.separator);
+ savePath.append("test"); //$NON-NLS-1$
+ savePath.append(File.separator);
+ savePath.append("dynamic-analyzer"); //$NON-NLS-1$
+
+ File testFolderPath = new File(savePath.toString());
+ if (!testFolderPath.exists()) {
+ if (!testFolderPath.mkdir()) {
+ System.out.println("test folder create failed...");
+ return false;
+ }
+ }
+
+ savePath.append(File.separator);
+ savePath.append(performanceSaveFilename);
+
+ outputFile = new File(savePath.toString());
+
+ try {
+ fileWriter = new FileWriter(outputFile);
+ bufWriter = new BufferedWriter(fileWriter);
+ printWriter = new PrintWriter(bufWriter);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return true;
+ }
+
+ private void closeWriter() {
+ CommonUtil.tryClose(outputFile, fileWriter, bufWriter, printWriter);
+ outputFile = null;
+ fileWriter = null;
+ bufWriter = null;
+ printWriter = null;
+ }
+
+ private void printLog(int logType, Object msg) {
+ if (logType == PERFORMANCE) {
+ if (printWriter == null) {
+ return;
+ }
+
+ printWriter.println(msg);
+ printWriter.checkError();
+ // for test
+// System.out.println(msg);
+ } else {
+ StringBuilder logMsg = new StringBuilder();
+ switch (logType) {
+ case ERROR:
+ logMsg.append("[ERROR] ");
+ break;
+ case WARNING:
+ logMsg.append("[WARNING] ");
+ break;
+ case CHECK:
+ logMsg.append("[CHECK] ");
+ break;
+ case INFO:
+ logMsg.append("[INFO] ");
+ break;
+ case DEBUG:
+ logMsg.append("[DEBUG] ");
+ break;
+ default:
+ break;
+ }
+
+ logMsg.append(dateFormat.format(new Date()));
+ logMsg.append(separator);
+ logMsg.append(getCallerInfo());
+ logMsg.append(String.valueOf(msg));
+
+ if (logType == ERROR) {
+ System.err.println(logMsg);
+ } else {
+ System.out.println(logMsg);
+ }
+ }
+ }
+
+ private String getCallerInfo() {
+ String msg = null;
+ StackTraceElement[] trace = new Throwable().getStackTrace();
+ if (trace.length >= 1) {
+ msg = new String(trace[3].getFileName() + ":"
+ + trace[3].getLineNumber() + " - ");
+
+ // for test
+// for (int i = 0; i < trace.length; i++) {
+// StackTraceElement elt = trace[i];
+// msg = new String(elt.getFileName() + ", "
+// + elt.getLineNumber() + " : ");
+// System.out.println("i : " + i + ", file : " + elt.getFileName() + ", method : "
+// + elt.getMethodName() + ", line : " + elt.getLineNumber());
+// }
+ }
+
+ return msg;
+ }
+
+ public void error(Object logMessage) {
+ if (checkLevel(ERROR)) {
+ printLog(ERROR, logMessage);
+ } else {
+ return;
+ }
+ }
+
+ public void error() {
+ if (checkLevel(ERROR)) {
+ System.out.println();
+ } else {
+ return;
+ }
+ }
+
+ public void warning(Object logMessage) {
+ if (checkLevel(WARNING)) {
+ printLog(WARNING, logMessage);
+ } else {
+ return;
+ }
+ }
+
+ public void warning() {
+ if (checkLevel(WARNING)) {
+ System.out.println();
+ } else {
+ return;
+ }
+ }
+
+ public void info(Object logMessage) {
+ if (checkLevel(INFO)) {
+ printLog(INFO, logMessage);
+ } else {
+ return;
+ }
+ }
+
+ public void info() {
+ if (checkLevel(INFO)) {
+ System.out.println();
+ } else {
+ return;
+ }
+ }
+
+ public void check(Object logMessage) {
+ if (checkLevel(CHECK)) {
+ printLog(CHECK, logMessage);
+ } else {
+ return;
+ }
+ }
+
+ public void check() {
+ if (checkLevel(CHECK)) {
+ System.out.println();
+ } else {
+ return;
+ }
+ }
+
+ public void debug(Object logMessage) {
+ if (checkLevel(DEBUG)) {
+ printLog(DEBUG, logMessage);
+ } else {
+ return;
+ }
+ }
+
+ public void debug() {
+ if (checkLevel(DEBUG)) {
+ System.out.println();
+ } else {
+ return;
+ }
+ }
+
+ public void performance(String key, testState state) {
+ if (checkLevel(PERFORMANCE)) {
+ switch (state) {
+ case START:
+ performanceStart(key);
+ break;
+ case END:
+ performanceEnd(key);
+ break;
+ default:
+ break;
+ }
+ } else {
+ return;
+ }
+ }
+
+ public void performance(String key, String testStep, String description) {
+ if (checkLevel(PERFORMANCE)) {
+ String msg = performanceNormal(key, description);
+ if (msg != null) {
+ printLog(PERFORMANCE, makeTestLog(testStep, msg));
+ }
+ } else {
+ return;
+ }
+ }
+
+ public void performance(String key, String testStep, String description, testState state) {
+ if (checkLevel(PERFORMANCE)) {
+ switch (state) {
+ case START:
+ performanceSubThreadStart(description);
+ break;
+ case END:
+ String msg = performanceSubThreadEnd(key, testStep, description);
+ if (msg != null) {
+ printLog(PERFORMANCE, makeTestLog(testStep, msg));
+ }
+ break;
+ default:
+ break;
+ }
+ } else {
+ return;
+ }
+ }
+
+ private void performanceStart(String key) {
+ if (printWriter == null) {
+ if (!openWriter()) {
+ // failed to init()
+ return;
+ }
+ }
+
+ startTimeMap = new HashMap<String, List<Long>>();
+ testCountMap = new HashMap<String, Integer>();
+ testTotalCountMap = new HashMap<String, Integer>();
+ totalSpentTimeMap = new HashMap<String, Long>();
+ subThreadStartTimeMap = new HashMap<String, List<Long>>();
+ subThreadStartCountMap = new HashMap<String, Integer>();
+
+ Integer count = testCountMap.get(key);
+ List<Long> startTimes;
+ if (count == null) {
+ count = (int) 1;
+ testCountMap.put(key, count);
+ startTimes = new ArrayList<Long>();
+ startTimeMap.put(key, startTimes);
+ testTotalCountMap.put(key, (int) 0);
+ totalSpentTimeMap.put(key, (long) 0);
+ } else {
+ testCountMap.put(key, count + 1);
+ startTimes = startTimeMap.get(key);
+ }
+
+ long nanoTime = System.nanoTime();
+ startTimes.add(nanoTime);
+
+ StringBuilder msg = new StringBuilder();
+// msg.append("<testsuite tests=\"");
+// msg.append(PERFORMANCE_TEST_COUNT);
+// msg.append("\">");
+ msg.append("<testsuite tests>");
+
+ printLog(PERFORMANCE, msg);
+ }
+
+ private String performanceNormal(String key, String description) {
+ String msg = null;
+ long nanoTime = System.nanoTime();
+
+ Integer count = testCountMap.get(key);
+ List<Long> startTimes;
+
+ if (count == null || count == 0) {
+ printLog(PERFORMANCE, "Can't find starting log about \"" + key + "\" key value !!");
+ } else {
+ startTimes = startTimeMap.get(key);
+ long startTime = startTimes.remove(startTimes.size() - 1);
+ long spendTime = nanoTime - startTime;
+ int totalCount = testTotalCountMap.get(key) + 1;
+ long totalTime = totalSpentTimeMap.get(key) + spendTime;
+
+ startTimes.add(nanoTime);
+ testTotalCountMap.put(key, totalCount);
+ totalSpentTimeMap.put(key, totalTime);
+
+ double time = spendTime / 1000000000.0;
+ msg = new String("name=\"" + description
+ + "\" time=\"" + String.format("%.3f", time)
+ + "\"");
+ }
+
+ return msg;
+ }
+
+ private void performanceEnd(String key) {
+ long nanoTime = System.nanoTime();
+
+ Integer count = testCountMap.get(key);
+ List<Long> startTimes;
+ if (count == null || count == 0) {
+ printLog(PERFORMANCE, "Can't find starting log about \"" + key + "\" key value !!");
+ } else {
+ startTimes = startTimeMap.get(key);
+ long startTime = startTimes.remove(startTimes.size() - 1);
+ long spendTime = nanoTime - startTime;
+ long totalTime = totalSpentTimeMap.get(key) + spendTime;
+// int totalCount = testTotalCountMap.get(key) + 1;
+// testTotalCountMap.put(key, totalCount);
+ testCountMap.put(key, count -1);
+ totalSpentTimeMap.put(key, totalTime);
+
+ StringBuilder msg = new StringBuilder();
+ msg.append("</testsuite>");
+
+ printLog(PERFORMANCE, msg);
+
+ closeWriter();
+ }
+ }
+
+ private void performanceSubThreadStart(String description) {
+ long nanoTime = System.nanoTime();
+
+ Integer count = subThreadStartCountMap.get(description);
+ List<Long> startTimes;
+ if (count == null || count == 0) {
+ count = (int) 1;
+ subThreadStartCountMap.put(description, count);
+ startTimes = new ArrayList<Long>();
+ subThreadStartTimeMap.put(description, startTimes);
+ startTimes.add(nanoTime);
+ }
+ }
+
+ private String performanceSubThreadEnd(String key, String testStep, String description) {
+ String msg = null;
+ long nanoTime = System.nanoTime();
+
+ Integer count = subThreadStartCountMap.get(description);
+ List<Long> startTimes;
+
+ if (count == null || count == 0) {
+ printLog(PERFORMANCE, "Can't find sub thread starting log about \"" + description + "\" key value !!");
+ } else {
+ startTimes = subThreadStartTimeMap.get(description);
+ long startTime = startTimes.remove(startTimes.size() - 1);
+ long spendTime = nanoTime - startTime;
+
+ subThreadStartCountMap.put(description, count -1);
+
+ double time = spendTime / 1000000000.0;
+ msg = new String("name=\"" + description
+ + "\" time=\"" + String.format("%.3f", time)
+ + "\"");
+ }
+
+ return msg;
+ }
+
+ private CharSequence makeCommonLog(int logType, String logMessage) {
+ StringBuilder msg = new StringBuilder();
+ switch (logType) {
+ case ERROR:
+ msg.append("[ERROR] ");
+ break;
+ case WARNING:
+ msg.append("[WARNING] ");
+ break;
+ case CHECK:
+ msg.append("[CHECK] ");
+ break;
+ case INFO:
+ msg.append("[INFO] ");
+ break;
+ case DEBUG:
+ msg.append("[DEBUG] ");
+ break;
+ default:
+ break;
+ }
+
+ msg.append(dateFormat.format(new Date()));
+ msg.append(separator);
+ msg.append(getCallerInfo());
+ msg.append(logMessage);
+
+ return msg;
+ }
+
+ private CharSequence makeTestLog(String testStep, String message) {
+ StringBuilder msg = new StringBuilder();
+ msg.append("<testcase step=\"");
+ msg.append(testStep);
+ msg.append("\" ");
+ msg.append(message);
+ msg.append("/>\n");
+ return msg;
+ }
+
+ public void setPerformanceSaveFilename(String filename) {
+ performanceSaveFilename = filename;
+ }
+
+ public void setLogLevel(int logLevel) {
+ this.logLevel = logLevel;
+ }
+}
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.tizen.dynamicanalyzer.widgets.Activator
Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime
+ org.eclipse.core.runtime,
+ org.tizen.dynamicanalyzer.common;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.tizen.dynamicanalyzer.widgets,
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
public class DAChart extends Canvas {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
Composite parent = null;
private List<DAChartSeries> seriesList = new ArrayList<DAChartSeries>();
private DAChartPlot plot = null;
}
break;
case SWT.MouseEnter:
- System.out.println("MouseEnter");
+ DA_LOG.debug("MouseEnter");
if (null != plot) {
Shell shell = parent.getShell();
DAChartTooltip.getInstance().open(shell, plot);
}
break;
case SWT.MouseExit:
- System.out.println("MouseExit");
+ DA_LOG.debug("MouseExit");
DAChartTooltip.getInstance().close();
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
public class DAChartRenderer {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final int MARGIN = 3;
private static final int ARROW_MARGIN = 2;
private static final int EVENT_WIDTH = 2;
drawStepSeries(gc, series, false);
break;
default:
- System.out.println("Undefined series style");
+ DA_LOG.debug("Undefined series style");
break;
}
}
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.IDACustomButtonRenderer;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
public class DACustomCombo extends Canvas {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static final int MAX_SIZE = 10;
public static final int STATE_NORMAL = 0;
public static final int STATE_HOVER = 1;
@Override
public void selectionEvent(DACustomCombo combo) {
- System.out.println("default selection" + combo.getText()); //$NON-NLS-1$
+ DA_LOG.debug("default selection" + combo.getText()); //$NON-NLS-1$
}
};
}
getRects().clear();
- System.out.println("rects clear and add new rects. count is :"
+ DA_LOG.debug("rects clear and add new rects. count is :"
+ boundSize);
for (int i = 0; i < boundSize; i++) {
Rectangle r = new Rectangle(2, 2 + i * height, shellWidth - 2,
itemIndex *= MAX_SIZE;
index %= MAX_SIZE;
} else if (index < 0) {
- System.out.println("Combo indexing bug!");
+ DA_LOG.debug("Combo indexing bug!");
return false;
}
selection = index;
childShell.close();
childShell = null;
} else {
- System.out
- .println("combo timer bug : try close child shell ");
+ DA_LOG.debug("combo timer bug : try close child shell ");
}
}
});
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
import org.tizen.dynamicanalyzer.widgets.animation.DAAnimationIcon;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
public class Progress extends Canvas {
+ private static final DALogger DA_LOG = DALogger.getInstance();
public static final int PROGRESS_STYLE_BAR_ALONE = 0;
public static final int PROGRESS_STYLE_DEFAULT = 1;
e.gc.setForeground(barOutlineColor);
e.gc.drawRectangle(barRect);
} else {
- System.out.println("invalid progress style..."); //$NON-NLS-1$
+ DA_LOG.debug("invalid progress style..."); //$NON-NLS-1$
}
}
};
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
public class TimerClock extends Canvas {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static class TimeString {
public String hour;
if (null != timer) {
timer.cancel();
timer = null;
- System.out.println("timer canceled!! "); //$NON-NLS-1$
+ DA_LOG.debug("timer canceled!! "); //$NON-NLS-1$
}
}
import java.io.File;
import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.util.FileUtil;
import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class Application implements IApplication {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final String LOG_PREFIX = "da_log_";
private static final int MAX_LOG_COUNT = 3;
+
+ private static class MultiOutput extends OutputStream {
+ OutputStream[] outputStreams;
+
+ public MultiOutput(OutputStream... outputStreams) {
+ this.outputStreams = outputStreams;
+ }
+
+ @Override
+ public void write(int b) throws IOException {
+ for (OutputStream out : outputStreams) {
+ out.write(b);
+ }
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException {
+ for (OutputStream out : outputStreams) {
+ out.write(b);
+ }
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ for (OutputStream out : outputStreams) {
+ out.write(b, off, len);
+ }
+ }
+
+ @Override
+ public void flush() throws IOException {
+ for (OutputStream out : outputStreams) {
+ out.flush();
+ }
+ }
+
+ @Override
+ public void close() throws IOException {
+ for (OutputStream out : outputStreams) {
+ out.close();
+ }
+ }
+ }
@Override
public Object start(IApplicationContext context) throws Exception {
e.printStackTrace();
}
+ DA_LOG.performance("TEST", DALogger.testState.START);
+
// set log postfix
SimpleDateFormat format = new SimpleDateFormat(
"yyyy_MM_dd_HH-mm-ss", Locale.KOREA); //$NON-NLS-1$
PathManager.setLogPostFix(logPostFix);
// check for log to file
- String logtofile = PathManager.DA_DATA_PATH + File.separator
- + PathConstants.DA_STDOUT_TO_FILE;
- File ltofile = new File(logtofile);
- if (ltofile != null && ltofile.exists()) {
+// String logtofile = PathManager.DA_DATA_PATH + File.separator
+// + PathConstants.DA_STDOUT_TO_FILE;
+// File ltofile = new File(logtofile);
+// if (ltofile != null && ltofile.exists()) {
String logPath = PathManager.DA_LOG_PATH;
File logs = new File(logPath);
if (!logs.exists() && !logs.mkdirs()) {
- System.out
- .println("Log directory create failed.. log file create failed...");
+ DA_LOG.debug("Log directory create failed.. log file create failed...");
} else {
String logFileName = LOG_PREFIX + logPostFix;//$NON-NLS-1$
logPath += File.separator + logFileName;
-
+
File logfile = new File(logPath);
FileOutputStream fos = new FileOutputStream(logfile);
- PrintStream ps = new PrintStream(fos);
- System.setOut(ps);
- System.setErr(ps);
+
+ MultiOutput multiSysOut = new MultiOutput(System.out, fos);
+ MultiOutput multiSysErr = new MultiOutput(System.err, fos);
+
+ PrintStream out = new PrintStream(multiSysOut);
+ PrintStream err = new PrintStream(multiSysErr);
+
+ System.setOut(out);
+ System.setErr(err);
checkLogs(logs.getPath());
}
- }
-
+// }
+
// check for multiple instance of dynamic analyzer
if (SingletonFocusManager.acquireSingleton()) {
- System.out.println("The First DA Running");
+ DA_LOG.info("The First DA Running");
} else {
- System.out.println("Already DA Running");
+ DA_LOG.info("Already DA Running");
SingletonFocusManager.setFocusToDA();
System.exit(-1);
}
+
+ // for performance test
+ String[] argv = (String[]) context.getArguments().get(
+ "application.args");//$NON-NLS-1$
+
+ for(int i = 0; i < argv.length; i++)
+ {
+ if(argv[i].startsWith("isAutoStart"))
+ {
+ ApplicationWorkbenchWindowAdvisor.setAutoStart(true);
+ }
+ else if(argv[i].equals("--autoclose"))
+ {
+ ApplicationWorkbenchWindowAdvisor.setAutoClose(true);
+ }
+ else if(argv[i].equals("--device"))
+ {
+ ApplicationWorkbenchWindowAdvisor.setAutoStart_Device(argv[i+1]);
+ i++;
+ }
+ else if(argv[i].equals("--appid"))
+ {
+ ApplicationWorkbenchWindowAdvisor.setAutoStart_Appid(argv[i+1]);
+ i++;
+ }
+ else if(argv[i].equals("--appname"))
+ {
+ ApplicationWorkbenchWindowAdvisor.setAutoStart_Appname(argv[i+1]);
+ i++;
+ }
+ else if(argv[i].equals("--savepath"))
+ {
+ ApplicationWorkbenchWindowAdvisor.setAutoStart_Resultpath(argv[i+1]);
+ i++;
+ }
+ }
int returnCode = PlatformUI.createAndRunWorkbench(display,
new ApplicationWorkbenchAdvisor());
private static final int MIN_HEIGHT = 600;
private int width = DEFAULT_WIDTH;
private int height = DEFAULT_HEIGHT;
+
+ static String autostart_device = "";
+ static String autostart_appid = "";
+ static String autostart_appname = "";
+ static String autostart_resultpath = "";
+ static boolean isAutoStart = false;
+ static boolean isAutoClose = false;
public ApplicationWorkbenchWindowAdvisor(
IWorkbenchWindowConfigurer configurer) {
}
public void postWindowOpen() {
- // call the registered callback functions
- ExecutionCallbackManager
- .executeCallback(ExecutionCallbackManager.WINDOWADVISOR_POSTWINDOWOPEN);
+ String[] msg = null;
+ if(!autostart_device.isEmpty() && !autostart_appid.isEmpty()
+ && !autostart_appname.isEmpty() && !autostart_resultpath.isEmpty()) {
+ msg = new String[5];
+ if(isAutoClose)
+ msg[0] = "AUTOCLOSE";
+ else
+ msg[0] = "AUTOTEST";
+ msg[1] = autostart_device;
+ msg[2] = autostart_appid;
+ msg[3] = autostart_appname;
+ msg[4] = autostart_resultpath;
+
+ // call the registered callback functions
+ ExecutionCallbackManager
+ .executeCallback(ExecutionCallbackManager.WINDOWADVISOR_POSTWINDOWOPEN, msg);
+ } else {
+ // call the registered callback functions
+ ExecutionCallbackManager
+ .executeCallback(ExecutionCallbackManager.WINDOWADVISOR_POSTWINDOWOPEN);
+ }
+
}
public boolean preWindowShellClose() {
return true;
}
+
+ public static void setAutoStart(boolean status) {
+ isAutoStart = status;
+ }
+
+ public static void setAutoClose(boolean status) {
+ isAutoClose = status;
+ }
+
+ public static void setAutoStart_Device(String device) {
+ autostart_device = device;
+ }
+
+ public static void setAutoStart_Appid(String appid) {
+ autostart_appid = appid;
+ }
+
+ public static void setAutoStart_Appname(String appname) {
+ autostart_appname = appname;
+ }
+
+ public static void setAutoStart_Resultpath(String path) {
+ autostart_resultpath = path;
+ }
}
import org.tizen.dynamicanalyzer.common.path.PathConstants;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class SingletonFocusManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static FileChannel singletonChannel = null;
private static FileLock singletonLock = null;
if (activator != null) {
returnStr = new String[] { activator, strPid };
} else {
- System.out.println("Failed - not Support OS");
+ DA_LOG.error("Failed - not Support OS");
}
}
+ PathConstants.SINGLETON_PID_FILE);
if (!singletonFile.isFile()) {
- System.out.println("Failed get pid - exist config file");
+ DA_LOG.debug("Failed get pid - exist config file");
} else {
BufferedReader in = null;
try {
File daSaveFile = new File(saveFolderPath);
if (!daSaveFile.isDirectory() && !daSaveFile.mkdirs()) {
- System.out.println("da save file create failed...");
+ DA_LOG.debug("da save file create failed...");
} else {
String activeFilePath = saveFolderPath + File.separator
+ PathConstants.SINGLETON_LOCK_FILE;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.ImageListSortComparator;
import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
public class AnalyzerManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static Project project = null;
private static boolean isRunning = false;
private static boolean isLogParsingComplete = false;
AnalyzerManager.removeFromProjectList(sourcePath);
if (success) {
// logs for debug
- System.out.println("invalid project deleted!"); //$NON-NLS-1$
+ DA_LOG.debug("invalid project deleted!"); //$NON-NLS-1$
} else {
- System.out.println("invalid project delete fail..."); //$NON-NLS-1$
+ DA_LOG.debug("invalid project delete fail..."); //$NON-NLS-1$
}
}
}
if (!AnalyzerManager.isExit()) {
Project project = new Project();
project.init();
+ DA_LOG.performance("TEST", "Start Trace", "Create and Initialize Project data");
}
if (!AnalyzerManager.isExit()) {
AnalyzerUtil.executeCommand(StartHandler.ID);
+ DA_LOG.performance("TEST", "Start Trace", "Execute command - StartHandler");
}
}
import org.tizen.dynamicanalyzer.listeners.AnalyzerPerspectiveListener;\r
import org.tizen.dynamicanalyzer.sql.SqlManager;\r
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
+import org.tizen.dynamicanalyzer.util.DALogger;\r
\r
public class AnalyzerPlugin extends AbstractUIPlugin {\r
-\r
+ private static final DALogger DA_LOG = DALogger.getInstance();\r
+ \r
private static AnalyzerPlugin plugin;\r
\r
public static AnalyzerPlugin getDefault() {\r
File tempDir = new File(PathManager.DA_TEMP_FOLDER_PATH);\r
if (tempDir.isDirectory() && tempDir.exists()) {\r
if (AnalyzerUtil.deleteFile(tempDir)) {\r
- System.out.println("Delete temp folder!"); //$NON-NLS-1$\r
+ DA_LOG.debug("Delete temp folder!"); //$NON-NLS-1$\r
} else {\r
- System.out.println("Delete temp folder fail..."); //$NON-NLS-1$\r
+ DA_LOG.debug("Delete temp folder fail..."); //$NON-NLS-1$\r
}\r
}\r
}\r
File saveFolder = new File(PathManager.DA_TEMP_FOLDER_PATH);\r
if (saveFolder.exists()) {\r
if (AnalyzerUtil.deleteFile(saveFolder)) {\r
- System.out.println("delete temp folder");\r
+ DA_LOG.debug("delete temp folder");\r
} else {\r
- System.out\r
- .println("BUG: temp folder is already exists but failed to delete");\r
+ DA_LOG.debug("BUG: temp folder is already exists but failed to delete");\r
}\r
}\r
if (!saveFolder.isDirectory()) {\r
if (!saveFolder.mkdirs()) {\r
- System.out.println("save folder create failed...");\r
+ DA_LOG.debug("save folder create failed...");\r
}\r
}\r
\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.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.common;
+
+import java.util.List;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.model.DeviceInfo;
+import org.tizen.dynamicanalyzer.project.AppInfo;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.DALogger;
+import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.InternalLogManager;
+import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
+import org.tizen.dynamicanalyzer.workbench.SingletonFocusManager;
+
+public class AutoStartManager implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
+ // private final int MSG_INDEX_CMD = 0;
+ private static final int MSG_INDEX_DEVICE = 1;
+ private static final int MSG_INDEX_APPID = 2;
+ private static final int MSG_INDEX_APPNAME = 3;
+ private static final int MSG_INDEX_RESULTPATH = 4;
+ private static final int MSG_LENGTH = 5;
+ private static final int APPNAME_LENGTH = 20;
+
+ private static boolean openWelcomeDlg = false;
+ private static Boolean waitingWelcomeDlg = false;
+ public static boolean isAutoClose = false;
+
+ private static String[] strMsg = null;
+
+ // trace Application
+ public static void autoStartApplication(String[] message) {
+ strMsg = message;
+ Thread thread = new Thread(new AutoStartManager());
+ thread.start();
+ }
+
+ public static boolean isOpenWelcomeDlg() {
+ return openWelcomeDlg;
+ }
+
+ public static void setOpenWelcomeDlg(boolean data) {
+ openWelcomeDlg = data;
+ }
+
+ public static Boolean getWaitingWelcomeDlg() {
+ return waitingWelcomeDlg;
+ }
+
+ @Override
+ public void run() {
+ if (strMsg.length < MSG_LENGTH) {
+ DA_LOG.debug("wrong message format!!");
+ return;
+ }
+
+ if (strMsg[0].equals("AUTOCLOSE")) {
+ isAutoClose = true;
+ }
+
+ ToolbarArea.getInstance().setToolbarStartStopState(false);
+ final String deviceName = new String(strMsg[MSG_INDEX_DEVICE].trim());
+ final String appid = new String(strMsg[MSG_INDEX_APPID].trim());
+ final String appName = new String(strMsg[MSG_INDEX_APPNAME].trim());
+ final String resultPath = new String(
+ strMsg[MSG_INDEX_RESULTPATH].trim());
+
+ if (!resultPath.isEmpty()) {
+ DA_LOG.setPerformanceSaveFilename(resultPath);
+ }
+
+ if (isOpenWelcomeDlg()) {
+ DA_LOG.debug("Start -AutoRun Waiting...");
+ synchronized (getWaitingWelcomeDlg()) {
+ try {
+ getWaitingWelcomeDlg().wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ DA_LOG.debug("End - AutoRun Waiting");
+ }
+
+ DA_LOG.debug("auto start : " + appid);
+ DeviceInfo device = DACommunicator.getDeviceByName(deviceName);
+ DACommunicator.setSelectedDevice(device);
+
+ List<AppInfo> appList = DACommunicator.getSelectedDevice().getAppInfoList();
+
+ AppInfo appInfo = null;
+ for (int i = 0; i < appList.size(); i++) {
+ if (appid.equals(appList.get(i).getInfo(AppInfo.PACKAGE_INDEX))) {
+ appInfo = appList.get(i);
+ break;
+ }
+ }
+
+ if (null == appInfo) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
+ DADialog warning = new DADialog(shell, SWT.NONE);
+ String name = appName;
+ if (name.length() > APPNAME_LENGTH) {
+ name = appName.substring(0, APPNAME_LENGTH - 1) + "...";//$NON-NLS-1$
+ }
+ warning.setMessage(name + " is not supported application");
+ warning.setIcon(ImageResources.DIALOG_WARNING_ICON);
+ warning.open();
+
+ ToolbarArea.getInstance().setToolbarStartStopState(true);
+ }
+ });
+ DA_LOG.debug("invalid application name :" + appid);
+ return;
+ }
+ final String appLabel = appInfo.getInfo(AppInfo.LABEL_INDEX);
+ DA_LOG.debug("IDE recv - deviceName: " + deviceName
+ + " appName : " + appLabel);
+
+ ToolbarArea.getInstance().setDeviceComboText(deviceName);
+ ToolbarArea.getInstance().setAppComboText(appLabel);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ ToolbarArea.getInstance().startTrace();
+ }
+ });
+
+ SingletonFocusManager.setFocusToDA();
+ }
+}
*/
package org.tizen.dynamicanalyzer.common;
+import org.tizen.dynamicanalyzer.util.DALogger;
+
public enum HostResult {
SUCCESS(0, "Success!"),
ERR_UNDEFINED(-999, "Unknown error");
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private String message;
private String method;
private final String errMsg;
public static HostResult printAndReturn(HostResult result) {
result.setMethod(getMethodName(2) + "()");
- System.out.println(result.getMethod());
+ DA_LOG.debug(result.getMethod());
return result;
}
import org.tizen.dynamicanalyzer.callback.IExecutionCallback;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.WelcomeDialog;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
public class PostWindowOpenCallback implements IExecutionCallback {
+ private final static DALogger DA_LOG = DALogger.getInstance();
@Override
public void execute() {
if (!ConfigurationDialogDataManager.getInstance().isShowInital()) {
final Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
WelcomeDialog dialog = new WelcomeDialog(shell); // FIXME
+ DA_LOG.performance("TEST", "DA Start", "Welcome Dialog");
dialog.open();
}
}
+
+ public void execute(String[] msg) {
+ execute();
+
+ if (msg != null) {
+ AutoStartManager.autoStartApplication(msg);
+ }
+ }
}
DACommunicator.stopTrace();
}
- AnalyzerUtil.executeCommand(ExitHandler.ID);
+ AnalyzerUtil.executeCommand(ExitHandler.ID);
+ }
+
+ public void execute(String[] msg) {
+ execute();
}
}
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class SymbolManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static Map<IPath, WeakReference<IEDCSymbolReader>> readerCache = new HashMap<IPath, WeakReference<IEDCSymbolReader>>();
private static Map<String, WeakReference<Elf>> elfCache = new HashMap<String, WeakReference<Elf>>();
int length = mangled.trim().length();
length = (length > 128) ? 128 : length;
demangled = mangled.trim().substring(0, length - 1);
- System.out.println("demangling failed :" + mangled); //$NON-NLS-1$
+ DA_LOG.debug("demangling failed :" + mangled); //$NON-NLS-1$
}
return demangled;
}
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class Communicator22 extends BaseCommunicator {
+ private static final DALogger DA_LOG = DALogger.getInstance();
protected int remotePort = -1;
private Socket controlSock = null;
public HostResult startTrace() {
HostResult result = connectionProcess();
if (!result.equals(HostResult.SUCCESS)) {
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
/* Timeline */
UpdateViewTimer.start();
- System.out
- .println("Start recorder, timer, log parser, file, thread, ui, profile , update timer");
+ DA_LOG.debug("Start recorder, timer, log parser, file, thread, ui, profile , update timer");
result = HostResult.SUCCESS;
result.setMessage("start trace");
} else {
HostResult result = handleControlMessage(message);
if (result.equals(HostResult.SUCCESS)) {
- System.out.println("screenshot message ack :" + result.getMessage());
+ DA_LOG.debug("screenshot message ack :" + result.getMessage());
String[] splitResult = result.getMessage().split(
CommonConstants.CMD_SPLIT_READ);
if (AnalyzerConstants.MSG_OK.equals(splitResult[0])) {
String message = AnalyzerConstants.MSG_START
+ CommonConstants.CMD_SPLIT + rearMessage.length()
+ CommonConstants.CMD_SPLIT + rearMessage;
- System.out.println("Send message :" + message); //$NON-NLS-1$
+ DA_LOG.debug("Send message :" + message); //$NON-NLS-1$
HostResult result = handleControlMessage(message);
if (result.equals(HostResult.SUCCESS)) {
- System.out.println("start message ack :" + result.getMessage());
+ DA_LOG.debug("start message ack :" + result.getMessage());
String[] splitResult = result.getMessage().split(
CommonConstants.CMD_SPLIT_READ);
if (AnalyzerConstants.MSG_OK.equals(splitResult[0])) {
if (DACommunicator.isRunning()) {
String message = AnalyzerConstants.MSG_STOP
+ CommonConstants.CMD_SPLIT + 0 + CommonConstants.CMD_SPLIT;
- System.out.println("stop send message :" + message);
+ DA_LOG.debug("stop send message :" + message);
result = handleControlMessage(message);
if (result.equals(HostResult.SUCCESS)) {
- System.out.println("stop message ack :" + result.getMessage());
+ DA_LOG.debug("stop message ack :" + result.getMessage());
String[] splitResult = result.getMessage().split(
CommonConstants.CMD_SPLIT_READ);
if (AnalyzerConstants.MSG_OK.equals(splitResult[0])) {
controlWriter.flush();
}
- System.out.println("wait for ack... [send message : " + message
- + " ]");
+ DA_LOG.debug("wait for ack... [send message : " + message+ " ]");
while (DACommunicator.isRunning()) {
char cbuf[] = new char[64];
blocked = true;
HostResult result = null;
// step 1. check readelf and upload
if (CommunicatorUtils.getReadelfSize() < 0) {
- System.out.println("upload readelf");
+ DA_LOG.debug("upload readelf");
result = CommunicatorUtils.uploadReadElf();
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
if (!result.isSuccess()) {
return result;
}
// step 4. port foward
result = CommunicatorUtils.foward(CommunicatorUtils.LOCAL_PORT,
remotePort);
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
if (!HostResult.SUCCESS.equals(result)) {
return result;
}
result = createControlSocket(CommunicatorUtils.LOCAL_PORT);
if (!result.equals(HostResult.SUCCESS)) {
DACommunicator.setRunning(false);
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
return result;
}
result = createDataSocket(CommunicatorUtils.LOCAL_PORT);
if (!result.equals(HostResult.SUCCESS)) {
DACommunicator.setRunning(false);
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
return result;
}
controlSock = new Socket(CommonConstants.LOCAL_HOST, port);
if (null == controlSock) {
result = HostResult.ERR_CONTROL_SOCKET_CREATION_FAIL;
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
return result;
}
} catch (SocketTimeoutException e) {
result = HostResult.ERR_EXCEPTION_OCCURRED;
result.setMessage(e.getMessage());
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
e.printStackTrace();
} catch (UnknownHostException e) {
result = HostResult.ERR_EXCEPTION_OCCURRED;
dataSock = new Socket(CommonConstants.LOCAL_HOST, port);
if (null == dataSock) {
result = HostResult.ERR_DATA_SOCKET_CREATION_FAIL;
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
return result;
}
new Thread(null, new ReceiveCommunicator(),
AnalyzerConstants.COMMUNICATOR_RECEIVE_THREAD).start();
- System.out.println("Receive Thread start");
+ DA_LOG.debug("Receive Thread start");
} catch (SocketTimeoutException e) {
result = HostResult.ERR_EXCEPTION_OCCURRED;
result.setMessage(e.getMessage());
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
e.printStackTrace();
} catch (UnknownHostException e) {
result = HostResult.ERR_EXCEPTION_OCCURRED;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.model.DeviceInfo;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.sdblib.IDevice;
import org.tizen.sdblib.IShellOutputReceiver;
import org.tizen.sdblib.exception.SdbCommandRejectedException;
import org.tizen.sdblib.service.SyncService;
public class CommunicatorUtils {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static List<String> uploadDataResult = new ArrayList<String>();
private static boolean isArch = false;
private static final int PORT_WAIT_TIME = 5 * 1000 * 2; // ms
if (file.exists()) {
readelfSize = file.length();
} else {
- System.out.println("upload error! file is not exist : " + source); //$NON-NLS-1$
+ DA_LOG.debug("upload error! file is not exist : " + source); //$NON-NLS-1$
return HostResult.ERR_FILE_IS_NOT_EXISTS;
}
return HostResult.ERR_READELF_SIZE_GET_FAILED;
}
if (readelfSize != uploadSize) {
- System.out.println("readelf file size is different!! "); //$NON-NLS-1$
+ DA_LOG.debug("readelf file size is different!! "); //$NON-NLS-1$
return HostResult.ERR_READELF_UPLOAD_FAILED;
}
return HostResult.printAndReturn(result);
HostResult ret = HostResult.SUCCESS;
SyncResult result = push(device, source, targetPath);
if (null == result || !result.isOk()) {
- System.out.println("upload to" + targetPath + " is failed! "); //$NON-NLS-1$ //$NON-NLS-2$
+ DA_LOG.debug("upload to" + targetPath + " is failed! "); //$NON-NLS-1$ //$NON-NLS-2$
if (null != result) {
ret = HostResult.ERR_UPLOAD_FILE_FAILED;
ret.setMessage(result.getMessage());
- System.out.println(ret.toString() + " : " + ret.getMessage()); //$NON-NLS-1$
+ DA_LOG.debug(ret.toString() + " : " + ret.getMessage()); //$NON-NLS-1$
} else {
ret = HostResult.ERR_SDB_PUSH_FAILED;
- System.out.println(ret.toString());
+ DA_LOG.debug(ret.toString());
}
return ret;
}
String line = portLines.get(0);
try {
remotePort = Integer.parseInt(line);
- System.out.println(" !! \nport get success!! : "
+ DA_LOG.debug(" !! \nport get success!! : "
+ remotePort);
break;
} catch (NumberFormatException e) {
Thread.sleep(10);
} catch (InterruptedException e) {
// e.printStackTrace();
- System.out.println("Interrupt occurred - Getting port number");
+ DA_LOG.debug("Interrupt occurred - Getting port number");
break;
}
}
public static void unfoward(IDevice device, int local, int remote) {
if (null != device && isOnline(device)) {
try {
- System.out.println("unfoward!!");
+ DA_LOG.debug("unfoward!!");
device.removeForward(local, remote);
Thread.sleep(AnalyzerConstants.SOCKET_FORWARD_INTERVAL);
} catch (TimeoutException e) {
SyncResult res = CommunicatorUtils.pull(device,
PathConstants.DA_API_MAP_PATH, apiFilePath);
if (null != res && res.isOk()) {
- System.out.println("api map copying success!!");//$NON-NLS-1$
+ DA_LOG.debug("api map copying success!!");//$NON-NLS-1$
} else {
- System.out.println("Failed to get " + apiFilePath); //$NON-NLS-1$
+ DA_LOG.debug("Failed to get " + apiFilePath); //$NON-NLS-1$
return null;
}
File file = new File(apiFilePath);
if (!file.exists()) {
- System.out.println("file open failed...");
+ DA_LOG.debug("file open failed...");
return null;
}
try {
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.sdblib.IDevice;
import org.tizen.sdblib.IDeviceChangeListener;
import org.tizen.sdblib.SmartDevelopmentBridge;
import org.tizen.sdblib.service.SyncResult;
public class DACommunicator {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static int MSG_TYPE_CONFIG = 0;
public static int MSG_TYPE_SWAP_INST = 1;
public static int READ_BUFFER_SIZE = 1024;
for (DeviceInfo device : devices) {
HostResult result = device.initCommunicator();
if (!result.isSuccess()) {
- System.out.println("init failed : "
+ DA_LOG.debug("init failed : "
+ device.getIDevice().getSerialNumber());
}
}
}
}
} else {
- System.out.println("sdbbridge is null!");
+ DA_LOG.debug("sdbbridge is null!");
}
}
return HostResult.ERR_INVALID_VERSION;
} else {
version = checkVersionResult.get(0);
- System.out.println("version :" + version);
+ DA_LOG.debug("version :" + version);
if (version.contains(DA_VERSION_SWAP)) {
info.setTargetVersion(version);
result = HostResult.SUCCESS;
@Override
public void onDisconnected(IDevice device) {
// called : each device disconnected time
- System.out.println("device disconnected : "
+ DA_LOG.debug("device disconnected : "
+ device.getSerialNumber());
DeviceInfo deviceInfo = getDeviceByName(device.getSerialNumber());
DeviceInfo selectedDevice = getSelectedDevice();
if (isRunning()) {
if (selectedDevice.getIDevice().getSerialNumber()
.equals(deviceInfo.getIDevice().getSerialNumber())) {
- System.out.println("Disconnected while DA is running."); //$NON-NLS-1$
+ DA_LOG.debug("Disconnected while DA is running."); //$NON-NLS-1$
UIRecorderTool.getInstance().stop();
DACommunicator.setRunning(false);
}
@Override
public void onConnected(IDevice device) {
// It called when dynamic-analyzer start, only one time
- System.out
- .println("device connected : " + device.getSerialNumber());
+ DA_LOG.debug("device connected : " + device.getSerialNumber());
// addDevice(device);
if (!AnalyzerManager.isRunning()) {
DeviceInfo devInfo = new DeviceInfo(device);
public void onChanged(IDevice device, int changeMask) {
// called : device added - already dynamic-analyzer running (not
// tracing)
- System.out.println("device changed : " + device.getSerialNumber()
+ DA_LOG.debug("device changed : " + device.getSerialNumber()
+ " " + changeMask);
if (1 == changeMask) {
if (!AnalyzerManager.isRunning()) {
});
}
} else {
- System.out.println("device changed type :" + changeMask);
+ DA_LOG.debug("device changed type :" + changeMask);
}
}
};
+ DAEMONLOG_PREFIX + PathManager.getLogPostFix();//$NON-NLS-1$
SyncResult res = CommunicatorUtils.pull(from, to);
if (null != res && res.isOk()) {
- System.out.println("daemon log copying success!!");//$NON-NLS-1$
+ DA_LOG.debug("daemon log copying success!!");//$NON-NLS-1$
} else {
- System.out.println("Failed to get " + from); //$NON-NLS-1$
+ DA_LOG.debug("Failed to get " + from); //$NON-NLS-1$
}
AnalyzerUtil.checkLogs(PathManager.DA_LOG_PATH, DAEMONLOG_PREFIX,
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
import org.tizen.dynamicanalyzer.workbench.SingletonFocusManager;
public class IDECommunicator implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final int MAXBUFSIZE = 1024;
private static final String IDE_DA_COMMUNICATION_TYPE_1 = "STATUS";//$NON-NLS-1$
daServerSocket = setServePort(); // Server Bind
if (daServerSocket != null) {
if (savePortToFile() != true) { // Save Server port
- System.out.println("failed Save Server port");
+ DA_LOG.debug("failed Save Server port");
errorMessageBox();
return;
}
if (setCheckFileLock() != true) {
- System.out.println("failed socket File Lock");
+ DA_LOG.debug("failed socket File Lock");
errorMessageBox();
return;
}
while (true) {
try {
- System.out.println("Waiting IDE Client : "
+ DA_LOG.debug("Waiting IDE Client : "
+ ideClientSocketArray.size());
lastCommunicationIdeSocket = daServerSocket.accept();
ideClientSocketArray.add(lastCommunicationIdeSocket);
- System.out.println("Connected IDE : "
+ DA_LOG.debug("Connected IDE : "
+ ideClientSocketArray.size());
} catch (IOException e) {
e.printStackTrace();
while (true) {
try {
in = clientSocket.getInputStream();
- System.out.println("IDE recvMessage Wait : "
+ DA_LOG.debug("IDE recvMessage Wait : "
+ ideClientSocketArray.size());
readSize = in.read(receiveBuffer);
if (readSize > 0) {
parsingReceiveMessage(new String(
receiveBuffer));
} else {
- System.out.println("Disconnected IDE : "
+ DA_LOG.debug("Disconnected IDE : "
+ ideClientSocketArray.size());
clientSocket.close();
ideClientSocketArray.remove(clientSocket);
}
};
acceptThread.start();
- System.out.println("Start IDE AcceptThread");
+ DA_LOG.debug("Start IDE AcceptThread");
}
}
}
autoStartApplication(strMsg);
}
} else {
- System.out.println(" wrong receive message ");//$NON-NLS-1$
+ DA_LOG.debug(" wrong receive message ");//$NON-NLS-1$
}
}
// trace Application
private void autoStartApplication(String[] strMsg) {
if (strMsg.length < MSG_LENGTH) {
- System.out.println("wrong message format!!");
+ DA_LOG.debug("wrong message format!!");
return;
}
ToolbarArea.getInstance().setToolbarStartStopState(false);
final String appName = new String(strMsg[MSG_INDEX_APPNAME].trim());
if (isOpenWelcomeDlg()) {
- System.out.println("Start -AutoRun Waiting...");
+ DA_LOG.debug("Start -AutoRun Waiting...");
synchronized (getWaitingWelcomeDlg()) {
try {
getWaitingWelcomeDlg().wait((long)configurationWaitingTimeMs);
e.printStackTrace();
}
}
- System.out.println("End - AutoRun Waiting");
+ DA_LOG.debug("End - AutoRun Waiting");
}
- System.out.println("auto start : " + appid);
+ DA_LOG.debug("auto start : " + appid);
DeviceInfo device = DACommunicator.getDeviceByName(deviceName);
DACommunicator.setSelectedDevice(device);
ToolbarArea.getInstance().setToolbarStartStopState(true);
}
});
- System.out.println("invalid application name :" + appid);
+ DA_LOG.debug("invalid application name :" + appid);
return;
}
final String appLabel = appInfo.getInfo(AppInfo.LABEL_INDEX);
- System.out.println("IDE recv - deviceName: " + deviceName
+ DA_LOG.debug("IDE recv - deviceName: " + deviceName
+ " appName : " + appLabel);
Display.getDefault().syncExec(new Runnable() {
serverSocket = getServerSocket(0);
if (serverSocket != null) {
serverPort = serverSocket.getLocalPort();
- System.out.println("IDE-DA Server port " + serverPort); //$NON-NLS-1$
+ DA_LOG.debug("IDE-DA Server port " + serverPort); //$NON-NLS-1$
return serverSocket;
} else {
- System.out.println("failed Set Serve Socket"); //$NON-NLS-1$
+ DA_LOG.debug("failed Set Serve Socket"); //$NON-NLS-1$
}
return serverSocket;
}
import java.util.List;
import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class SqlConnectionManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static Connection connection = null;
connection = DriverManager.getConnection(dbUrl, "SA", "");
SQLWarning warning = connection.getWarnings();
while (warning != null) {
- System.out.println("[DB] Message: "
+ DA_LOG.debug("[DB] Message: "
+ warning.getMessage());
- System.out.println("[DB] SQL state: "
+ DA_LOG.debug("[DB] SQL state: "
+ warning.getSQLState());
- System.out.println("[DB] Vendor code: "
+ DA_LOG.debug("[DB] Vendor code: "
+ warning.getErrorCode());
warning = warning.getNextWarning();
}
connection.close();
} catch (SQLException se) {
if (!se.getSQLState().equals("XJ015")) {
- System.out.println("DB did not shutdown normally");
+ DA_LOG.debug("DB did not shutdown normally");
}
}
connection = null;
int datasize = data.size();
int columnsize = columnType.size();
if (columnsize != questionCount) {
- System.out
- .println("[ERR] column count of columnType is not matches!!");
+ DA_LOG.error("column count of columnType is not matches!!");
return;
}
} else if (columnType.get(i).equals(
DBConstants.INTEGER)) {
if (col == null) {
- System.out
- .println("[ERR] Integer column data is null !!");
+ DA_LOG.error("Integer column data is null !!");
isPrepared = false;
break;
} else {
} else if (columnType.get(i).equals(
DBConstants.LONG)) {
if (col == null) {
- System.out
- .println("[ERR] Long column data is null !!");
+ DA_LOG.error("Long column data is null !!");
isPrepared = false;
break;
} else {
prep.setLong(i + 1, (Long) col);
}
} else {
- System.out
- .println("[ERR] not supported DB column type!!");
+ DA_LOG.error("not supported DB column type!!");
isPrepared = false;
break;
}
e.printStackTrace();
}
} else { // column count is not equal
- System.out
- .println("[ERR] column count is not equal !!");
+ DA_LOG.error("column count is not equal !!");
}
}
.contains(DBConstants.VARCHAR)) {
rowData.add(rs.getString(i));
} else {
- System.out.println("[ERR] undefined type : "
+ DA_LOG.error("undefined type : "
+ rsMetaData.getColumnTypeName(i));
}
}
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
public class OpenTraceCompleteHandler extends AbstractHandler {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static String ID = OpenTraceCompleteHandler.class.getName();
@Override
page.updateView();
}
});
- System.out.println("open trace complete!!"); //$NON-NLS-1$
+ DA_LOG.debug("open trace complete!!"); //$NON-NLS-1$
return null;
}
import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;\r
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;\r
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
+import org.tizen.dynamicanalyzer.util.DALogger;\r
import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;\r
import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;\r
import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;\r
\r
public class OpenTraceHandler extends AbstractHandler {\r
-\r
+ private static final DALogger DA_LOG = DALogger.getInstance();\r
+ \r
public static final String ID = OpenTraceHandler.class.getName();\r
Project project = null;\r
\r
project.getSavePath());\r
\r
if (null == pInfo || pInfo.isEmpty()) {\r
- System.out.println("The trace file is invalid."); //$NON-NLS-1$\r
+ DA_LOG.debug("The trace file is invalid."); //$NON-NLS-1$\r
createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_VERSION_INVALID_REMOVE);\r
AnalyzerUtil.executeCommand(ClearHandler.ID);\r
return null;\r
List<List<String>> dbInfo = SqlManager.getInstance()\r
.getCallStackDataFromTable();\r
if (null == dbInfo) {\r
- System.out.println("failed - loadCallStackData");\r
+ DA_LOG.debug("failed - loadCallStackData");\r
isSuccess = false;\r
} else {\r
for (int i = 0; i < dbInfo.size(); i++) {\r
List<List<String>> dbInfo = SqlManager.getInstance()\r
.setloadCallStackApis();\r
if (null == dbInfo) {\r
- System.out.println("failed - loadCallStackApis");\r
+ DA_LOG.debug("failed - loadCallStackApis");\r
isSuccess = false;\r
} else {\r
BaseCallstackManager callstackManager = AnalyzerManager\r
boolean isSuccess = true;\r
List<List<String>> dbInfo = SqlManager.getInstance().loadTargetInfo();\r
if (null == dbInfo) {\r
- System.out.println("failed - loadTargetInfo");\r
+ DA_LOG.debug("failed - loadTargetInfo");\r
isSuccess = false;\r
} else {\r
List<String> info = dbInfo.get(0);\r
String option = " where pid = " + pids.get(h);\r
dbInfo = SqlManager.getInstance().loadProcessInfo(option);\r
if (null == dbInfo) {\r
- System.out.println("failed - load Process Info");\r
+ DA_LOG.debug("failed - load Process Info");\r
isSuccess = false;\r
continue;\r
} else {\r
List<List<String>> objInfo = SqlManager.getInstance()\r
.loadLibObj(subOption);\r
if (null == objInfo) {\r
- System.out.println("failed - load Lib Object");\r
+ DA_LOG.debug("failed - load Lib Object");\r
isSuccess = false;\r
continue;\r
} else {\r
}\r
dbInfo = SqlManager.getInstance().loadApiNames();\r
if (null == dbInfo) {\r
- System.out.println("failed - load Api names");\r
+ DA_LOG.debug("failed - load Api names");\r
isSuccess = false;\r
} else {\r
List<String> apiList = ApiNameManager.getApiList();\r
boolean isSuccess = true;\r
List<List<String>> dbInfo = SqlManager.getInstance().setloadLeakData();\r
if (null == dbInfo) {\r
- System.out.println("leak data loading failed..");\r
+ DA_LOG.debug("leak data loading failed..");\r
isSuccess = false;\r
} else {\r
LeakDetector leakDectector = AnalyzerManager.getLeakDetector();\r
List<List<String>> dbInfo = SqlManager.getInstance()\r
.setloadFailedData();\r
if (null == dbInfo) {\r
- System.out.println("failed - loadFailedData");\r
+ DA_LOG.debug("failed - loadFailedData");\r
isSuccess = false;\r
} else {\r
FailedChecker failedChecker = AnalyzerManager.getFailedChecker();\r
List<List<String>> dbInfo = SqlManager.getInstance()\r
.setloadProfilingData();\r
if (null == dbInfo) {\r
- System.out.println("failed - loadProfilingData");\r
+ DA_LOG.debug("failed - loadProfilingData");\r
isSuccess = false;\r
} else {\r
for (int i = 0; i < dbInfo.size(); i++) {\r
List<List<String>> dbInfo = SqlManager.getInstance()\r
.setloadProfilingChildData();\r
if (null == dbInfo) {\r
- System.out.println("failed - loadProfilingChildData");\r
+ DA_LOG.debug("failed - loadProfilingChildData");\r
isSuccess = false;\r
} else {\r
for (int i = 0; i < dbInfo.size(); i++) {\r
import org.tizen.dynamicanalyzer.swap.platform.BinarySettingManager;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.workbench.SingletonFocusManager;
public class AnalyzerPerspectiveListener extends PerspectiveAdapter {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static boolean init = false;
@Override
if (!init) {
ToolbarArea.getInstance().initToolbarEnablement();
+ DA_LOG.performance("TEST", "DA Start", "Init Toolbar Enablement - Host launch");
DACommunicator.reload();
DACommunicator.addDeviceListener();
DACommunicator.loadDevices();
DACommunicator.updateToolbarDevice();
+ DA_LOG.performance("TEST", "DA Start", "Device Connection");
BinarySettingManager.getInstance().initBinarySettings();
+ DA_LOG.performance("TEST", "DA Start", "Target Binary Setting");
SingletonFocusManager.saveSingletonPid();
IDECommunicator.startIDECommunicatorThread();
+ DA_LOG.performance("TEST", "DA Start", "Start IDE Communicator");
ConfigurationDialogDataManager.getInstance()
.updateFeaturesValueFromConfigureManager();
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.util.DALogger;
;
public class InsertLogQueue {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final int FULL_COUNT = 10000;
public boolean isWait = false;
List<LogPackage> logs = null;
try {
wait();
} catch (InterruptedException e) {
- System.out.println("insert log queue interrupt called!!"); //$NON-NLS-1$
+ DA_LOG.debug("insert log queue interrupt called!!"); //$NON-NLS-1$
continue;
}
}
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
+import org.tizen.dynamicanalyzer.util.DALogger;
/** log insert into database **/
public class LogInserter implements Runnable {
-
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static Thread insertLogThread = null;
private static InsertLogQueue insertLogQueue = null;
private static boolean isCompleted = false;
try {
sendNotify();
insertLogThread.join(AnalyzerManager.INSERT_JOIN_WAIT_TIME);
- System.out.println("insert thread join complete!!"); //$NON-NLS-1$
+ DA_LOG.debug("insert thread join complete!!"); //$NON-NLS-1$
} catch (InterruptedException e) {
e.printStackTrace();
}
logPackage.clear();
} catch (InterruptedException e) {
- System.out.println("insert log thread interrupted"); //$NON-NLS-1$
+ DA_LOG.debug("insert log thread interrupted"); //$NON-NLS-1$
break;
}
}
import org.tizen.dynamicanalyzer.ui.page.BaseView;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.ImageUtil;
import org.tizen.sdblib.service.SyncResult;
public class LogParser implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private final String OSP_MAIN = "OspMain"; //$NON-NLS-1$
private static Thread logParser = null;
private static boolean dropCallTraceLog = false;
logQueue.notifyAll();
}
try {
- System.out.println("wait for log parser join");//$NON-NLS-1$
+ DA_LOG.debug("wait for log parser join");//$NON-NLS-1$
logParser.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
/* log for debug */
- System.out.println("log parsing thread end!!"); //$NON-NLS-1$
+ DA_LOG.debug("log parsing thread end!!"); //$NON-NLS-1$
AnalyzerManager.setLogParsingComplete(true);
if (!AnalyzerManager.isExit()) {
front = ByteUtils.getByte(pid, pcAddr, tid, cpuNum);
} else {
if (id == DataChannelConstants.MSG_PROBE_SCREENSHOT) {
- System.out.println("debug ");
+ DA_LOG.debug("debug ");
}
newLog = new String[10];
// api id
newLog[9] = CommonConstants.EMPTY;
if (id == DataChannelConstants.MSG_PROBE_LIFECYCLE) {
- System.out.println("life cycle");
+ DA_LOG.debug("life cycle");
}
int apiId = ApiNameManager.getApiId(newLog[0]);
int pid = initIntPayload(newLog[1]);
result = ByteUtils.concatByteArray(front, rear);
break;
case DataChannelConstants.MSG_PROBE_NETWORK:
- System.out.println("case AnalyzerConstants.MSG_PROBE_NETWORK");
+ DA_LOG.debug("case AnalyzerConstants.MSG_PROBE_NETWORK");
break;
case DataChannelConstants.MSG_PROBE_GLES20:
apiType = Integer
import java.util.List;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
/** log queue model **/
public class LogQueue {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final int FULL_COUNT = 10000;
private List<List<String>> data = null;
}
wait();
} catch (InterruptedException e) {
- System.out.println("log queue interrupt!!"); //$NON-NLS-1$
+ DA_LOG.debug("log queue interrupt!!"); //$NON-NLS-1$
continue;
}
}
import org.tizen.dynamicanalyzer.uirecorder.RecordingQueue;
import org.tizen.dynamicanalyzer.uirecorder.UIRecorderRecordThread;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class MessageProcess {
+ private static final DALogger DA_LOG = DALogger.getInstance();
final int MSG_ID_INDEX = 0;
final int MSG_LENGTH_INDEX = 1;
}
}
} // end while()
- System.out.println("Receive thread end!!");
+ DA_LOG.debug("Receive thread end!!");
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
});
endingSteps();
} catch (IOException e) {
- System.out
- .println("### socket timeout - TODO: show this as a dialog."); //$NON-NLS-1$
+ DA_LOG.debug("### socket timeout - TODO: show this as a dialog."); //$NON-NLS-1$
Display.getDefault().asyncExec(new Runnable() {
@Override
}
private void endingSteps() {
- System.out.println("Ending steps!");
+ DA_LOG.debug("Ending steps!");
message = null;
DACommunicator.setRunning(false);
// AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
});
stopTimer();
addBufferToList();
- System.out.println("stop log process start");//$NON-NLS-1$
+ DA_LOG.debug("stop log process start");//$NON-NLS-1$
StopLogProcessor.runStopLogProcessThread();
DACommunicator.closeAll();
AnalyzerUtil.executeCommand(StopHandler.ID);
import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class Project {
// public static final String TABLE_NAME = "project";
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static final String VERSION = "version";
private static final String PROTOCOL_VERSION = "protocolVersion";
+ AnalyzerConstants.IMAGE_FOLDER_NAME);
if (!imgFolder.isDirectory()) {
if (!imgFolder.mkdirs()) {
- System.out.println("image directory create failed...");
+ DA_LOG.debug("image directory create failed...");
} else {
File smallImage = new File(getSavePath() + File.separator
+ AnalyzerConstants.IMAGE_FOLDER_NAME + File.separator
+ AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME);
if (!smallImage.isDirectory()) {
if (!smallImage.mkdirs()) {
- System.out
- .println("small image directory create failed...");
+ DA_LOG.debug("small image directory create failed...");
}
}
}
String projectInfoFilePath = "";
Project project = AnalyzerManager.getProject();
if (null == project || !project.isValid()) {
- System.out.println("project not saved");
+ DA_LOG.debug("project not saved");
} else {
projectInfoFilePath = PathManager.getProjectInfoPath(project
.getSavePath());
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton;
public class ShortCutKeyBindingHandler extends AbstractHandler {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private int CTRL_STATE_MASK = SWT.CTRL;
private static int KEY_1 = 49;
}
if (e.keyCode == SWT.F1) {
- System.out.println("about");
+ DA_LOG.debug("about");
Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
AboutDialog dialog = new AboutDialog(shell);
dialog.open();
} else if (e.keyCode == SWT.F2) {
- System.out.println("configuration");
+ DA_LOG.debug("configuration");
Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
ConfigurationDialog dialog = new ConfigurationDialog(shell);
dialog.open();
} else if (e.keyCode == SWT.F3) {
- System.out.println("view source toggle");
+ DA_LOG.debug("view source toggle");
DACustomToggleButton button = (DACustomToggleButton) ToolbarArea
.getInstance().getButton(ToolbarArea.SOURCE_BUTTON);
button.setToggled(!button.isToggled());
}
// ctrl + number 1 ~ 6 page
else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == KEY_1) {
- System.out.println("timeline page");
+ DA_LOG.debug("timeline page");
AnalyzerUtil.changePage(TimelinePage.pageID);
} else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == KEY_4) {
- System.out.println("file page");
+ DA_LOG.debug("file page");
AnalyzerUtil.changePage(FilePage.pageID);
} else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == KEY_3) {
- System.out.println("NetworkPage page");
+ DA_LOG.debug("NetworkPage page");
AnalyzerUtil.changePage(NetworkPage.pageID);
} else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == KEY_2) {
- System.out.println("thread page");
+ DA_LOG.debug("thread page");
AnalyzerUtil.changePage(ThreadPage.pageID);
} else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == KEY_6) {
- System.out.println("ui page");
+ DA_LOG.debug("ui page");
AnalyzerUtil.changePage(UIPage.pageID);
} else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == KEY_5) {
- System.out.println("Graphics page");
+ DA_LOG.debug("Graphics page");
AnalyzerUtil.changePage(GLPage.pageID);
} else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == KEY_7) {
- System.out.println("Kernel page");
+ DA_LOG.debug("Kernel page");
AnalyzerUtil.changePage(KernelPage.pageID);
} else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == KEY_8) {
- System.out.println("summary page");
+ DA_LOG.debug("summary page");
AnalyzerUtil.changePage(SummaryPage.pageID);
} else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == KEY_9) {
- System.out.println("range page");
+ DA_LOG.debug("range page");
AnalyzerUtil.changePage(RangePage.pageID);
}
// ctrl + t = 116
// 103 -> g
else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == 103) {
if (!AnalyzerManager.isRunning()) {
- System.out.println("start trace");
+ DA_LOG.debug("start trace");
enabled = false;
- System.out.println("start trace start");
+ DA_LOG.debug("start trace start");
ToolbarArea.getInstance().startTrace();
- System.out.println("start trace end");
+ DA_LOG.debug("start trace end");
} else {
- System.out.println("stop trace");
+ DA_LOG.debug("stop trace");
enabled = false;
ToolbarArea.getInstance().stopTrace();
}
}
// o
else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == 111) {
- System.out.println("open trace");
+ DA_LOG.debug("open trace");
if (!AnalyzerManager.isRunning()) {
Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
OpenTraceDialog dialog = new OpenTraceDialog(shell);
}
// s
else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == 115) {
- System.out.println("save trace");
+ DA_LOG.debug("save trace");
if (ToolbarArea.getInstance().getButton(ToolbarArea.SAVE_BUTTON)
.isButtonEnabled()) {
Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
}
// p
else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == 112) {
- System.out.println("replay ");
+ DA_LOG.debug("replay ");
if (!AnalyzerManager.isRunning()) {
DACustomButton button = (DACustomButton) ToolbarArea
.getInstance().getButton(ToolbarArea.REPLAY_BUTTON);
}
// r
else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == 114) {
- System.out.println("range ");
+ DA_LOG.debug("range ");
if (RangeDataManager.getInstance().isBeingAnalyzed()) {
RangeDataManager.getInstance().initRange();
} else {
}
// e
else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == 101) {
- System.out.println("replay Edit");
+ DA_LOG.debug("replay Edit");
if (!AnalyzerManager.isRunning()) {
Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
ReplayEditDialog dialog = new ReplayEditDialog(shell);
import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingChildData;
import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class SqlManager {
// private static final int PERMIT = 1;
// private Semaphore semaphore = new Semaphore(PERMIT);
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static SqlManager instance = null;
private Connection connection = null;
replayConnection = DriverManager.getConnection(dbUrl, "SA", "");
SQLWarning warning = replayConnection.getWarnings();
while (warning != null) {
- System.out.println("Message: " + warning.getMessage());
- System.out.println("SQL state: " + warning.getSQLState());
- System.out.println("Vendor code: " + warning.getErrorCode());
+ DA_LOG.debug("Message: " + warning.getMessage());
+ DA_LOG.debug("SQL state: " + warning.getSQLState());
+ DA_LOG.debug("Vendor code: " + warning.getErrorCode());
warning = warning.getNextWarning();
}
} catch (ClassNotFoundException e) {
connection = DriverManager.getConnection(dbUrl, "SA", "");
SQLWarning warning = connection.getWarnings();
while (warning != null) {
- System.out.println("Message: " + warning.getMessage());
- System.out.println("SQL state: " + warning.getSQLState());
- System.out.println("Vendor code: " + warning.getErrorCode());
+ DA_LOG.debug("Message: " + warning.getMessage());
+ DA_LOG.debug("SQL state: " + warning.getSQLState());
+ DA_LOG.debug("Vendor code: " + warning.getErrorCode());
warning = warning.getNextWarning();
}
} catch (ClassNotFoundException e) {
replayConnection.close();
} catch (SQLException se) {
if (!se.getSQLState().equals("XJ015")) {
- System.out.println("DB did not shutdown normally");
+ DA_LOG.debug("DB did not shutdown normally");
}
}
replayConnection = null;
connection.close();
} catch (SQLException se) {
if (!se.getSQLState().equals("XJ015")) {
- System.out.println("DB did not shutdown normally");
+ DA_LOG.debug("DB did not shutdown normally");
}
}
connection = null;
String tableName = lf.getName();
String dropTableQuery = createDropTableQuery(tableName);
if (isQueryPrint) {
- System.out.println("query : " + dropTableQuery);
+ DA_LOG.debug("query : " + dropTableQuery);
}
stat.executeUpdate(dropTableQuery);
String createTableQuery = createTableQuery(lf);
if (isQueryPrint) {
- System.out.println("query : " + createTableQuery);
+ DA_LOG.debug("query : " + createTableQuery);
}
stat.executeUpdate(createTableQuery);
executeCreateIndexTable(stat, tableName, "time");//$NON-NLS-1$//$NON-NLS-2$
executeUpdateCreateTable(stat, createIndexTable);
} catch (SQLException e) {
e.printStackTrace();
- System.out.println("table name : " + tableName);
+ DA_LOG.debug("table name : " + tableName);
}
}
List<DBTableInfo> tableInfos = dbManager.getTableInfos();
for (DBTableInfo info : tableInfos) {
if (!executeUpdateCreateTable(stat, info.createQuery())) {
- System.out.println("table create failed..."
+ DA_LOG.debug("table create failed..."
+ info.getTableName());
}
}
throws SQLException {
if (!AnalyzerManager.isExit()) {
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
stat.executeUpdate(query);
return true;
// semaphoreAcquire();
Connection conn = getConnection();
if (null == conn || null == query || null == input) {
- System.out.println("failed sql inset : " + input);
+ DA_LOG.debug("failed sql inset : " + input);
return false;
}
prep = conn.prepareStatement(query);
insertQuery(insertQuery, insetData);
} else {
- System.out.println("[ERR] insert project info failed!!");
+ DA_LOG.error("insert project info failed!!");
}
}
insertQuery(insertQuery, insetData);
} else {
- System.out.println("[ERR] insert target info failed!!");
+ DA_LOG.error("insert target info failed!!");
}
}
}
}
} else {
- System.out.println("[ERR] insert process info failed!!");
+ DA_LOG.error("insert process info failed!!");
}
}
insertQuery(insertQuery, insetData);
} else {
- System.out.println("[ERR] insert library object failed!!");
+ DA_LOG.error("insert library object failed!!");
}
}
try {
Connection conn = getConnection();
if (null == conn || null == query || null == input) {
- System.out.println("failed sql inset : " + input);
+ DA_LOG.debug("failed sql inset : " + input);
return false;
}
semaphoreAcquire();
try {
Connection conn = getConnection();
if (null == conn || null == query || null == input) {
- System.out.println("insert leak data failed.. : " + input);
+ DA_LOG.debug("insert leak data failed.. : " + input);
return false;
}
semaphoreAcquire();
try {
Connection conn = getConnection();
if (null == conn || null == query || null == input) {
- System.out.println("failed sql inset : " + input);
+ DA_LOG.debug("failed sql inset : " + input);
return false;
}
semaphoreAcquire();
Connection conn = getConnection();
if (null == conn || null == query || null == input
|| input.isEmpty()) {
- System.out.println("failed sql inset : " + input);
+ DA_LOG.debug("failed sql inset : " + input);
return false;
}
semaphoreAcquire();
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
prep = conn.prepareStatement(query);
int dataRowSize = input.size();
return null;
}
if (null == tableName || tableName.length() < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return null;
}
StringBuilder columns = new StringBuilder();
if (null == columnName || columnName.length < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return null;
} else {
for (int i = 0; i < columnName.length; i++) {
semaphoreAcquire();
stat = conn.createStatement();
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
rs = stat.executeQuery(query);
if (null != rs) {
return null;
}
if (null == tableName || tableName.length() < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return null;
}
StringBuilder columns = new StringBuilder();
if (null == columnName || columnName.length < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return null;
} else {
for (int i = 0; i < columnName.length; i++) {
semaphoreAcquire();
stat = conn.createStatement();
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
rs = stat.executeQuery(query);
if (null != rs) {
}
}
} catch (SQLException e) {
- System.out.println("SQLException - selecte : " + query);
+ DA_LOG.debug("SQLException - selecte : " + query);
e.printStackTrace();
} finally {
semaphoreRelease();
return null;
}
if (null == tableName || tableName.length() < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return null;
}
StringBuilder columns = new StringBuilder();
if (null == columnName || columnName.length < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return null;
} else {
for (int i = 0; i < columnName.length; i++) {
semaphoreAcquire();
stat = conn.createStatement();
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
rs = stat.executeQuery(query);
if (null != rs) {
rowData.add(rs.getString(rsMetaData
.getColumnName(i)));
} else {
- System.out.println("Error undefine Type : "
+ DA_LOG.debug("Error undefine Type : "
+ rsMetaData.getColumnTypeName(i));
}
}
}
} catch (SQLException e) {
- System.out.println("SQLException - selecte : " + query);
+ DA_LOG.debug("SQLException - selecte : " + query);
e.printStackTrace();
} finally {
CommonUtil.tryClose(stat, rs);
return null;
}
if (null == tableName || tableName.length() < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return null;
}
semaphoreAcquire();
stat = conn.createStatement();
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
rs = stat.executeQuery(query);
if (null != rs) {
}
}
} catch (SQLException e) {
- System.out.println("SQLException - selecte : " + query);
+ DA_LOG.debug("SQLException - selecte : " + query);
e.printStackTrace();
} finally {
CommonUtil.tryClose(stat, rs);
conn = getConnection(dbFilePath);
}
if (null == tableName || tableName.length() < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return null;
}
StringBuilder columns = new StringBuilder();
if (null == columnName || columnName.size() < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return null;
} else {
int csize = columnName.size();
semaphoreAcquire();
stat = conn.createStatement();
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
rs = stat.executeQuery(query);
if (null != rs) {
rowData.add(rs.getString(rsMetaData
.getColumnName(i)));
} else {
- System.out.println("Error undefine Type : "
+ DA_LOG.error("Error undefine Type : "
+ rsMetaData.getColumnTypeName(i));
}
}
}
} catch (SQLException e) {
- System.out.println("SQLException - selecte : " + query);
+ DA_LOG.debug("SQLException - selecte : " + query);
e.printStackTrace();
} finally {
CommonUtil.tryClose(stat, rs);
}
semaphoreAcquire();
if (null == tableName || tableName.length() < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return 0;
}
}
stat = conn.createStatement();
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
rs = stat.executeQuery(query);
if (null == rs) {
}
} catch (SQLException e) {
do {
- System.out.println("query: " + query);
- System.out.println("Message: " + e.getMessage());
- System.out.println("SQL state: " + e.getSQLState());
- System.out.println("Vendor code: " + e.getErrorCode());
+ DA_LOG.debug("query: " + query);
+ DA_LOG.debug("Message: " + e.getMessage());
+ DA_LOG.debug("SQL state: " + e.getSQLState());
+ DA_LOG.debug("Vendor code: " + e.getErrorCode());
e.printStackTrace();
} while ((e = e.getNextException()) != null);
} finally {
}
semaphoreAcquire();
if (null == tableName || tableName.length() < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return 0;
}
stat = conn.createStatement();
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
rs = stat.executeQuery(query);
if (null == rs) {
}
} catch (SQLException e) {
do {
- System.out.println("query: " + query);
- System.out.println("Message: " + e.getMessage());
- System.out.println("SQL state: " + e.getSQLState());
- System.out.println("Vendor code: " + e.getErrorCode());
+ DA_LOG.debug("query: " + query);
+ DA_LOG.debug("Message: " + e.getMessage());
+ DA_LOG.debug("SQL state: " + e.getSQLState());
+ DA_LOG.debug("Vendor code: " + e.getErrorCode());
e.printStackTrace();
} while ((e = e.getNextException()) != null);
} finally {
}
semaphoreAcquire();
if (null == tableName || tableName.length() < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
return 0;
}
String optionQuery = CommonConstants.EMPTY;
tableName, optionQuery);
stat = conn.createStatement();
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
rs = stat.executeQuery(query);
if (null == rs) {
}
} catch (SQLException e) {
do {
- System.out.println("query: " + query);
- System.out.println("Message: " + e.getMessage());
- System.out.println("SQL state: " + e.getSQLState());
- System.out.println("Vendor code: " + e.getErrorCode());
+ DA_LOG.debug("query: " + query);
+ DA_LOG.debug("Message: " + e.getMessage());
+ DA_LOG.debug("SQL state: " + e.getSQLState());
+ DA_LOG.debug("Vendor code: " + e.getErrorCode());
e.printStackTrace();
} while ((e = e.getNextException()) != null);
} finally {
stat = conn.createStatement();
query = "select * from replay order by time, rid";
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
rs = stat.executeQuery(query);
if (null == rs) {
output.setObjectCount(eventObjs.size());
} catch (SQLException e) {
- System.out.println("SQLException - select : " + query);
+ DA_LOG.debug("SQLException - select : " + query);
e.printStackTrace();
} finally {
CommonUtil.tryClose(stat, rs);
// }
// }
if (isQueryPrint) {
- System.out.println("query : " + queryBuffer.toString());
+ DA_LOG.debug("query : " + queryBuffer.toString());
}
stat.executeUpdate(queryBuffer.toString());
} catch (SQLException e) {
conn = getConnection();
}
if (null == conn || null == query || null == input) {
- System.out.println("failed sql inset : " + input);
+ DA_LOG.debug("failed sql inset : " + input);
return false;
}
semaphoreAcquire();
if (isQueryPrint) {
- System.out.println("query : " + query);
+ DA_LOG.debug("query : " + query);
}
prep = conn.prepareStatement(query);
int dataRowSize = input.size();
prep.executeBatch();
conn.setAutoCommit(true);
} catch (SQLException e) {
- System.out.println("[Error insert] query = " + query);
+ DA_LOG.error("[Error insert] query = " + query);
e.printStackTrace();
} finally {
if (null != prep) {
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackItem;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class SWAPCallStackManager extends BaseCallstackManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
public void makeUserCallstack(LogData input, ProfileDataMaker profiler) {
ProfileData log = (ProfileData) input;
getCallStackDataBySeqMap().put(seq, callstackData);
seqByTimeMap.put(time, seq);
} else {
- System.out
- .println("makeUserCallstack : EXIT self is not the same as top of user callstack");
+ DA_LOG.debug("makeUserCallstack : EXIT self is not the same as top of user callstack");
}
if (AnalyzerManager.isOsp()) {
String apiName = log.getApiName();
probeCallstack.set(size - 1, new CallStackItem(
callerCallstackUnit));
} else {
- System.out
- .println("bug : probe caller is not the same as top of user callstack"); //$NON-NLS-1$
+ DA_LOG.debug("probe caller is not the same as top of user callstack"); //$NON-NLS-1$
}
}
selfCallstackUnit)) {
dupUserCall.increaseDupCallCount();
} else {
- System.out
- .println("isIrregularUserCall : dup callstack check error"); //$NON-NLS-1$
+ DA_LOG.debug("isIrregularUserCall : dup callstack check error"); //$NON-NLS-1$
}
}
return true;
dupUserCallMap.remove(tid);
}
} else {
- System.out
- .println("isIrregularUserCall : dup callstack check error"); //$NON-NLS-1$
+ DA_LOG.debug("isIrregularUserCall : dup callstack check error"); //$NON-NLS-1$
}
return true;
}
import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class BasicDataMessage {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static final int INT_SIZE = CommonConstants.INT_SIZE;
public static final int ID_SIZE = INT_SIZE;
public static final int SEQ_SIZE = INT_SIZE;
.getNano();
if (0 == startSec && 0 == startNano) {
- System.out
- .println("BUG!!! - if show this log then process info is not comming or late!!");
+ DA_LOG.debug("if show this log then process info is not comming or late!!");
startTime.setSec(sec);
startTime.setNano(nano);
AnalyzerManager.getProject().setProfileStartTime(startTime);
public void printMessage() {
if (PRINT_DATA) {
String strId = String.format("%4x", id);
- System.out.println("Message [id : " + strId + "] [seq :" + seq
+ DA_LOG.debug("Message [id : " + strId + "] [seq :" + seq
+ "] [ Time : " + time + " ms]");
ByteUtils.printByteArray(payload);
}
import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
import org.tizen.sdblib.exception.SdbCommandRejectedException;
import org.tizen.sdblib.exception.TimeoutException;
import org.tizen.sdblib.service.SyncResult;
public class Communicator30 extends BaseCommunicator {
-
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
static final boolean PRINT_CONTROL_LOG_TOFILE = true;
private PrintWriter printWriter = null;
// connect ecs server
if (devInfo.isEmulator()) {
if (!SocketClient.getInstance().connect()) {
- System.out.println("[warn] Connect to ecs server is failed");
+ DA_LOG.warning("Connect to ecs server is failed");
}
devInfo.emulatorScreenshot = new EmulatorScreenshot();
}
// daemon start
Process ps = CommunicatorUtils.execCommand(devInfo.getIDevice(),
AnalyzerShellCommands.DACOMMAND_RUN_MANAGER);
- System.out.println(ps.toString());
+ DA_LOG.debug(ps.toString());
// get port
int remotePort = CommunicatorUtils.getRemotePort(devInfo.getIDevice());
if (remotePort < 0) {
- System.out.println(devInfo.getIDevice().getSerialNumber()
+ DA_LOG.debug(devInfo.getIDevice().getSerialNumber()
+ " remote port get failed and remove this device : "
+ devInfo.getIDevice().getSerialNumber());
return HostResult.ERR_REMOTE_PORT_GET_FAILED;
// step 4. port foward
HostResult result = CommunicatorUtils.foward(devInfo.getIDevice(),
CommunicatorUtils.LOCAL_PORT, remotePort);
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
if (!HostResult.SUCCESS.equals(result)) {
- System.out.println(devInfo.getIDevice().getSerialNumber()
+ DA_LOG.debug(devInfo.getIDevice().getSerialNumber()
+ " port fowarding failed and remove this device");
return HostResult.ERR_REMOTE_PORT_GET_FAILED;
}
// create control socket
HostResult result = createControlSocket(devInfo);
if (!result.isSuccess()) {
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
return HostResult.ERR_CONTROL_SOCKET_CREATION_FAIL;
} else {
result = createDataSocket(devInfo);
if (!result.isSuccess()) {
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
return HostResult.ERR_DATA_SOCKET_CREATION_FAIL;
}
}
// target info get
result = getTargetInfo(devInfo);
if (!result.isSuccess()) {
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
return HostResult.ERR_TARGET_INFO_GET_FAIL;
}
public HostResult startTrace() {
DACommunicator.setRunning(true);
UserSpaceInst userSpaceInst = getUserSpaceInst();
+ DA_LOG.performance("TEST", "Start Trace", "Set application inst");
byte[] replayData = AnalyzerManager.getProject().getReplayEvent();
byte[] rear = ByteUtils.getByte(userSpaceInst.getByteValue(),
replayData);
byte[] ret = ByteUtils.getByte(AnalyzerConstants.MSG_START_SWAP,
length, rear);
- System.out.println("print start message");
+ DA_LOG.debug("print start message");
// ByteUtils.printByteArrayForStart(ret);
if(PRINT_CONTROL_LOG_TOFILE) {
// start message send
HostResult result = handleControlMessage(
DACommunicator.getSelectedDevice(), ret);
+ DA_LOG.performance("TEST", "Start Trace", "Make and Send start message");
// FIX
if (!StartProcessManager.getInstance().isCancelled()) {
}
dataThread.start();
+ DA_LOG.performance("TEST", "Start Trace", "Start data receiving thread");
// success start trace!!
byte[] payload = getMessagePayload(result.getRet());
profilingStartTime.setNano(nano);
UIRecorderTool.getInstance().startRecorder();
+ DA_LOG.performance("TEST", "Start Trace", "Start recoding thread");
ToolbarArea.getInstance().startTimer();
+ DA_LOG.performance("TEST", "Start Trace", "Start Timer");
SWAPLogParser.startLogParser();
+ DA_LOG.performance("TEST", "Start Trace", "Start SWAP log parser thread");
// start registered data manager thread
DataManagerRegistry.startThreads();
+ DA_LOG.performance("TEST", "Start Trace", "Start DataManager threads");
/* Timeline */
UpdateViewTimer.start();
- System.out
- .println("Start recorder, timer, log parser, file, thread, ui, profile , update timer");
+ DA_LOG.performance("TEST", "Start Trace", "Start Update view timer");
+ DA_LOG.debug("Start recorder, timer, log parser, file, thread, ui, profile , update timer");
return result;
}
appInst.setApplicationId(app.getAppId());
appInst.setExecutablePath(app.getExecPath());
- System.out.println("Set execute path : " + app.getExecPath());
+ DA_LOG.debug("Set execute path : " + app.getExecPath());
BinaryInfo binInfo = app.getMainBinaryInfo();
List<AddrSymbolPair> symbols = app.getSymbols(binInfo
.getTempBinaryPath());
String line = reader.readLine();
String errorStr = error.readLine();
if (null == line) {
- System.out.println("host md5sum get failed : " + errorStr);
+ DA_LOG.debug("host md5sum get failed : " + errorStr);
result = HostResult.ERR_BIN_INFO_GET_FAIL;
continue;
}
SyncResult res = CommunicatorUtils.pull(from, to);
if (null != res && res.isOk()) {
- System.out.println("binary copy success!!");//$NON-NLS-1$
+ DA_LOG.debug("binary copy success!!");//$NON-NLS-1$
} else {
- System.out.println("Failed to get " + from); //$NON-NLS-1$
+ DA_LOG.debug("Failed to get " + from); //$NON-NLS-1$
return HostResult.ERR_BIN_INFO_GET_FAIL;
}
// binInfo.setLocalBinaryPath(localBinaryPath);
}
int msgId = ByteUtils.toInt(message);
- System.out.println("wait for ack... [send message : " + msgId
+ DA_LOG.debug("wait for ack... [send message : " + msgId
+ " ]");
int readsize = -1;
// read buffer size is sufficient??
byte[] cbuf = new byte[DACommunicator.READ_BUFFER_SIZE * 2];
blocked = true;
- System.out.println("blocked");
+ DA_LOG.debug("blocked");
readsize = controlSock.getInputStream().read(cbuf);
blocked = false;
if(PRINT_CONTROL_LOG_TOFILE && printWriter != null) {
printWriter.printf("\n");
}
- System.out.println("unblocked");
+ DA_LOG.debug("unblocked");
if (readsize > 0) {
byte[] buf = new byte[readsize];
System.arraycopy(cbuf, 0, buf, 0, readsize);
// for debug
System.out.print("ack id : ");
AnalyzerUtil.printHexdecimal(ackId);
- System.out.println();
+ DA_LOG.debug();
result.setRet(buf);
} else {
}
public HostResult getTargetInfo(DeviceInfo device) {
- System.out.println("Send target info : "
+ DA_LOG.debug("Send target info : "
+ ByteUtils.getByte(AnalyzerConstants.MSG_TARGET_INFO, 0));
HostResult result = handleControlMessage(device,
ByteUtils.getByte(AnalyzerConstants.MSG_TARGET_INFO, 0));
@Override
public HostResult sendKeepAliveMessage(DeviceInfo device) {
- System.out.println("Send keep alive message : "
+ DA_LOG.debug("Send keep alive message : "
+ ByteUtils.getByte(AnalyzerConstants.MSG_KEEP_ALIVE, 0));
HostResult result = handleControlMessage(device,
ByteUtils.getByte(AnalyzerConstants.MSG_KEEP_ALIVE, 0));
if (result.isSuccess()) {
- System.out
- .println("keep alive message ack :" + result.getMessage());
+ DA_LOG.debug("keep alive message ack :" + result.getMessage());
if (isCorrectAck(MSG_KEEP_ALIVE_ACK, result)) {
return result;
public void setSelectedApp(AppInfo app) {
HostResult hr = sendBinaryInfoMessage(app);
if (!hr.isSuccess()) {
- System.out.println("binary info get failed :" + hr.getMessage());
+ DA_LOG.debug("binary info get failed :" + hr.getMessage());
}
}
if (null != controlSock && !controlSock.isClosed()) {
controlSock.getOutputStream().write(msg);
} else {
- System.out.println("control socket is closed");
+ DA_LOG.debug("control socket is closed");
result = HostResult.ERR_CONTROL_SOCKET_CONNECTION_CLOSED;
}
} catch (SocketException e) {
index += INT_SIZE;
String localBinaryPath = null;
if (binCount != count) {
- System.out.println("BinInfo ack is not valid");
+ DA_LOG.debug("BinInfo ack is not valid");
return null;
}
for (int i = 0; i < binCount; i++) {
String line = reader.readLine();
String errorStr = error.readLine();
if (null == line) {
- System.out.println("host md5sum get failed : " + errorStr);
+ DA_LOG.error("host md5sum get failed : " + errorStr);
continue;
}
String[] splitResult = line.trim().split(CommonConstants.SPACE);
import org.tizen.dynamicanalyzer.common.HostResult;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.model.DeviceInfo;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class HeartBeatThread implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static int interval = 1000;
@Override
// System.out.println("Heart Beat!!");
HostResult result = DACommunicator.sendKeepAliveMessage(device);
if (!result.isSuccess()) {
- System.out.println(result.toString());
+ DA_LOG.debug(result.toString());
}
if (AnalyzerManager.isExit()) {
break;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.util.DALogger;
/** log queue model **/
public class LogQueue {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final int FULL_COUNT = 10000;
private static final int HALF_COUNT = 5000;
private List<List<LogData>> data = null;
}
wait();
} catch (InterruptedException e) {
- System.out.println("log queue interrupt!!"); //$NON-NLS-1$
+ DA_LOG.debug("log queue interrupt!!"); //$NON-NLS-1$
continue;
}
}
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
public class MessageParser {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
static final boolean PRINT_DATA_LOG_TOFILE = true;
static final int MSG_ID_INDEX = 0;
pInfo.setPid(pid);
pInfo.setPpid(ppid);
- System.out.println("process info start time : " + startTime.getSec()
+ DA_LOG.debug("process info start time : " + startTime.getSec()
+ " " + startTime.getNano() + " startTime : "
+ pInfo.getStartTime().getSec() + " "
+ pInfo.getStartTime().getNano());
ProcessInfoPackage pInfoPack = processPkgMap.get(pid);
if (null == pInfoPack) {
// bug!!!
- System.out.println("bug occurred!!");
+ DA_LOG.debug("bug occurred!!");
}
ProcessInfo lastProcessInfo = pInfoPack.getLastProcessInfo();
ProcessInfo pInfo = new ProcessInfo();
processMessage(buffer);
if (id == DataChannelConstants.MSG_DATA_TERMINATE) {
- System.out.println("message data terminate arrived!!!");
+ DA_LOG.debug("message data terminate arrived!!!");
+ DA_LOG.performance("TEST", "While tracing", "Terminate Application");
if (AnalyzerManager.getProcessCount() == 0) {
break;
}
}
} // end while()
- System.out.println("Receive thread end!!");
+ DA_LOG.debug("Receive thread end!!");
+ DA_LOG.performance("TEST", "DA end", "End receive thread");
if (!StartProcessManager.getInstance().isCancelled()){
Display.getDefault().asyncExec(new Runnable() {
@Override
}
endingSteps();
} catch (IOException e) {
- System.out
- .println("### socket timeout - TODO: show this as a dialog."); //$NON-NLS-1$
+ DA_LOG.debug("### socket timeout - TODO: show this as a dialog."); //$NON-NLS-1$
Display.getDefault().asyncExec(new Runnable() {
@Override
}
private void endingSteps() {
- System.out.println("Ending steps!");
+ DA_LOG.debug("Ending steps!");
DACommunicator.setRunning(false);
AnalyzerManager.setRunningState(false);
Display.getDefault().syncExec(new Runnable() {
}
});
stopTimer();
+ DA_LOG.performance("TEST", "DA end", "Stop timer");
addBufferToList();
+ DA_LOG.performance("TEST", "DA end", "Add buffer to list");
if (!StartProcessManager.getInstance().isCancelled()) {
- System.out.println("start!! : stop log process");//$NON-NLS-1$
+ DA_LOG.debug("start!! : stop log process");//$NON-NLS-1$
StopLogProcessor.runStopLogProcessThread();
}
AnalyzerUtil.executeCommand(StopHandler.ID);
+ DA_LOG.performance("TEST", "DA end", "Execute command - StopHandler");
AnalyzerManager.setProcessInfoArrived(false);
ReplayTraceHandler.isReplay = false;
ReplayTraceHandler.startTime = null;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.database.DBTable;
+import org.tizen.dynamicanalyzer.util.DALogger;
public abstract class PageDataManager implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private String name = null;
private Thread thread = null;
private ReadBlockingQueue<LogPackage> logPackQueue = new ReadBlockingQueue<LogPackage>();
sendNotify();
thread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
thread = null;
- System.out.println(getName() + " thread joined!"); //$NON-NLS-1$
+ DA_LOG.debug(getName() + " thread joined!"); //$NON-NLS-1$
} catch (InterruptedException e) {
e.printStackTrace();
}
import org.tizen.dynamicanalyzer.ui.info.screenshot.SocketClient;
import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.ImageUtil;
import org.tizen.dynamicanalyzer.utils.ImageUtilSWT;
import org.tizen.sdblib.service.SyncResult;
public class SWAPLogParser implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final String OSP_MAIN = "OspMain"; //$NON-NLS-1$
private static Thread logParser = null;
// default false, turn on when Tizen C++ app
logQueue.notifyAll();
}
try {
- System.out.println("wait for log parser join");//$NON-NLS-1$
+ DA_LOG.debug("wait for log parser join");//$NON-NLS-1$
logParser.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
/* log for debug */
- System.out.println("log parsing thread end!!"); //$NON-NLS-1$
+ DA_LOG.debug("log parsing thread end!!"); //$NON-NLS-1$
AnalyzerManager.setLogParsingComplete(true);
if (!AnalyzerManager.isExit()) {
+ File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
+ File.separator + fileName;
if (angle != 0) {
- System.out.println("[ image rotate : " + angle + " ]");
+ DA_LOG.debug("[ image rotate : " + angle + " ]");
}
new Thread(null, new Runnable() {
break;
} else {
- System.out.println("Failed to get '" + from + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
+ DA_LOG.debug("Failed to get '" + from + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
try {
Thread.sleep(1000);
count++;
final String fileName = getImageName(path);
if (angle != 0) {
- System.out.println("[ image rotate : " + angle + " ]");
+ DA_LOG.debug("[ image rotate : " + angle + " ]");
}
new Thread(null, new Runnable() {
break;
} else {
- System.out.println("Failed to get '" + path + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
+ DA_LOG.debug("Failed to get '" + path + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
try {
Thread.sleep(1000);
count++;
import java.util.List;
import org.tizen.dynamicanalyzer.utils.ByteSwapper;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class ByteUtils {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static byte EOS = '\0';
/**
}
public static void printByteArrayForStart(byte[] input) {
- System.out.println(" ====---- print byte array start----====");
+ DA_LOG.debug(" ====---- print byte array start----====");
int line = 0;
for (int i = 0; i < input.length; i++, line++) {
String b = String.format("%2x", input[i]);
System.out.print(" ");
}
if (line == 19) {
- System.out.println();
+ DA_LOG.debug();
line = -1;
}
}
- System.out.println(" ====---- print byte array end----====");
+ DA_LOG.debug(" ====---- print byte array end----====");
}
}
package org.tizen.dynamicanalyzer.swap.model.data;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class ArgsInfo {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
int lastIndex = 0;
String args = null;
}
String ret = args.substring(index + 2, args.length());
if (ret.equals("a")) {
- System.out.println("debug");
+ DA_LOG.debug("debug");
}
return ret;
}
import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
import org.tizen.dynamicanalyzer.swap.model.DATime;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public abstract class LogData implements Cloneable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static boolean isSWAP = false;
public static int STATE_COUNT = 4;
time = resultSec * 1000000 + resultNano / 1000;
if (time <= 0) {
- System.out.println("id : " + AnalyzerUtil.toHexdecimal(id)
+ DA_LOG.debug("id : " + AnalyzerUtil.toHexdecimal(id)
+ " time : " + time);
- System.out.println("profile start time : "
+ DA_LOG.debug("profile start time : "
+ startTime.toString() + " time : " + sec + ","
+ nano);
}
import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class BinarySettingManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static BinarySettingManager instance = null;
private HashMap<String, BinaryInfo> targetBinInfoMap = new HashMap<String, BinaryInfo>();
File rpms = new File(rpmPath);
if (!rpms.exists()) {
if (!rpms.mkdirs()) {
- System.out.println("rpm directory create failed...");
+ DA_LOG.debug("rpm directory create failed...");
continue;
}
}
while (null != (line = reader.readLine())) {
lineCount++;
if (lineCount == 1) {
- System.out.println("CHANGE DIR : " + line);
+ DA_LOG.debug("CHANGE DIR : " + line);
} else {
- System.out.println("EXTRACE RPM : " + line);
+ DA_LOG.debug("EXTRACE RPM : " + line);
}
}
if (lineCount == 0) {
new InputStreamReader(
process.getErrorStream()));
String errorStr = error.readLine();
- System.out
- .println("debug info file extract failed... : "
+ DA_LOG.debug("debug info file extract failed... : "
+ errorStr);
continue;
}
new InputStreamReader(
process.getErrorStream()));
String errorStr = error.readLine();
- System.out
- .println("debug source file extract failed... : "
+ DA_LOG.debug("debug source file extract failed... : "
+ errorStr);
continue;
}
debugFilePath = rpmPath
+ line.substring(1, line.length());
- System.out.println("DEBUG PATH : " + debugFilePath);
+ DA_LOG.debug("DEBUG PATH : " + debugFilePath);
} catch (IOException e) {
e.printStackTrace();
continue;
new InputStreamReader(
process.getErrorStream()));
String errorStr = error.readLine();
- System.out
- .println("source file path get failed.. : "
+ DA_LOG.debug("source file path get failed.. : "
+ errorStr);
continue;
}
sourceFilePath = rpmPath;
- System.out.println("SOURCE PATH : "
+ DA_LOG.debug("SOURCE PATH : "
+ sourceFilePath);
} catch (IOException e) {
e.printStackTrace();
new InputStreamReader(
process.getErrorStream()));
String errorStr = error.readLine();
- System.out
- .println("debug source file extract failed... : "
+ DA_LOG.debug("debug source file extract failed... : "
+ errorStr);
continue;
}
debugFilePath = rpmPath
+ line.substring(1, line.length());
- System.out.println("DEBUG PATH : " + debugFilePath);
+ DA_LOG.debug("DEBUG PATH : " + debugFilePath);
} catch (IOException e) {
e.printStackTrace();
continue;
BinarySettingManager.getInstance().putRealBinarySettingData(
binarySettings);
} catch (FileNotFoundException e) {
- System.out.println("BinarySettings.save file is not exist - normal operation");
+ DA_LOG.debug("BinarySettings.save file is not exist - normal operation");
} catch (IOException e) {
e.printStackTrace();
} finally {
String line = null;
while (null != (line = reader.readLine())) {
lineCount++;
- System.out.println("LINE (" + lineCount + ") : " + line);
+ DA_LOG.debug("LINE (" + lineCount + ") : " + line);
lines.add(line);
}
if (lineCount == 0) {
BufferedReader error = new BufferedReader(
new InputStreamReader(process.getErrorStream()));
String errorStr = error.readLine();
- System.out.println("find debug info path fail.. " + errorStr);
+ DA_LOG.error("find debug info path fail.. " + errorStr);
isDebugInfo = false;
}
} catch (IOException e) {
String line = null;
while (null != (line = reader.readLine())) {
lineCount++;
- System.out.println("LINE (" + lineCount + ") : " + line);
+ DA_LOG.debug("LINE (" + lineCount + ") : " + line);
lines.add(line);
}
if (lineCount == 0) {
BufferedReader error = new BufferedReader(
new InputStreamReader(process.getErrorStream()));
String errorStr = error.readLine();
- System.out.println("find debug info path fail.. "
+ DA_LOG.error("find debug info path fail.. "
+ errorStr);
return null;
}
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.tizen.dynamicanalyzer.swap.platform.ui.ExplorerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.sdblib.service.FileEntry;
import org.tizen.sdblib.service.FileEntryType;
public class DADeviceExplorer extends DeviceExplorer {
+ private static final DALogger DA_LOG = DALogger.getInstance();
public DADeviceExplorer(Composite parent) {
super(parent);
public void updateData() {
if (null == current) {
if (null == root) {
- System.out.println("Root is empty");
+ DA_LOG.debug("Root is empty");
return;
}
current = root;
import org.tizen.dynamicanalyzer.swap.platform.ui.FileExplorer.DAFileExplorerTableRenderer;
import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
import org.tizen.sdblib.service.FileEntryType;
public class DeviceExplorer extends Composite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
protected static int FAIL = -1;
protected static int FILE = 1;
protected static int DIRECTORY = 2;
GridItem selection = selections[0];
FileEntry file = (FileEntry) selection
.getData(ExplorerUtil.DATA_FIEL_KEY);
- System.out.println("Selected : " + file.getFullPath());
+ DA_LOG.debug("Selected : " + file.getFullPath());
selected = file;
inputText.setText(selected.getFullPath());
inputText.setBackground(ColorResources.WHITE);
public void handleClickEvent(DACustomButton button) {
String path = inputText.getText();
if (null == path || path.isEmpty()) {
- System.out.println("path must not empty");
+ DA_LOG.debug("path must not empty");
// inputText.setBackground(ColorResources.RED);
// info.setText("Empty path");
inputText.setText(current.getFullPath());
}
if (!path.contains(root.getFullPath())) {
- System.out.println("Out of root range");
+ DA_LOG.debug("Out of root range");
// inputText.setBackground(ColorResources.RED);
// info.setText("Out of root range");
inputText.setText(current.getFullPath());
public void updateData() {
if (null == current) {
if (null == root) {
- System.out.println("Root is empty");
+ DA_LOG.debug("Root is empty");
return;
}
current = root;
FileEntry rootDir = device.getFileEntry(r);
if (null == rootDir
|| (!rootDir.isDirectory() && !rootDir.isRoot())) {
- System.out.println("root path is invalid");
+ DA_LOG.debug("root path is invalid");
return;
} else {
root = rootDir;
if (null != path && !path.isEmpty()) {
FileEntry file = device.getFileEntry(path);
if (file == null || file.getType() == FileEntryType.Unknown) {
- System.out.println("invalid path");
+ DA_LOG.debug("invalid path");
return result;
} else if (!file.isDirectory() && !file.isRoot()) {
current = file.getParent();
import java.io.File;
+import org.tizen.dynamicanalyzer.util.DALogger;
+
public class ExplorerUtil {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static String PARENT_STR = "..";
public static int TYPE_DIR = 0;
} else if (file.isHidden()) {
return TYPE_HIDDEN;
} else {
- System.out.println("error : file type error");
+ DA_LOG.error("file type error");
return -1;
}
}
import org.tizen.dynamicanalyzer.swap.platform.ui.ExplorerUtil;
import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
import org.tizen.dynamicanalyzer.widgets.da.base.DAText;
public class DAFileExplorer extends Composite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static int FAIL = -1;
private static int FILE = 1;
GridItem[] selections = table.getSelection();
GridItem selection = selections[0];
File file = (File) selection.getData(ExplorerUtil.DATA_FIEL_KEY);
- System.out.println("Selected : " + file.getAbsolutePath());
+ DA_LOG.debug("Selected : " + file.getAbsolutePath());
selected = file;
String path = selected.getAbsolutePath();
public void handleClickEvent(DACustomButton button) {
String path = inputText.getText();
if (null == path || path.isEmpty()) {
- System.out.println("path must not empty");
+ DA_LOG.debug("path must not empty");
// inputText.setBackground(ColorResources.RED);
// info.setText("Empty path");
inputText.setText(current.getAbsolutePath());
}
if (!path.contains(root.getAbsolutePath())) {
- System.out.println("Out of root range");
+ DA_LOG.debug("Out of root range");
// inputText.setBackground(ColorResources.RED);
// info.setText("Out of root range");
inputText.setText(current.getAbsolutePath());
public void updateData() {
if (null == current) {
if (null == root) {
- System.out.println("Root is empty");
+ DA_LOG.debug("Root is empty");
return;
}
current = root;
if (null != r && !r.isEmpty()) {
File rootDir = new File(r);
if (!rootDir.exists() || !rootDir.isDirectory()) {
- System.out.println("root path is invalid");
+ DA_LOG.debug("root path is invalid");
return;
} else {
root = rootDir;
if (null != path && !path.isEmpty()) {
File file = new File(path);
if (!file.exists()) {
- System.out.println("invalid path");
+ DA_LOG.debug("invalid path");
return result;
} else if (!file.isDirectory()) {
current = file.getParentFile();
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
public class LoadSettingDialog extends DAMessageBox {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static int SAVE_FOLDER = 0;
public static int TEMP_FOLDER = 1;
grid.remove(index);
} else {
// log for debug
- System.out.println("delete save file failed..."); //$NON-NLS-1$
+ DA_LOG.debug("delete save file failed..."); //$NON-NLS-1$
}
}
import org.tizen.dynamicanalyzer.swap.platform.BinarySettingManager;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
import org.tizen.dynamicanalyzer.widgets.da.base.DAText;
public class SaveSettingDialog extends DAMessageBox {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private int MAX_SAVE_FILE_NAME_LENGTH = 35;
private final String DEFAULT_TIME_FORMAT = "_yyyy-MM-dd-HH-mm-ss";//$NON-NLS-1$
if (success) {
// add snapshot model update
- System.out.println("save binary setting complete!!"); //$NON-NLS-1$
+ DA_LOG.debug("save binary setting complete!!"); //$NON-NLS-1$
} else {
- System.out.println("save binary setting fail..."); //$NON-NLS-1$
+ DA_LOG.debug("save binary setting fail..."); //$NON-NLS-1$
return false;
}
return true;
saveFileName = getSaveFileName();
if (null == saveFileName) {
// create warning message box
- System.out.println("save file name is null");
+ DA_LOG.debug("save file name is null");
return false;
} else {
textBox.setText(saveFileName);
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
public class TimelineChartMouseEventListener extends MouseAdapter implements
MouseMoveListener {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
private DAPopupMenu menu;
private DATimeline timeline;
DAPopupMenuItem clearItem = itemList.get(4);
if (ToolbarArea.getInstance() == null) {
- System.out.println("toolbar area is null");//$NON-NLS-1$
+ DA_LOG.debug("toolbar area is null");//$NON-NLS-1$
return;
}
DAChartPlotMarker marker = plot.getMarkers()
.get(SELECTION_MARKER_INDEX);
if (!(marker instanceof DAChartPlotIntervalMarker)) {
- System.out.println("mouseMove !IntervalMarker");
+ DA_LOG.debug("mouseMove !IntervalMarker");
return;
}
DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker;
import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.widgets.Canvas;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
public class TimelineChartMouseTrackAdapter extends MouseTrackAdapter {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private DATimeline timeline;
public TimelineChartMouseTrackAdapter(DATimeline timeline) {
if (plot instanceof DAUIEventChartPlot) {
i = (int) (seriesList.size() * yPosRatio);
if (i < 0 || i > 4) {
- System.out.println(yPosRatio + " " + i);//$NON-NLS-1$
+ DA_LOG.debug(yPosRatio + " " + i);//$NON-NLS-1$
}
}
DAChartSeries series = seriesList.get(i);
import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
public class FileChartData {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private List<FileChartData> children = new ArrayList<FileChartData>();
private DAChartSeries apiSeries;
private DAChartSeries accessSeries;
ColorResources.FILE_API_USED, event.getTooltipContent());
break;
default:
- System.out.println("createChartItem : no case FileChartDataEvent");
+ DA_LOG.debug("createChartItem : no case FileChartDataEvent");
return -1;
}
if (seriesItem != null) {
import org.tizen.dynamicanalyzer.swap.logparser.Logs;
import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class FileChartManager extends PageDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private FileDataMaker fileDataMaker = null;
private static FileChartManager instance = null;
}
/* log for debug */
- System.out.println(getName() + " thread end!!"); //$NON-NLS-1$
+ DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
}
public void clear() {
import org.tizen.dynamicanalyzer.ui.timeline.chart.FileChart;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
public class FileDataMaker {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private DAChartBoard board;
private List<FileChartData> rows = new ArrayList<FileChartData>();
private List<FileChartDataEvent> fileEventQueue = new ArrayList<FileChartDataEvent>();
this.failedChecker.getFailedList().add(ffd);
event.setFailedAPI();
} else if (name.equals("fdopen")) { //$NON-NLS-1$
- System.out.println("fdopen");
+ DA_LOG.debug("fdopen");
continue;
}
import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
import org.tizen.dynamicanalyzer.swap.model.data.UserFunctionData;
import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class CallStackManager extends BaseCallstackManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
public void makeUserCallstack(LogData input, ProfileDataMaker profiler) {
UserFunctionData log = (UserFunctionData) input;
userCallstack.get(size - 2).getCallStackUnit().getFunctionName())) {
userCallstack.remove(size - 2);
} else {
- System.out
- .println("makeUserCallstack : [virtual thunk] EXIT caller is not the same"
+ DA_LOG.debug("makeUserCallstack : [virtual thunk] EXIT caller is not the same"
+ "as top of user callstack after remove EXIT self");
}
}
}
}
} else {
- System.out
- .println("makeUserCallstack : EXIT self is not the same as top of user callstack");
+ DA_LOG.debug("makeUserCallstack : EXIT self is not the same as top of user callstack");
}
if (AnalyzerManager.isOsp()) {
// String apiName = input[LogCenterConstants.APINAME_INDEX];
topUserCallstack.getFunctionName())) {
probeCallstack.set(size - 1, new CallStackItem(callerCallstackUnit));
} else {
- System.out
- .println("bug : probe caller is not the same as top of user callstack"); //$NON-NLS-1$
+ DA_LOG.debug("probe caller is not the same as top of user callstack"); //$NON-NLS-1$
}
}
selfCallstackUnit)) {
dupUserCall.increaseDupCallCount();
} else {
- System.out
- .println("isIrregularUserCall : dup callstack check error"); //$NON-NLS-1$
+ DA_LOG.debug("isIrregularUserCall : dup callstack check error"); //$NON-NLS-1$
}
}
return true;
dupUserCallMap.remove(tid);
}
} else {
- System.out
- .println("isIrregularUserCall : dup callstack check error"); //$NON-NLS-1$
+ DA_LOG.debug("isIrregularUserCall : dup callstack check error"); //$NON-NLS-1$
}
return true;
}
import org.json.simple.JSONObject;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.JsonUtil;
public class EmulatorScreenshot implements ILsn {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private final String SCREENSHOT = "Snapshot";
private int filecount = 0;
@Override
public void OnEventProc(String eventname, JSONObject jsParam) {
String message = jsParam.get(SocketConstants.MESSAGE_RETURN).toString();
- System.out.println("[info] " + message);
+ DA_LOG.info(message);
}
@Override
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.ui.page.ScreenshotTabComposite;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class ImageViewer extends Composite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
static class ImageData {
public GC gc;
err.printStackTrace();
img = ImageResources.NO_IMAGE;
} catch (SWTException e) {
- System.out.println("Wait for receiving image : " + path);//$NON-NLS-1$
+ DA_LOG.debug("Wait for receiving image : " + path);//$NON-NLS-1$
img = ImageResources.NO_IMAGE;
}
if (img.isDisposed()) {
- System.out.println("before set image : disposed"); //$NON-NLS-1$
+ DA_LOG.debug("before set image : disposed"); //$NON-NLS-1$
}
}
setImage(img);
import org.tizen.dynamicanalyzer.ui.info.screenshot.ecs.Ecs.Master;
import org.tizen.dynamicanalyzer.ui.info.screenshot.ecs.Ecs.MonitorReq;
import org.tizen.dynamicanalyzer.ui.info.screenshot.ecs.EcsIds.Master_Type;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class MessageSender {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static MessageSender m_inst;
master.writeTo(SocketClient.getInstance().getOutputStream());
SocketClient.getInstance().getOutputStream().flush();
} catch (IOException e) {
- System.out.println("[warn] " + e.getMessage());
+ DA_LOG.warning(e.getMessage());
return false;
}
return true;
import java.util.Map;
import org.json.simple.JSONObject;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.JsonUtil;
import org.tizen.dynamicanalyzer.ui.info.screenshot.ecs.Ecs.Master;
import org.tizen.dynamicanalyzer.ui.info.screenshot.ecs.EcsIds.Master_Type;
public class MsgMgr {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private Map<Master_Type, IMsgProc> _msg_map = new HashMap<Master_Type, IMsgProc>();
IMsgProc proc = FindMsgProc(subtype);
if (proc == null) {
- System.out.println("[info] invalid message type - " + subtype.toString());
+ DA_LOG.info("invalid message type - " + subtype.toString());
return;
}
import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.SystemData;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class ScreenshotDataManager extends PageDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static ScreenshotDataManager instance = null;
private List<Long> lastCpuRate = null;
private int lastProcessMemory = 0;
}
/* log for debug */
- System.out.println(getName() + " thread end!!"); //$NON-NLS-1$
+ DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
}
public List<Long> getLastCpuRate() {
import java.util.LinkedList;
import java.util.List;
+import org.tizen.dynamicanalyzer.util.DALogger;
+
public class SocketClient {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static SocketClient client;
try {
socket = new Socket(ip, port);
- System.out.println("[info] socket created." + "ip: " + ip + ", port: " + port);
+ DA_LOG.info("socket created." + "ip: " + ip + ", port: " + port);
socket.setReuseAddress(true);
SocketConstants.SOCKET_MESSAGE_THREAD).start();
} catch (SocketException e) {
- System.out.println("[warn] " + e.getMessage());
+ DA_LOG.warning(e.getMessage());
return false;
} catch (IOException e) {
- System.out.println("[warn] " + e.getMessage());
+ DA_LOG.warning(e.getMessage());
return false;
}
((Socket) obj).close();
}
} catch (final IOException e) {
- System.out.println("[warn] " + e.getMessage());
+ DA_LOG.warning(e.getMessage());
return false;
}
}
import org.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.ui.info.screenshot.ecs.Ecs.Master;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class SocketMessage implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
// private List<String> list = new ArrayList<String>();
try {
msgQueue.wait();
} catch (InterruptedException e) {
- System.out.println("[severe] " + e.getMessage());
+ DA_LOG.debug("[severe] " + e.getMessage());
}
}
while (true)
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
- System.out.println("[info] processMsg");
+ DA_LOG.info("processMsg");
MsgMgr.getInstance().ProcBufMsg(msg);
}
});
import java.nio.ByteBuffer;
import org.tizen.dynamicanalyzer.ui.info.screenshot.ecs.Ecs.Master;
+import org.tizen.dynamicanalyzer.util.DALogger;
import com.google.protobuf.CodedInputStream;
public class SocketReceive implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
@Override
public void run() {
SocketClient client = SocketClient.getInstance();
- System.out.println("[info] Socket Receive runs.");
+ DA_LOG.info("Socket Receive runs.");
DataInputStream in = client.getInputStream();
int size = 0;
try {
while ((size = in.readInt()) > 0) {
if (client.getSocket().isClosed() || !client.isRunning()) {
- System.out.println("closed || not running.");
+ DA_LOG.debug("closed || not running.");
break;
}
new InputStreamReader(in));
byte[] bSize = ByteBuffer.allocate(4).putInt(size).array();
String message = new String(bSize, 0, 4) + reader.readLine();
- System.out.println("message len: " + message.length()
+ DA_LOG.debug("message len: " + message.length()
+ ", message:" + message);
// TODO: handle string message
}
import org.tizen.dynamicanalyzer.ui.kernel.data.KernelDataManager;
import org.tizen.dynamicanalyzer.ui.kernel.data.KernelDataPerThread;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
public class CallFlowChart extends DAChartBoard {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private KernelDataPerThread selectedData = null;
private boolean dirty = false;
private final KernelDataMaker dataMaker = KernelDataManager.getInstance()
prevItem = curItem;
prevSeriesNum = curSeriesNum;
} else {
- System.out
- .println("[ERR] Function series is not exist in call flow chart");
+ DA_LOG.error("Function series is not exist in call flow chart");
}
}
import org.tizen.dynamicanalyzer.swap.model.data.ContextSwitchData;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class KernelDataMaker {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final String queryto_withTime = "where %s < %s and %s > %s order by %s";
private static final String queryto_withTidAndTime = "where %s = %s and %s < %s and %s > %s order by %s";
private static final String queryto_withTid = "where %s = %s group by %s";
} else { // thread id is exist in thread id array
if (kdata.getCorelog() != null) {
// TODO : error
- System.out
- .println("[ERR] context switch entry log is coming without exit log of previous context");
+ DA_LOG.error("context switch entry log is coming without exit log of previous context");
} else {
kdata.setCorelog(csdata);
KernelDataPerThread kdata = findKernelData(tid);
if (kdata == null) { // thread id is not exist
// TODO : error
- System.out
- .println("[ERR] context switch exit log is coming without any entry log");
+ DA_LOG.error("context switch exit log is coming without any entry log");
} else if ((precore = kdata.getCorelog()) == null) {
// TODO : error
- System.out
- .println("[ERR] context switch exit log is coming without corresponding entry log");
+ DA_LOG.error("context switch exit log is coming without corresponding entry log");
} else if (precore.getCpuNum() != csdata.getCpuNum()) {
// TODO : error
- System.out
- .println("[ERR] context switch exit log is coming with different cpu num");
+ DA_LOG.error("context switch exit log is coming with different cpu num");
} else {
kdata.setCorelog(null);
prefunc_type = kdata.getFunclogType();
if (prefunc != null) {
if (prefunc.isEmpty() || prefunc_type.isEmpty()) {
- System.out
- .println("[WRN] context switch exit log is coming but there is no function in stack");
+ DA_LOG.warning("context switch exit log is coming but there is no function in stack");
} else {
ProfileData lastfunc = prefunc.peek();
int lastfunc_type = prefunc_type.peek();
KernelDataPerThread kdata = findKernelData(tid);
if (kdata == null) {
// TODO : error
- System.out
- .println("[ERR] function entry log is coming without any context entry log");
+ DA_LOG.error("function entry log is coming without any context entry log");
} else {
assert (kdata.getCorelog() != null);
if (kdata.getFunclog() == null) {
KernelDataPerThread kdata = findKernelData(tid);
if (kdata == null) {
// TODO : error
- System.out
- .println("[ERR] function entry log is coming without any context entry log");
+ DA_LOG.error("function entry log is coming without any context entry log");
} else {
assert (kdata.getCorelog() != null);
if (kdata.getFunclog() == null) {
if (prefunc.isEmpty() || prefunc_type.isEmpty()) {
// TODO : error
- System.out
- .println("[ERR] function exit log is coming without function entry log");
+ DA_LOG.error("function exit log is coming without function entry log");
} else {
ProfileData lastfunc = prefunc.pop();
int lastfunc_type = prefunc_type.pop();
import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.LogDataTimeComparator;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class KernelDataManager extends PageDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static KernelDataManager instance = null;
private KernelDataMaker kdataMaker = null;
}
/* log for debug */
- System.out.println(getName() + " thread end!!"); //$NON-NLS-1$
+ DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
}
public void clear() {
import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
public class NetworkChartData {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private List<NetworkChartData> children = new ArrayList<NetworkChartData>();
private NetworkChartData parent = null;
}
default:
- System.out
- .println("setStatusColor : no case NetworkChartDataEvent : "
+ DA_LOG.debug("setStatusColor : no case NetworkChartDataEvent : "
+ event.getApiType());//$NON-NLS-1$
return;
}
break;
default:
- System.out
- .println("createChartItem : no case NetworkChartDataEvent : "
+ DA_LOG.debug("createChartItem : no case NetworkChartDataEvent : "
+ apiType);//$NON-NLS-1$
return -1;
}
import org.tizen.dynamicanalyzer.swap.logparser.Logs;
import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class NetworkChartManager extends PageDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private NetworkDataMaker networkDataMaker = null;
}
/* log for debug */
- System.out.println(getName() + " thread end!!"); //$NON-NLS-1$
+ DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
}
public void clear() {
import org.tizen.dynamicanalyzer.ui.summary.warning.WarningData;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
public class NetworkDataMaker {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private DAChartBoard board;
private int preSelectionPId = -1;
private List<NetworkChartData> unknownDataList = new ArrayList<NetworkChartData>();
break;
}
default:
- System.out
- .println("makeEventData : no case NetworkChartDataEvent : "
+ DA_LOG.debug("makeEventData : no case NetworkChartDataEvent : "
+ apiType);//$NON-NLS-1$
return null;
}
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.Formatter;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
public class NetworkTrafficChart {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static class FDCountData {
private int type;
break;
}
default:
- System.out.println("FileChart.java : wrong file api type");//$NON-NLS-1$
+ DA_LOG.debug("wrong file api type");//$NON-NLS-1$
}
}
trafficDataList.clear();
break;
}
default:
- System.out.println("FileChart.java : wrong file api type");//$NON-NLS-1$
+ DA_LOG.debug("wrong file api type");//$NON-NLS-1$
}
trafficDataList.remove(0);
}
import org.tizen.dynamicanalyzer.ui.opengl.ui.chart.GLFrameTimeChart;
import org.tizen.dynamicanalyzer.ui.opengl.ui.context.GLContextTreeTable;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class GLDataMaker extends PageDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static final String DELIMITER = "`,";
public static final String EMPTY = "";
private static final String SPACE = " ";
}
}
- System.out.println(getName() + " thread ended!");
+ DA_LOG.debug(getName() + " thread ended!");
}
}
import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
public class GLFrameChartMouseEventListener extends
GLTimeChartMouseEventListener {
+ private static final DALogger DA_LOG = DALogger.getInstance();
public GLFrameChartMouseEventListener(DAPopupMenu menu, DATimeline timeline) {
super(menu, timeline);
DAPopupMenuItem clearItem = itemList.get(4);
if (ToolbarArea.getInstance() == null) {
- System.out.println("toolbar area is null");//$NON-NLS-1$
+ DA_LOG.debug("toolbar area is null");//$NON-NLS-1$
return;
}
import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
public class GLTimeChartMouseEventListener extends MouseAdapter implements
MouseMoveListener {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
protected RangeDataManager rangeDataManager = RangeDataManager
.getInstance();
protected DAPopupMenu menu;
DAPopupMenuItem clearItem = itemList.get(4);
if (ToolbarArea.getInstance() == null) {
- System.out.println("toolbar area is null");//$NON-NLS-1$
+ DA_LOG.debug("toolbar area is null");//$NON-NLS-1$
return;
}
// TODO
FrameCountInfo frameCountInfo = GLDataMaker.getInstance()
.getFrameCountInfo(index);
- System.out.println("start : " + frameCountInfo.getStartFrameIndex()
+ DA_LOG.debug("start : " + frameCountInfo.getStartFrameIndex()
+ ", count : " + frameCountInfo.getFrameCount());
AnalyzerManager.getCurrentPage().updateView(
DAChartPlotMarker marker = plot.getMarkers()
.get(SELECTION_MARKER_INDEX);
if (!(marker instanceof DAChartPlotIntervalMarker)) {
- System.out.println("mouseMove !IntervalMarker");
+ DA_LOG.debug("mouseMove !IntervalMarker");
return;
}
DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.widgets.table.DAApiListTableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.Formatter;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
public class GLAPIListTable extends DAApiListTableComposite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final String EMPTY = "";
private String[] columnNames = {
GLPageLabels.GL_API_LIST_VIEW_SEQ,
int insideColumnIndex = Integer.parseInt(involvedInfo.get(2));
map.put(seq, insideColumnIndex);
} catch (NumberFormatException e) {
- System.out.println("init log");
+ DA_LOG.debug("init log");
}
}
import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
import org.tizen.dynamicanalyzer.workbench.LayoutManager;
public class BaseView extends ViewPart {
-
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static final String ID = BaseView.class.getName();
DAPageComposite topComposite = null;
DATabComposite tabView = null;
tabView.getContentComposite(), SWT.NONE);
tabView.addView(summaryPage, false);
}
+ DA_LOG.performance("TEST", "DA Start", "Create Toolbar and Add Tab view");
}
@Override
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.ui.toolbar.UpdateTimerTask;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class UpdateViewTimer {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static Timer timer = null;
private static boolean bOpentrace = false;
if (null != timer) {
timer.cancel();
timer = null;
- System.out.println("update timer stop"); //$NON-NLS-1$
+ DA_LOG.debug("update timer stop"); //$NON-NLS-1$
}
}
}
\ No newline at end of file
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.Formatter;
public class FailedApiTable extends DATableComposite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private boolean isRange = false;
public FailedApiTable(Composite parent, int style, int tableStyle) {
text.add(errCode); // 5
data.add(new Long(failedData.getErrorCode()));
} catch (NullPointerException e) {
- System.out.println("debug");
+ DA_LOG.debug("debug");
continue;
}
String errMsg = ErrorCodeManager.getInatance().getErrorDescription(
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class FunctionUsageProfiler extends PageDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
// default sampling rate = 10 ms
public static long SAMPLE_TIME = 10;
}
/* log for debug */
- System.out.println(getName() + " thread end!!"); //$NON-NLS-1$
+ DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
}
public static void clear() {
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackItem;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.utils.Formatter;
public class ProfileDataMaker {
+ private static final DALogger DA_LOG = DALogger.getInstance();
class CallstackTree {
ProfilingData me;
symbol = path + AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ functionName;
} else {
- System.out
- .println("binary for the sample pc is not found :" + AnalyzerUtil.toHexdecimal(pcAddr)); //$NON-NLS-1$
+ DA_LOG.debug("binary for the sample pc is not found :" + AnalyzerUtil.toHexdecimal(pcAddr)); //$NON-NLS-1$
symbol = InformationViewLabels.CALLSTACK_TABLE_UNKNOWN_LIBRARY
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ AnalyzerUtil.toHexdecimal(pcAddr);
}
addrs.add(0, selfAddr);
} else {
- System.out
- .println("makeFunctionUsageProfileData : cannot find seq by time");
+ DA_LOG.debug("makeFunctionUsageProfileData : cannot find seq by time");
addrs = new ArrayList<Long>();
addrs.add(selfAddr);
}
if(size == 0 ||
!userCallstack.get(size - 1).getCallStackUnit()
.getFunctionName().equals(inputCallstackApiData.getFunctionName())) {
- System.out
- .println("exit without entry or EXIT self is not the same as top of user callstack :"
+ DA_LOG.debug("exit without entry or EXIT self is not the same as top of user callstack :"
+ inputCallstackApiData.getFunctionName()); //$NON-NLS-1$
return;
}
if (type == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_EXIT) {
if (null == current) {
// bug
- System.out
- .println("exit without entry - range only :" + inputCallstackApiData.getFunctionName()); //$NON-NLS-1$
+ DA_LOG.debug("exit without entry - range only :" + inputCallstackApiData.getFunctionName()); //$NON-NLS-1$
} else {
CallstackTree parentCt = current.getParent();
if (null != parentCt) {
if(size == 0 ||
!userCallstack.get(size - 1).getCallStackUnit()
.getFunctionName().equals(inputCallstackApiData.getFunctionName())) {
- System.out
- .println("exit without entry or EXIT self is not the same as top of user callstack :"
+ DA_LOG.debug("exit without entry or EXIT self is not the same as top of user callstack :"
+ inputCallstackApiData.getFunctionName()); //$NON-NLS-1$
return;
}
if (type == MSG_FUNCTION_EXIT) {
if (null == current) {
// bug
- System.out
- .println("exit without entry - range only :" + inputCallstackApiData.getFunctionName()); //$NON-NLS-1$
+ DA_LOG.debug("exit without entry - range only :" + inputCallstackApiData.getFunctionName()); //$NON-NLS-1$
} else {
CallstackTree parentCt = current.getParent();
if (null != parentCt) {
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncDataManager;
import org.tizen.dynamicanalyzer.ui.thread.thread.ThreadPageThreadDataManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
public class ThreadChartManager extends PageDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static ThreadChartManager instance = null;
}
/* log for debug */
- System.out.println(getName() + " thread end!!"); //$NON-NLS-1$
+ DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
}
public int getItemIndexByTid(String tid) {
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.thread.ThreadPageData;
import org.tizen.dynamicanalyzer.ui.thread.ThreadPageDataEvent;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
public class ThreadPageSyncData extends ThreadPageData {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private List<ThreadPageSyncData> children = new ArrayList<ThreadPageSyncData>();
private DAChartSeries apiSeries;
private DAChartSeries stateSeries;
DAChartSeriesItem stateItem = null;
DAChartSeriesItem apiItem = null;
if (!(event instanceof ThreadPageSyncDataEvent)) {
- System.out.println("error : createChartItem");
+ DA_LOG.error("createChartItem");
return -1;
}
ThreadPageSyncDataEvent syncEvent = (ThreadPageSyncDataEvent) event;
import org.tizen.dynamicanalyzer.ui.thread.ThreadPageData;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
public class ThreadPageSyncDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private DAChartBoard board;
private List<ThreadPageSyncData> rows = new ArrayList<ThreadPageSyncData>();
private List<ThreadPageSyncDataEvent> syncEventQueue = new ArrayList<ThreadPageSyncDataEvent>();
event = new ThreadPageSyncDataEvent(name, type, apiType, time, tid,
apiName, errorNum, input);
pushEvent(event);
- System.out.println("error : sync parse - type = " + type);
+ DA_LOG.error("sync parse - type = " + type);
break;
default:
- System.out.println("error : sync parse unknown - type = " + type);
+ DA_LOG.error("sync parse unknown - type = " + type);
}
}
event = new ThreadPageSyncDataEvent(name, type, apiType, time,
tid, apiName, errorNum, input);
pushEvent(event);
- System.out.println("error : sync parse - type = " + type);
+ DA_LOG.error("sync parse - type = " + type);
break;
default:
- System.out.println("error : sync parse unknown - type = "
+ DA_LOG.error("sync parse unknown - type = "
+ type);
}
}
import org.tizen.dynamicanalyzer.ui.thread.ThreadPageData;
import org.tizen.dynamicanalyzer.ui.thread.ThreadPageDataEvent;
import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncData;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
public class ThreadPageThreadData extends ThreadPageData {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private List<ThreadPageSyncData> syncs = new ArrayList<ThreadPageSyncData>();
private String StartTime;
private String EndTime;
protected int createChartItem(ThreadPageDataEvent event) {
int ret = -1;
if (!(event instanceof ThreadPageThreadDataEvent)) {
- System.out.println("error : createChartItem");
+ DA_LOG.error("createChartItem");
return ret;
}
import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
public class ThreadPageThreadDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private DAChartBoard board;
// ThreadChartView view;
private boolean hasUpdate = false;
try {
tid = temp[j];
} catch (NumberFormatException nfe) {
- System.out.println("error : parseLoad - tid parsing");
+ DA_LOG.error("parseLoad - tid parsing");
break;
}
// if (null == findParentData(tid)) {
try {
tid = temp[j];
} catch (NumberFormatException nfe) {
- System.out.println("error : parseLoad - tid parsing");
+ DA_LOG.error("parseLoad - tid parsing");
break;
}
// if (null == findParentData(tid)) {
pushEvent(event);
break;
default:
- System.out.println("thread page err: unknown thread api type");
+ DA_LOG.error("thread page err: unknown thread api type");
}
}
pushEvent(event);
break;
default:
- System.out.println("thread page err: unknown thread api type");
+ DA_LOG.error("thread page err: unknown thread api type");
}
}
parseTIZEN(log);
break;
default:
- System.out.println("thread page err: unknown thread type");
+ DA_LOG.error("thread page err: unknown thread type");
}
hasUpdate = true;
parseTIZEN(input);
break;
default:
- System.out.println("thread page err: unknown thread type");
+ DA_LOG.error("thread page err: unknown thread type");
}
}
}
event = new ThreadPageSyncDataEvent(name, type, apiType, time, tid,
apiName, errorNum, input);
pushSyncEvent(event);
- System.out.println("error : sync parse - type = " + type);
+ DA_LOG.error("error : sync parse - type = " + type);
break;
default:
- System.out.println("error : sync parse unknown - type = " + type);
+ DA_LOG.error("error : sync parse unknown - type = " + type);
}
hasUpdate = true;
}
event = new ThreadPageSyncDataEvent(name, type, apiType, time,
tid, apiName, errorNum, input);
pushSyncEvent(event);
- System.out.println("error : sync parse - type = " + type);
+ DA_LOG.debug("sync parse - type = " + type);
break;
default:
- System.out.println("error : sync parse unknown - type = "
+ DA_LOG.error("sync parse unknown - type = "
+ type);
}
}
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DAWindowingTableComposite;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.Formatter;
public class CallTraceTable extends DAWindowingTableComposite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public CallTraceTable(Composite parent, int compStyle, int tableStyle) {
super(parent, compStyle, tableStyle);
setContextMenu(AnalyzerConstants.CONTEXT_TABLE_SOURCE | AnalyzerConstants.CONTEXT_TABLE_RANGE);
text.add(data.getReturn());
text.add(data.getLibName());
} else {
- System.out.println("wrong log data in calltrace view");
+ DA_LOG.debug("wrong log data in calltrace view");
continue;
}
// create DATableDataFormat
import org.tizen.dynamicanalyzer.swap.logparser.Logs;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.Formatter;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
public class FileChart extends TimelineChart {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static class FDCountData {
private int type;
private double time;
}
break;
default:
- System.out
- .println("FileChart.java : wrong file api type");//$NON-NLS-1$
+ DA_LOG.debug("wrong file api type");//$NON-NLS-1$
}
getFileDataQ().remove(0);
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.timeline.uievent.UIEventListDialog;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuListener;
public class UIEventChart extends TimelineChart {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static UIEventChart instance = null;
private DAChartSeries touchEventSeries;
.getStatus()));
break;
default:
- System.out.println("UIEventChart.java : event type error");//$NON-NLS-1$
+ DA_LOG.error("event type error");//$NON-NLS-1$
return;
}
} catch (NumberFormatException ne) {
+ logData.getInfo2();
break;
default:
- System.out.println("UIEventChart.java wrong gesture type");//$NON-NLS-1$
+ DA_LOG.debug("wrong gesture type");//$NON-NLS-1$
}
return info;
import org.tizen.dynamicanalyzer.ui.timeline.logparser.DeviceLogParser;
import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
public class TimelineChartManager extends PageDataManager implements IDAChartSeriesMaker {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static TimelineChartManager instance = null;
private boolean newCustomChart = false;
}
/* log for debug */
- System.out.println(getName() + " thread end!!"); //$NON-NLS-1$
+ DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
}
private void makeSystemDataTableData(Logs systemLogs, Logs memoryLogs) {
import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
public class TimelineView extends DAViewComposite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private final DAChartBoard chartBoard;
private final TimelineChartManager timelineChartManager = TimelineChartManager
@Override
public void updateView() {
if (ToolbarArea.getInstance() == null) {
- System.out.println("toolbar area is null");//$NON-NLS-1$
+ DA_LOG.debug("toolbar area is null");//$NON-NLS-1$
return;
}
import org.tizen.dynamicanalyzer.ui.timeline.chart.UserCustomChart;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartManager;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
public class CustomLogParser {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final String API_NAME_CREATE_CHART = "da_create_chart"; //$NON-NLS-1$
private static final String API_NAME_CREATE_SERIES = "da_create_series"; //$NON-NLS-1$
private static final String API_NAME_CREATE_DEFAULT_SERIES = "da_create_default_series"; //$NON-NLS-1$
UserCustomChart chart = (UserCustomChart) chartManager
.getChartInstance(chartType);
if (chart == null) {
- System.out
- .println("CustomLogParser.java : unrecognized chart handle"); //$NON-NLS-1$
+ DA_LOG.debug("unrecognized chart handle"); //$NON-NLS-1$
return;
}
}
Color seriesColor = getCustomColor(colorIndex);
if (seriesColor == null) {
- System.out
- .println("CustomLogParser.java : undefined custom color"); //$NON-NLS-1$
+ DA_LOG.debug("undefined custom color"); //$NON-NLS-1$
return;
}
UserCustomChart chart = (UserCustomChart) chartManager
.getChartInstance(chartType);
if (chart == null) {
- System.out.println("unrecognized chart handle"); //$NON-NLS-1$
+ DA_LOG.debug("unrecognized chart handle"); //$NON-NLS-1$
return;
}
import org.tizen.dynamicanalyzer.swap.model.data.LifeCycleLogData;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
import org.tizen.dynamicanalyzer.widgets.lifecycle.LifecycleBar;
import org.tizen.dynamicanalyzer.widgets.lifecycle.LifecycleData;
import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
public class LifecycleLogParser {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static LifecycleLogParser instance = null;
private static final int API_ID_INITIALIZING = 3;
String text;
if (apiId == API_ID_INITIALIZING) {
+ DA_LOG.performance("TEST", "App Lifecycle", "Initializing");
colorTop = ColorResources.LIFECYCLE_INITIALIZING_TOP;
colorBottom = ColorResources.LIFECYCLE_INITIALIZING_BOTTOM;
text = TimelineChartLabels.LIFECYCLE_INITIALIZING;
} else if (apiId == API_ID_RUNNING) {
+ DA_LOG.performance("TEST", "App Lifecycle", "Running");
colorTop = ColorResources.LIFECYCLE_RUNNING_TOP;
colorBottom = ColorResources.LIFECYCLE_RUNNING_BOTTOM;
text = TimelineChartLabels.LIFECYCLE_RUNNING;
} else if (apiId ==API_ID_PAUSING) {
+ DA_LOG.performance("TEST", "App Lifecycle", "Pausing");
colorTop = ColorResources.LIFECYCLE_PAUSING_TOP;
colorBottom = ColorResources.LIFECYCLE_PAUSING_BOTTOM;
text = TimelineChartLabels.LIFECYCLE_PAUSING;
} else if (apiId == API_ID_TERMINATING) {
+ DA_LOG.performance("TEST", "App Lifecycle", "Terminating");
colorTop = ColorResources.LIFECYCLE_TERMINATING_TOP;
colorBottom = ColorResources.LIFECYCLE_TERMINATING_BOTTOM;
text = TimelineChartLabels.LIFECYCLE_TERMINATING;
} else {
- System.out.println("LifecycleLogParser.java : lifecycle log error"); //$NON-NLS-1$
+ DA_LOG.error("lifecycle log error"); //$NON-NLS-1$
return;
}
import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class ConfigureManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
// default value
private static final int DEFAULT_THEME = 1;
ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC,
Long.toString(AnalyzerConstants.SYSTEM_INFOMATION_SAMPLING_PERIODIC));
}
+ if (null == data
+ .get(ConfigureLabels.INTERNAL_LOG_LEVEL)) {
+ data.put(
+ ConfigureLabels.INTERNAL_LOG_LEVEL,
+ Long.toString(DALogger.DEBUG));
+ }
}
private void initConfigDataFromFile() {
File configFolder = new File(PathManager.DA_CONFIG_FOLDER_PATH);
if (!configFolder.isDirectory()) {
if (!configFolder.mkdirs()) {
- System.out.println("config directory create failed...");
+ DA_LOG.debug("config directory create failed...");
return;
}
}
}
setCheckDefaultConfigData();
setConfigDataToFile();
+ // set log level
+// DA_LOG.setLogLevel(getValueInt(ConfigureLabels.INTERNAL_LOG_LEVEL));
}
private void setConfigDataToFile() {
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
import org.tizen.dynamicanalyzer.widgets.da.base.DAText;
public class SaveAsDialog extends DAMessageBox {
-
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private int MAX_SAVE_FILE_NAME_LENGTH = 35;
private DAText textBox = null;
saveFileName = getSaveFileName();
if (null == saveFileName) {
// create warning message box
- System.out.println("save file name is null");
+ DA_LOG.debug("save file name is null");
return false;
} else {
textBox.setText(saveFileName);
File sourceFolder = new File(sourcePath);
if (!sourceFolder.isDirectory()) {
if (!sourceFolder.mkdirs()) {
- System.out.println("source directory create failed...");
+ DA_LOG.debug("source directory create failed...");
return false;
}
}
File targetFolder = new File(targetPath);
if (!targetFolder.isDirectory()) {
if (!targetFolder.mkdirs()) {
- System.out.println("target directory create failed...");
+ DA_LOG.debug("target directory create failed...");
return false;
}
}
AnalyzerManager.removeFromProjectList(sourcePath);
if (success) {
// add snapshot model update
- System.out.println("save complete!!"); //$NON-NLS-1$
+ DA_LOG.debug("save complete!!"); //$NON-NLS-1$
} else {
- System.out.println("save fail..."); //$NON-NLS-1$
+ DA_LOG.debug("save fail..."); //$NON-NLS-1$
return false;
}
return true;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
public class StartProcessManager implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static StartProgressDialog dialog = null;
private static int count = 1;
private static boolean canceled = false;
@Override
public void run() {
count = 10;
- System.out.println("appinfo : "
+ DA_LOG.debug("appinfo : "
+ AnalyzerManager.isProcessInfoArrived() + "is exit :"
+ AnalyzerManager.isExit());
while ((!AnalyzerManager.isExit()) && (canceled == false)) {
}
}
stopProgress();
+ DA_LOG.performance("TEST", "Start Trace", "Start Process Manager");
}
public boolean isCancelled() {
import org.tizen.dynamicanalyzer.swap.logparser.SWAPLogParser;
import org.tizen.dynamicanalyzer.ui.page.UpdateViewTimer;
import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class StopLogProcessor implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static Thread stopLogProcessThread = null;
private static int count = 0;
@Override
public void run() {
+ DA_LOG.performance("TEST", "DA end", "Run stop log process thread", DALogger.testState.START);
Project project = AnalyzerManager.getProject();
int percent = 0;
StopProcessManager.getInstance().setValue(percent);
/* save Project */
- System.out.println(" save project and others..."); //$NON-NLS-1$
+ DA_LOG.debug(" save project and others..."); //$NON-NLS-1$
if (null == project || !project.isValid()) {
- System.out
- .println("project temp save is fail : project is not valid"); //$NON-NLS-1$
+ DA_LOG.debug("project temp save is fail : project is not valid"); //$NON-NLS-1$
} else {
project.setLastTime(ToolbarArea.getInstance().getTime());
SqlManager.getInstance().insertProject();
SqlManager.getInstance().saveApiNames();
SqlManager.getInstance().closeConnection();
- System.out.println("insert to db complete..."); //$NON-NLS-1$
+ DA_LOG.debug("insert to db complete..."); //$NON-NLS-1$
percent += 10;
StopProcessManager.getInstance().setValue(percent);
@Override
public void run() {
StopProcessManager.getInstance().stopTrace();
+ DA_LOG.performance("TEST", "DA end", "Run stop log process thread", DALogger.testState.END);
}
});
ToolbarArea.getInstance().setSettingsButtonEnablement(true);
}
});
+
+ DA_LOG.performance("TEST", DALogger.testState.END);
count--;
}
}
import org.tizen.dynamicanalyzer.ui.widgets.TitleComboRenderer;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
import org.tizen.sdblib.IDevice;
public class ToolbarArea {
-
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static final int START_BUTTON = 0;
public static final int SAVE_BUTTON = 1;
public static final int OPEN_BUTTON = 2;
setSaveButtonEnable(false);
ShortCutManager.getInstance().setEnabled(true);
+ DA_LOG.performance("TEST", "Start Trace", "Check valid application");
return;
}
+ DA_LOG.performance("TEST", "Start Trace", "Check valid application");
Display.getDefault().syncExec(new Runnable() {
@Override
});
AnalyzerUtil.changePage(TimelinePage.pageID);
+ DA_LOG.performance("TEST", "Start Trace", "Change to the Timeline page");
AnalyzerManager.setRunningState(true);
processCombo.initCombo();
processCombo.add(ALL_PROCESS);
private boolean checkValidApplication() {
List<DeviceInfo> devices = DACommunicator.getDevices();
if (null == devices || devices.isEmpty()) {
- System.out.println("Device is empty");
+ DA_LOG.debug("Device is empty");
return false;
}
String selectedDevice = deviceCombo.getText();
import org.tizen.dynamicanalyzer.swap.platform.ui.FileExplorer.FileExplorerDialog;
import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
public class BinarySettingsPage extends DAPageComposite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static final String ID = BinarySettingsPage.class.getName();
public static final int RADIO_CURRENT = 1;
File settingFolder = new File(settingPath);
if (!settingFolder.exists() || !settingFolder.isDirectory()) {
if (!settingFolder.mkdirs()) {
- System.out.println("setting directory create failed...");
+ DA_LOG.debug("setting directory create failed...");
}
}
binData.setUserSourcePath(source);
}
- System.out.println("update complete!");
+ DA_LOG.debug("update complete!");
}
public void doClose() {
if (success) {
// add snapshot model update
- System.out.println("binary settings auto save success!!"); //$NON-NLS-1$
+ DA_LOG.debug("binary settings auto save success!!"); //$NON-NLS-1$
} else {
- System.out.println("binary settings auto save fail..."); //$NON-NLS-1$
+ DA_LOG.debug("binary settings auto save fail..."); //$NON-NLS-1$
}
}
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
public class ConfigurationDialog extends DAMessageBox {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static boolean opened = false;
private DACustomButton applyButton = null;
private DACustomButton okButton = null;
@Override
public void widgetDisposed(DisposeEvent e) {
- System.out.println("shell disposed!"); //$NON-NLS-1$
+ DA_LOG.debug("shell disposed!"); //$NON-NLS-1$
opened = false;
ShortCutManager.getInstance().setEnabled(!opened);
}
@Override
public void handleEvent(Event event) {
- System.out.println("binary settings show");
+ DA_LOG.debug("binary settings show");
cancelButton.setText(WidgetLabels.CLOSE);
FormData data = (FormData) okButton.getLayoutData();
data.width = 0;
@Override
public void handleEvent(Event event) {
- System.out.println("binary settings hide");
+ DA_LOG.debug("binary settings hide");
cancelButton.setText(WidgetLabels.CANCEL);
FormData data = (FormData) okButton.getLayoutData();
data.width = 100;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
public class ConfigurationDialogDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static ConfigurationDialogDataManager instance = null;
private DAMessageBox configDlg = null;
.equals(ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC)) {
value = AnalyzerConstants.SYSTEM_INFOMATION_SAMPLING_PERIODIC;
} else {
- System.out.println("undefine feature : " + featureName);
+ DA_LOG.debug("undefine feature : " + featureName);
}
}
featuresValueHashMap.put(featureName, new ConfigurationDialogData(
long configFileStatus = mConfig.getValueLong(featureName);
if (featuresStatus != configFileStatus) {
if (apply) {
- System.out.println("change values : " + featureName);
+ DA_LOG.debug("change values : " + featureName);
}
isChangeValue = true;
}
long configFileStatus = mConfig.getValueLong(featureName);
if (featuresStatus != configFileStatus) {
if (apply) {
- System.out.println("change values : " + featureName);
+ DA_LOG.debug("change values : " + featureName);
}
isChangeValue = true;
}
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.Formatter;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
public class OpenTraceDialog extends DAMessageBox {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static boolean opened = false;
public static int SAVE_FOLDER = 0;
public static int TEMP_FOLDER = 1;
@Override
public void widgetDisposed(DisposeEvent e) {
- System.out.println("shell disposed!"); //$NON-NLS-1$
+ DA_LOG.debug("shell disposed!"); //$NON-NLS-1$
opened = false;
ShortCutManager.getInstance().setEnabled(!opened);
}
grid.remove(index);
} else {
// log for debug
- System.out.println("delete save file failed..."); //$NON-NLS-1$
+ DA_LOG.debug("delete save file failed..."); //$NON-NLS-1$
}
updateDetails();
updateOKButtonStatus();
import org.tizen.dynamicanalyzer.swap.logparser.Logs;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class OpenTraceInputReader implements Runnable {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static Thread openTraceInputThread = null;
// last = p.getProfileLogCount();
// createPackage(last, DataChannelConstants.MSG_DATA_SAMPLE);
- System.out.println("input reader complete"); //$NON-NLS-1$
+ DA_LOG.debug("input reader complete"); //$NON-NLS-1$
AnalyzerManager.setLogParsingComplete(true);
// end
}
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
public class RepalyEditSaveDialog extends DAMessageBox {
+ private static final DALogger DA_LOG = DALogger.getInstance();
public int MAX_SAVE_FILE_NAME_LENGTH = 35;
saveFileName = getSaveFileName();
if (null == saveFileName) {
// create warning message box
- System.out.println("save file name is null");
+ DA_LOG.debug("save file name is null");
return false;
} else {
textBox.setText(saveFileName);
File sourceFolder = new File(sourcePath);
if (!sourceFolder.isDirectory()) {
if (!sourceFolder.mkdirs()) {
- System.out.println("source directory create failed...");
+ DA_LOG.debug("source directory create failed...");
return false;
}
}
File targetFolder = new File(targetPath);
if (!targetFolder.isDirectory()) {
if (!targetFolder.mkdirs()) {
- System.out.println("target directory create failed...");
+ DA_LOG.debug("target directory create failed...");
return false;
}
}
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
public class ReplayEditDialog extends DAMessageBox {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static boolean opened = false;
private DACustomButton cancelButton = null;
//private DATabComposite tabView = null;
@Override
public void widgetDisposed(DisposeEvent e) {
- System.out.println("shell disposed!"); //$NON-NLS-1$
+ DA_LOG.debug("shell disposed!"); //$NON-NLS-1$
opened = false;
ShortCutManager.getInstance().setEnabled(!opened);
}
import org.tizen.dynamicanalyzer.common.ScreenshotConstants;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class ReplayEditSnapShopTableCellRenderer extends DefaultCellRenderer {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
int leftMargin = 4;
int rightMargin = 4;
int textTopMargin = 1;
err.printStackTrace();
img = ImageResources.NO_IMAGE;
} catch (SWTException e) {
- System.out.println("Wait for receiving image : " + path);
+ DA_LOG.debug("Wait for receiving image : " + path);
img = ImageResources.NO_IMAGE;
}
if (img.isDisposed()) {
- System.out.println("before set image : disposed");
+ DA_LOG.debug("before set image : disposed");
}
}
import org.tizen.dynamicanalyzer.ui.userinterface.control.UIControlListDataChecker;
import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingDataChecker;
import org.tizen.dynamicanalyzer.ui.userinterface.scene.UISceneDataChecker;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class UIDataManager extends PageDataManager {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private static UIDataManager instance = null;
}
/* log for debug */
- System.out.println(getName() + " thread end!!"); //$NON-NLS-1$
+ DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
}
public void clear() {
import org.tizen.dynamicanalyzer.swap.model.data.ControlData;
import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingData;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class UIControlListDataChecker {
+ private static final DALogger DA_LOG = DALogger.getInstance();
private List<UIControlListData> controlList = null;
private List<String> removeCallControlList = null;
|| stClassName.contains("RemoveAllControl")) {//$NON-NLS-1$
return;
} else {
- System.out.println("wrong type log : " + stClassName.trim());
+ DA_LOG.debug("wrong type log : " + stClassName.trim());
}
}
import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.utils.Formatter;
public class UIFunctionProfilingDataChecker {
+ private static final DALogger DA_LOG = DALogger.getInstance();
List<UIFunctionProfilingData> profilingList;
static private TreeSet<UIFunctionProfilingTreeSetData> userInterfaceFunctionTree = new TreeSet<UIFunctionProfilingTreeSetData>();
String sourcePath = PathManager.getTizenHeaderPath(isArm, platform);
File sourceFolder = new File(sourcePath);
if (!sourceFolder.exists() && !sourceFolder.isDirectory()) {
- System.out.println("Not Found the tizen_header_file folder : "
+ DA_LOG.debug("Not Found the tizen_header_file folder : "
+ sourcePath);
return;
}
String configFileName = AnalyzerConstants.USER_INTERFACE_API_LIST_FILE_NAME;
File configFolder = new File(PathManager.DA_CONFIG_FOLDER_PATH);
if (!configFolder.isDirectory()) {
- System.out.println("Not Exist UI API List Option Path ");
+ DA_LOG.debug("Not Exist UI API List Option Path ");
return CommonConstants.EMPTY;
}
File apiListFile = new File(configFolder, configFileName);
if (!apiListFile.isFile()) {
- System.out.println("Not Exist UI API List Option File");
+ DA_LOG.debug("Not Exist UI API List Option File");
return CommonConstants.EMPTY;
} else {
BufferedReader in = null;
import org.eclipse.swt.widgets.Canvas;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboPopupRenderer;
public class TitleComboPopupRenderer extends DACustomComboPopupRenderer {
+ private static final DALogger DA_LOG = DALogger.getInstance();
@Override
public void draw(GC gc, Canvas canvas, int state, List<Rectangle> rects,
int size = rects.size();
int itemSize = items.size();
if (size != itemSize) {
- System.out
- .println("invalid parameter in popup renderer : Rect size "
+ DA_LOG.debug("invalid parameter in popup renderer : Rect size "
+ size + "item size :" + itemSize);
return;
}
import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
import org.tizen.dynamicanalyzer.ui.widgets.FindDialog;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuListener;
public abstract class DATableComposite extends Composite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
protected static final int START_TIME = 0;
protected static final int END_TIME = 1;
List<String> dbColumnsName = new ArrayList<String>();
if (null == this.columnNames || this.columnNames.length < 1) {
- System.out.println("tableName is null");
+ DA_LOG.debug("tableName is null");
} else {
for (int i = 0; i < this.columnNames.length; i++) {
dbColumnsName.add(this.columnNames[i]);
import org.eclipse.swt.widgets.Composite;
import org.tizen.dynamicanalyzer.model.TableInput;
import org.tizen.dynamicanalyzer.model.TreeInput;
+import org.tizen.dynamicanalyzer.util.DALogger;
public abstract class DATreeComposite extends DATableComposite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
List<Long> selSeqs = null;
GridItem[] selections = null;
int[] sels = null;
} else if (parent instanceof GridItem) {
gridItem = new GridItem((GridItem) parent, SWT.NONE);
} else {
- System.out
- .println("it is bug!! need debug - DATreeComposite makeTreeItem");//$NON-NLS-1$
+ DA_LOG.debug("it is bug!! need debug - DATreeComposite makeTreeItem");//$NON-NLS-1$
return null;
}
// data
import org.tizen.dynamicanalyzer.ui.widgets.FindDialog;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
public abstract class DAWindowingTableComposite extends DATableComposite {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final String queryto_GetItemCount = "select count(*) from %s where %s";
private static final String queryto_GetLimitedItem = "select limit %s %s %s from %s where %s";
}
public void updateHScrollBar(int tableWidth) {
- System.out.println("width : " + tableWidth);
+ DA_LOG.debug("width : " + tableWidth);
hScrollbar.setMaximum(totalColumnSize);
hScrollbar.setThumb(tableWidth);
hScrollbar.setVisible(true);
} else if (object instanceof Long) {
totalItemCount = ((Long) object).intValue();
} else {
- System.out
- .println("[ERR] result of item count query is not expected!!");
+ DA_LOG.error("result of item count query is not expected!!");
totalItemCount = 0;
}
}
import org.tizen.dynamicanalyzer.common.HostResult;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class UIRecorderPlayThread extends Thread {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static final String FILTER_STRING = "ls:";//$NON-NLS-1$
private long readyTime = 100000;
ArrayList<XmlData> playDatas = xml.getPlayDatas(xmlFileName);
try {
- System.out.println("Replay event ready for app start!!");
+ DA_LOG.debug("Replay event ready for app start!!");
Thread.sleep(readyTime);
} catch (InterruptedException e) {
- System.out.println("Replay start!!");
+ DA_LOG.debug("Replay start!!");
}
for (XmlData data : playDatas) {
if (AnalyzerManager.isExit() || !AnalyzerManager.isRunning()) {
} catch (NumberFormatException e) {
e.printStackTrace();
} catch (InterruptedException e) {
- System.out.println("UI recorder play thread exit by interrupt");
+ DA_LOG.debug("UI recorder play thread exit by interrupt");
break;
}
HostResult result = DACommunicator
.handleControlMessage(replayEvent);
if (result.isSuccess()) {
- System.out.println("replay message ack :"
+ DA_LOG.debug("replay message ack :"
+ result.getMessage());
String[] splitResult = result.getMessage().split(
CommonConstants.CMD_SPLIT_READ);
try {
int errno = Integer
.parseInt(splitResult[ErrorCode.ERROR_NUMBER_INDEX]);
- System.out.println(ErrorCode.getError(errno)
+ DA_LOG.error(ErrorCode.getError(errno)
.getMessage());
} catch (NumberFormatException e) {
e.printStackTrace();
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class UIRecorderRecordThread extends Thread {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
ArrayList<XmlData> recordDatas;
private static RecordingQueue recordQueue = null;
break;
}
- System.out.println("record data : " + record);
+ DA_LOG.debug("record data : " + record);
recordData = xml.setEvent(record, coolbarArea.getTime() / 1000);
if (null != recordData) {
}
}
xml.createXml(AnalyzerManager.getProject().getSavePath());
- System.out.println("create xml file...");
+ DA_LOG.debug("create xml file...");
end = true;
}
package org.tizen.dynamicanalyzer.uirecorder;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class UIRecorderTool {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
private static UIRecorderTool instance;
private UIRecorderRecordThread recordThread;
private UIRecorderPlayThread playThread;
if (recordThread != null && recordThread.isAlive()) {
try {
sendNotify();
- System.out.println("record thread join wait!");
+ DA_LOG.debug("record thread join wait!");
recordThread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
- System.out.println("record thread join interrupted!");
+ DA_LOG.debug("record thread join interrupted!");
}
recordThread = null;
}
if (playThread != null && playThread.isAlive()) {
try {
playThread.interrupt();
- System.out.println("replay thread join wait!");
+ DA_LOG.debug("replay thread join wait!");
playThread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
- System.out.println("replay thread join successed!");
+ DA_LOG.debug("replay thread join successed!");
} catch (InterruptedException e) {
e.printStackTrace();
- System.out.println("play thread join interrupted!");
+ DA_LOG.debug("play thread join interrupted!");
}
playThread = null;
}
import org.tizen.dynamicanalyzer.ui.page.BaseView;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
public class AnalyzerUtil {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
// FIXME start
private static TimelineView timelineComposite;
if (sourceLocation.isDirectory()) {
if (!targetLocation.exists()) {
if (!targetLocation.mkdir()) {
- System.out
- .println("Copy Failed : target directory create failed..");
+ DA_LOG.debug("Copy Failed : target directory create failed..");
return;
}
}
retStr = CommonConstants.HEX_PREFIX
+ Long.toHexString(lValue).toUpperCase();
} else {
- System.out.println("Input type error!!");
+ DA_LOG.error("Input type error!!");
retStr = value.toString();
}
return retStr;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.tizen.dynamicanalyzer.ui.info.screenshot.SocketConstants;
+import org.tizen.dynamicanalyzer.util.DALogger;
public class JsonUtil {
+ private static final DALogger DA_LOG = DALogger.getInstance();
+
public static final String CMD_SCREENDUMP = "screendump";
public static final String CMD_EXECUTE = "execute";
public static final String CMD_ARGS = "arguments";
public static JSONObject decodeObject(String message) {
JSONObject obj = null;
if (null == message) {
- System.out.println("decodeObject - message string is null.");
+ DA_LOG.debug("decodeObject - message string is null.");
return obj;
}
try {
obj = (JSONObject) parser.parse(message);
} catch (ParseException e) {
e.printStackTrace();
- System.out.println("[info] position: " + e.getPosition());
- System.out.println("[info] " + e.toString());
+ DA_LOG.info("position: " + e.getPosition());
+ DA_LOG.info(e.toString());
}
return obj;
}
public static JSONArray decodeArray(String message) {
JSONArray obj = null;
if (null == message) {
- System.out.println("decodeArray - message string is null.");
+ DA_LOG.debug("decodeArray - message string is null.");
return obj;
}
try {
obj = (JSONArray) parser.parse(message);
} catch (ParseException e) {
- System.out.println("[info] position: " + e.getPosition());
- System.out.println("[info] " + e.toString());
+ DA_LOG.info("position: " + e.getPosition());
+ DA_LOG.info(e.toString());
}
return obj;
}
public static String decodeString(String message) {
if (null == message) {
- System.out.println("decodeArray - message string is null.");
+ DA_LOG.debug("decodeArray - message string is null.");
return null;
}
JSONObject obj = decodeObject(message);