projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sessiond: use `loglevel_value` and `loglevel_type` names
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
ust-metadata.c
diff --git
a/src/bin/lttng-sessiond/ust-metadata.c
b/src/bin/lttng-sessiond/ust-metadata.c
index f4f273b16cc7021e2f4869e52b42dfd7f14799dd..afcb89ddf351eef5386241997bf2ea28be4b9296 100644
(file)
--- a/
src/bin/lttng-sessiond/ust-metadata.c
+++ b/
src/bin/lttng-sessiond/ust-metadata.c
@@
-38,6
+38,7
@@
#define max_t(type, a, b) ((type) ((a) > (b) ? (a) : (b)))
#endif
#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 {
#define NR_CLOCK_OFFSET_SAMPLES 10
struct offset_sample {
@@
-358,7
+359,7
@@
int ust_metadata_event_statedump(struct ust_registry_session *session,
ret = lttng_metadata_printf(session,
" loglevel = %d;\n",
ret = lttng_metadata_printf(session,
" loglevel = %d;\n",
- event->loglevel);
+ event->loglevel
_value
);
if (ret)
goto end;
if (ret)
goto end;
@@
-524,6
+525,7
@@
static
int measure_single_clock_offset(struct offset_sample *sample)
{
uint64_t offset, monotonic[2], measure_delta, realtime;
int measure_single_clock_offset(struct offset_sample *sample)
{
uint64_t offset, monotonic[2], measure_delta, realtime;
+ uint64_t tcf = trace_clock_freq();
struct timespec rts = { 0, 0 };
int ret;
struct timespec rts = { 0, 0 };
int ret;
@@
-542,8
+544,12
@@
int measure_single_clock_offset(struct offset_sample *sample)
return 0;
}
offset = (monotonic[0] + monotonic[1]) >> 1;
return 0;
}
offset = (monotonic[0] + monotonic[1]) >> 1;
- realtime = (uint64_t) rts.tv_sec * 1000000000ULL;
- realtime += rts.tv_nsec;
+ realtime = (uint64_t) rts.tv_sec * tcf;
+ if (tcf == NSEC_PER_SEC) {
+ realtime += rts.tv_nsec;
+ } else {
+ realtime += (uint64_t) rts.tv_nsec * tcf / NSEC_PER_SEC;
+ }
offset = realtime - offset;
sample->offset = offset;
sample->measure_delta = measure_delta;
offset = realtime - offset;
sample->offset = offset;
sample->measure_delta = measure_delta;
@@
-685,8
+691,8
@@
int ust_metadata_session_statedump(struct ust_registry_session *session,
ret = lttng_metadata_printf(session,
"clock {\n"
ret = lttng_metadata_printf(session,
"clock {\n"
- " name =
%s
;\n",
- "monotonic"
+ " name =
\"%s\"
;\n",
+ trace_clock_name()
);
if (ret)
goto end;
);
if (ret)
goto end;
@@
-701,11
+707,12
@@
int ust_metadata_session_statedump(struct ust_registry_session *session,
}
ret = lttng_metadata_printf(session,
}
ret = lttng_metadata_printf(session,
- " description = \"
Monotonic Clock
\";\n"
+ " description = \"
%s
\";\n"
" freq = %" PRIu64 "; /* Frequency, in Hz */\n"
" /* clock value offset from Epoch is: offset * (1/freq) */\n"
" offset = %" PRIu64 ";\n"
"};\n\n",
" freq = %" PRIu64 "; /* Frequency, in Hz */\n"
" /* clock value offset from Epoch is: offset * (1/freq) */\n"
" offset = %" PRIu64 ";\n"
"};\n\n",
+ trace_clock_description(),
trace_clock_freq(),
measure_clock_offset()
);
trace_clock_freq(),
measure_clock_offset()
);
@@
-715,20
+722,23
@@
int ust_metadata_session_statedump(struct ust_registry_session *session,
ret = lttng_metadata_printf(session,
"typealias integer {\n"
" size = 27; align = 1; signed = false;\n"
ret = lttng_metadata_printf(session,
"typealias integer {\n"
" size = 27; align = 1; signed = false;\n"
- " map = clock.
monotonic
.value;\n"
+ " map = clock.
%s
.value;\n"
"} := uint27_clock_monotonic_t;\n"
"\n"
"typealias integer {\n"
" size = 32; align = %u; signed = false;\n"
"} := uint27_clock_monotonic_t;\n"
"\n"
"typealias integer {\n"
" size = 32; align = %u; signed = false;\n"
- " map = clock.
monotonic
.value;\n"
+ " map = clock.
%s
.value;\n"
"} := uint32_clock_monotonic_t;\n"
"\n"
"typealias integer {\n"
" size = 64; align = %u; signed = false;\n"
"} := uint32_clock_monotonic_t;\n"
"\n"
"typealias integer {\n"
" size = 64; align = %u; signed = false;\n"
- " map = clock.
monotonic
.value;\n"
+ " map = clock.
%s
.value;\n"
"} := uint64_clock_monotonic_t;\n\n",
"} := uint64_clock_monotonic_t;\n\n",
+ trace_clock_name(),
session->uint32_t_alignment,
session->uint32_t_alignment,
- session->uint64_t_alignment
+ trace_clock_name(),
+ session->uint64_t_alignment,
+ trace_clock_name()
);
if (ret)
goto end;
);
if (ret)
goto end;
This page took
0.029069 seconds
and
5
git commands to generate.