For support of older 2.0-pre traces.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
$(top_builddir)/lib/libbabeltrace.la \
$(top_builddir)/formats/libbabeltrace_registry.la \
$(top_builddir)/formats/ctf/libctf.la \
+ $(top_builddir)/formats/ctf/metadata/libctf-ast.la \
$(top_builddir)/formats/ctf-text/libctf-text.la \
$(top_builddir)/formats/bt-dummy/libbt-dummy.la
OPT_CLOCK_SECONDS,
OPT_CLOCK_DATE,
OPT_CLOCK_GMT,
+ OPT_CLOCK_FORCE_CORRELATE,
};
static struct poptOption long_options[] = {
{ "clock-seconds", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_SECONDS, NULL, NULL },
{ "clock-date", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_DATE, NULL, NULL },
{ "clock-gmt", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_GMT, NULL, NULL },
+ { "clock-force-correlate", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_FORCE_CORRELATE, NULL, NULL },
{ NULL, 0, 0, NULL, 0, NULL, NULL },
};
fprintf(fp, " (default is: [hh:mm:ss.ns])\n");
fprintf(fp, " --clock-date Print clock date\n");
fprintf(fp, " --clock-gmt Print clock in GMT time zone (default: local time zone)\n");
+ fprintf(fp, " --clock-force-correlate Assume that clocks are inherently correlated\n");
+ fprintf(fp, " across traces.\n");
list_formats(fp);
fprintf(fp, "\n");
}
case OPT_CLOCK_GMT:
opt_clock_gmt = 1;
break;
+ case OPT_CLOCK_FORCE_CORRELATE:
+ opt_clock_force_correlate = 1;
+ break;
default:
ret = -EINVAL;
#define _cds_list_first_entry(ptr, type, member) \
cds_list_entry((ptr)->next, type, member)
+int opt_clock_force_correlate;
+
static
struct declaration *ctf_type_specifier_list_visit(FILE *fd,
int depth, struct ctf_node *type_specifier_list,
if (ret)
goto error;
}
+ if (opt_clock_force_correlate) {
+ /*
+ * User requested to forcibly correlate the clock
+ * sources, even if we have no correlatation
+ * information.
+ */
+ if (!clock->absolute) {
+ fprintf(fd, "[warning] Forcibly correlating trace clock sources (--clock-force-correlate).\n");
+ }
+ clock->absolute = 1;
+ }
if (!CTF_CLOCK_FIELD_IS_SET(clock, name)) {
ret = -EPERM;
fprintf(fd, "[error] %s: missing namefield in clock declaration\n", __func__);
goto error;
}
if (g_hash_table_size(trace->clocks) > 0) {
- fprintf(stderr, "[error] Only CTF traces with a single clock description are supported by this babeltrace version.\n");
+ fprintf(fd, "[error] Only CTF traces with a single clock description are supported by this babeltrace version.\n");
ret = -EINVAL;
goto error;
}
clock->description = g_strdup("Default clock");
/* Default clock frequency is set to 1000000000 */
clock->freq = 1000000000ULL;
- clock->absolute = 0; /* Not an absolute reference across traces */
+ if (opt_clock_force_correlate) {
+ /*
+ * User requested to forcibly correlate the clock
+ * sources, even if we have no correlatation
+ * information.
+ */
+ if (!clock->absolute) {
+ fprintf(fd, "[warning] Forcibly correlating trace clock sources (--clock-force-correlate).\n");
+ }
+ clock->absolute = 1;
+ } else {
+ clock->absolute = 0; /* Not an absolute reference across traces */
+ }
trace->single_clock = clock;
g_hash_table_insert(trace->clocks, (gpointer) (unsigned long) clock->name, clock);
opt_clock_raw,
opt_clock_seconds,
opt_clock_date,
- opt_clock_gmt;
+ opt_clock_gmt,
+ opt_clock_force_correlate;
extern uint64_t opt_clock_offset;