/**
* The trace log level.
*/
- private TraceLogLevel fLogLevel = TraceLogLevel.TRACE_DEFAULT;
+ private TraceLogLevel fLogLevel = TraceLogLevel.TRACE_DEBUG;
// ------------------------------------------------------------------------
// Constructors
public void setEventType(String typeName) {
if(TraceEventType.TRACEPOINT.getInName().equals(typeName)) {
fEventType = TraceEventType.TRACEPOINT;
+ } else if(TraceEventType.SYSCALL.getInName().equals(typeName)) {
+ fEventType = TraceEventType.SYSCALL;
+ } else if (TraceEventType.PROBE.getInName().equals(typeName)) {
+ fEventType = TraceEventType.PROBE;
} else {
fEventType = TraceEventType.UNKNOWN;
}
fLogLevel = TraceLogLevel.TRACE_NOTICE;
} else if(TraceLogLevel.TRACE_INFO.getInName().equals(levelName)) {
fLogLevel = TraceLogLevel.TRACE_INFO;
- } else if(TraceLogLevel.TRACE_SYSTEM.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_SYSTEM;
- } else if(TraceLogLevel.TRACE_PROGRAM.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_PROGRAM;
- } else if(TraceLogLevel.TRACE_PROCESS.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_PROCESS;
- } else if(TraceLogLevel.TRACE_MODULE.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_MODULE;
- } else if(TraceLogLevel.TRACE_UNIT.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_UNIT;
- } else if(TraceLogLevel.TRACE_FUNCTION.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_FUNCTION;
- } else if(TraceLogLevel.TRACE_DEFAULT.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_DEFAULT;
- } else if(TraceLogLevel.TRACE_VERBOSE.getInName().equals(levelName)) {
- fLogLevel = TraceLogLevel.TRACE_VERBOSE;
+ } else if(TraceLogLevel.TRACE_DEBUG_SYSTEM.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_SYSTEM;
+ } else if(TraceLogLevel.TRACE_DEBUG_PROGRAM.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_PROGRAM;
+ } else if(TraceLogLevel.TRACE_DEBUG_PROCESS.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_PROCESS;
+ } else if(TraceLogLevel.TRACE_DEBUG_MODULE.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_MODULE;
+ } else if(TraceLogLevel.TRACE_DEBUG_UNIT.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_UNIT;
+ } else if(TraceLogLevel.TRACE_DEBUG_FUNCTION.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_FUNCTION;
+ } else if(TraceLogLevel.TRACE_DEBUG_LINE.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.TRACE_DEBUG_LINE;
} else if(TraceLogLevel.TRACE_DEBUG.getInName().equals(levelName)) {
fLogLevel = TraceLogLevel.TRACE_DEBUG;
+ } else if(TraceLogLevel.LEVEL_UNKNOWN.getInName().equals(levelName)) {
+ fLogLevel = TraceLogLevel.LEVEL_UNKNOWN;
} else {
- fLogLevel = TraceLogLevel.TRACE_DEFAULT;
+ fLogLevel = TraceLogLevel.TRACE_DEBUG;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.lttng.ui.views.control.model.ITraceInfo#formatString()
+ */
+ @SuppressWarnings("nls")
+ @Override
+ public String formatString() {
+ StringBuffer output = new StringBuffer();
+ // ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)");
+ output.append("\n ");
+ output.append(getName());
+ if (fLogLevel != TraceLogLevel.LEVEL_UNKNOWN) {
+ output.append(" (loglevel: ");
+ output.append(fLogLevel.getInName());
+ output.append(" (");
+ output.append(fLogLevel.ordinal());
+ output.append("))");
}
+ output.append(" (type: ");
+ output.append(fEventType.getInName());
+ output.append(")");
+ return output.toString();
}
/*
*/
@Override
public int hashCode() {
- int result = 17;
- result = 37 * result + super.hashCode();
- result = 37 * result + fEventType.ordinal();
- result = 37 * result + fLogLevel.ordinal();
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((fEventType == null) ? 0 : (fEventType.ordinal() + 1));
+ result = prime * result + ((fLogLevel == null) ? 0 : (fLogLevel.ordinal() + 1));
return result;
- }
+ }
/*
* (non-Javadoc)
* @see org.eclipse.linuxtools.lttng.ui.views.control.model.impl.TraceInfo#equals(java.lang.Object)
*/
@Override
- public boolean equals(Object other) {
- if (!(other instanceof BaseEventInfo)) {
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
return false;
}
-
- BaseEventInfo otherInfo = (BaseEventInfo) other;
- if (!super.equals(otherInfo)) {
+ if (getClass() != obj.getClass()) {
return false;
}
-
- if (fEventType.ordinal() != otherInfo.fEventType.ordinal()) {
+ BaseEventInfo other = (BaseEventInfo) obj;
+ if (fEventType != other.fEventType) {
return false;
}
-
- if (fLogLevel.ordinal() != otherInfo.fLogLevel.ordinal()) {
+ if (fLogLevel != other.fLogLevel) {
return false;
}
return true;
- }
+ }
/*
* (non-Javadoc)
output.append(")]");
return output.toString();
}
+
+
+
+
}
\ No newline at end of file