Currently, only the lttng-modules version is of use for the
analyses. However, multi-domain traces, combining UST and modules,
could lead to unpredictable results wherein the tracer_version was
erroneously identified as that of the userspace tracer, which was
problematic when its version differed from that of the kernel tracer.
Extracting the version directly from the kernel trace's metadata
corrects this issue.
Signed-off-by: Antoine Busque <abusque@efficios.com>
import argparse
import json
+import os
import re
import sys
import subprocess
self._traces.remove_trace(handle)
def _read_tracer_version(self):
+ kernel_path = None
+ for root, _, _ in os.walk(self._args.path):
+ if root.endswith('kernel'):
+ kernel_path = root
+ break
+
+ if kernel_path is None:
+ self._gen_error('Could not find kernel trace directory')
+
try:
metadata = subprocess.getoutput(
- 'babeltrace -o ctf-metadata "%s"' % self._args.path)
+ 'babeltrace -o ctf-metadata "%s"' % kernel_path)
except subprocess.CalledProcessError:
self._gen_error('Cannot run babeltrace on the trace, cannot read'
' tracer version')