[PATCH] CTF: use tracer_name for perf-CTF traces

From: Sebastian Andrzej Siewior
Date: Wed Nov 26 2014 - 12:04:53 EST


domain will be set to kernel for both, perf and lttng traces. The
tracer_name will be set to perf if the trace is generated by perf and
otherwise lttng-modules if created by thet lttng tool.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
.../tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java
index a58269f..03a09b9 100644
--- a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java
+++ b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java
@@ -96,12 +96,11 @@ public class LttngKernelTrace extends CtfTmfTrace {
* metadata
*/
Map<String, String> traceEnv = this.getCTFTrace().getEnvironment();
- String domain = traceEnv.get("domain"); //$NON-NLS-1$
String tracerName = traceEnv.get("tracer_name"); //$NON-NLS-1$
String tracerMajor = traceEnv.get("tracer_major"); //$NON-NLS-1$
String tracerMinor = traceEnv.get("tracer_minor"); //$NON-NLS-1$

- if ("\"kernel-perf\"".equals(domain)) { //$NON-NLS-1$
+ if ("\"perf\"".equals(tracerName)) { //$NON-NLS-1$
fOriginTracer = OriginTracer.PERF;

} else if ("\"lttng-modules\"".equals(tracerName) && //$NON-NLS-1$
@@ -130,7 +129,7 @@ public class LttngKernelTrace extends CtfTmfTrace {
CTFTrace temp = new CTFTrace(path);
/* Make sure the domain is "kernel" in the trace's env vars */
String dom = temp.getEnvironment().get("domain"); //$NON-NLS-1$
- if (dom != null && dom.startsWith("\"kernel")) { //$NON-NLS-1$
+ if (dom != null && dom.equals("\"kernel\"")) { //$NON-NLS-1$
return new TraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID);
}
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngKernelTrace_DomainError);
--
2.1.3

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/