#include <unistd.h>
#include <inttypes.h>
#include <common/common.h>
+#include <common/time.h>
#include "ust-registry.h"
#include "ust-clock.h"
#define max_t(type, a, b) ((type) ((a) > (b) ? (a) : (b)))
#endif
-#define NSEC_PER_SEC 1000000000ULL
#define NR_CLOCK_OFFSET_SAMPLES 10
struct offset_sample {
r -= 2;
}
if (!(x & 0x80000000U)) {
- x <<= 1;
r -= 1;
}
return r;
if (ret) {
goto end;
}
+ nesting++;
/* Dump all entries */
for (i = 0; i < nr_entries; i++) {
const struct ustctl_enum_entry *entry = &entries[i];
goto end;
}
}
- ret = lttng_metadata_printf(session,
- "\" = ");
+ ret = lttng_metadata_printf(session, "\"");
if (ret) {
goto end;
}
- if (entry->start == entry->end) {
- ret = lttng_metadata_printf(session,
- "%d,\n",
- entry->start);
+
+ if (entry->u.extra.options &
+ USTCTL_UST_ENUM_ENTRY_OPTION_IS_AUTO) {
+ ret = lttng_metadata_printf(session, ",\n");
+ if (ret) {
+ goto end;
+ }
} else {
ret = lttng_metadata_printf(session,
- "%d ... %d,\n",
- entry->start, entry->end);
- }
- if (ret) {
- goto end;
+ " = ");
+ if (ret) {
+ goto end;
+ }
+
+ if (entry->start.signedness) {
+ ret = lttng_metadata_printf(session,
+ "%lld", (long long) entry->start.value);
+ } else {
+ ret = lttng_metadata_printf(session,
+ "%llu", entry->start.value);
+ }
+ if (ret) {
+ goto end;
+ }
+
+ if (entry->start.signedness == entry->end.signedness &&
+ entry->start.value ==
+ entry->end.value) {
+ ret = lttng_metadata_printf(session, ",\n");
+ } else {
+ if (entry->end.signedness) {
+ ret = lttng_metadata_printf(session,
+ " ... %lld,\n",
+ (long long) entry->end.value);
+ } else {
+ ret = lttng_metadata_printf(session,
+ " ... %llu,\n",
+ entry->end.value);
+ }
+ }
+ if (ret) {
+ goto end;
+ }
}
}
+ nesting--;
sanitize_ctf_identifier(identifier, field_name);
ret = print_tabs(session, nesting);
if (ret) {
ret = _lttng_field_statedump(session,
fields, nr_fields,
iter_field, nesting + 1);
+ if (ret) {
+ goto end;
+ }
}
sanitize_ctf_identifier(identifier, variant->name);
ret = print_tabs(session, nesting);
+ if (ret) {
+ goto end;
+ }
ret = lttng_metadata_printf(session,
"} _%s;\n",
identifier);
" uint64_clock_monotonic_t timestamp_end;\n"
" uint64_t content_size;\n"
" uint64_t packet_size;\n"
+ " uint64_t packet_seq_num;\n"
" unsigned long events_discarded;\n"
" uint32_t cpu_id;\n"
"};\n\n"
int ret;
monotonic[0] = trace_clock_read64();
- ret = clock_gettime(CLOCK_REALTIME, &rts);
+ ret = lttng_clock_gettime(CLOCK_REALTIME, &rts);
if (ret < 0) {
return ret;
}
" uint32_t magic;\n"
" uint8_t uuid[16];\n"
" uint32_t stream_id;\n"
+ " uint64_t stream_instance_id;\n"
" };\n"
"};\n\n",
session->uint8_t_alignment,