X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=lttng-events.c;h=1f2863945a74f977fcc38b2635020064b80f84aa;hb=bf1a91796a6809bac0c4dbd51d8eda0c75a14f23;hp=bd6f44d977dba95e36c769f828b60e4fb9502c1f;hpb=dcb93448766003b5d8d19a57e2dd44efa8ea0035;p=lttng-modules.git diff --git a/lttng-events.c b/lttng-events.c index bd6f44d9..1f286394 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -36,21 +36,21 @@ #include #include #include -#include "wrapper/file.h" +#include #include #include #include -#include "wrapper/uuid.h" -#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ -#include "wrapper/random.h" -#include "wrapper/tracepoint.h" -#include "wrapper/list.h" -#include "lttng-kernel-version.h" -#include "lttng-events.h" -#include "lttng-tracer.h" -#include "lttng-abi-old.h" -#include "wrapper/vzalloc.h" +#include +#include /* for wrapper_vmalloc_sync_all() */ +#include +#include +#include +#include +#include +#include +#include +#include #define METADATA_CACHE_DEFAULT_SIZE 4096 @@ -2023,11 +2023,11 @@ int _lttng_event_header_declare(struct lttng_session *session) * taken at start of trace. * Yes, this is only an approximation. Yes, we can (and will) do better * in future versions. - * Return 0 if offset is negative. It may happen if the system sets - * the REALTIME clock to 0 after boot. + * This function may return a negative offset. It may happen if the + * system sets the REALTIME clock to 0 after boot. */ static -uint64_t measure_clock_offset(void) +int64_t measure_clock_offset(void) { uint64_t monotonic_avg, monotonic[2], realtime; uint64_t tcf = trace_clock_freq(); @@ -2053,8 +2053,6 @@ uint64_t measure_clock_offset(void) realtime += n; } offset = (int64_t) realtime - monotonic_avg; - if (offset < 0) - return 0; return offset; } @@ -2166,11 +2164,11 @@ int _lttng_session_metadata_statedump(struct lttng_session *session) " description = \"%s\";\n" " freq = %llu; /* Frequency, in Hz */\n" " /* clock value offset from Epoch is: offset * (1/freq) */\n" - " offset = %llu;\n" + " offset = %lld;\n" "};\n\n", trace_clock_description(), (unsigned long long) trace_clock_freq(), - (unsigned long long) measure_clock_offset() + (long long) measure_clock_offset() ); if (ret) goto end; @@ -2271,6 +2269,9 @@ static int __init lttng_events_init(void) if (ret) return ret; ret = wrapper_get_pfnblock_flags_mask_init(); + if (ret) + return ret; + ret = wrapper_get_pageblock_flags_mask_init(); if (ret) return ret; ret = lttng_context_init();