X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=include%2Fringbuffer%2Ffrontend_internal.h;h=39dbbf080cc9d23558607727d62ca8af12d270ae;hb=3a6d09342ff21074eea4a686f459d921ca46c628;hp=999a7bb9993273a94c18dd2f7e2f861e04bd72a9;hpb=fb4b909790d4baf3e9971aca8e4ee8b3150098f6;p=lttng-modules.git diff --git a/include/ringbuffer/frontend_internal.h b/include/ringbuffer/frontend_internal.h index 999a7bb9..39dbbf08 100644 --- a/include/ringbuffer/frontend_internal.h +++ b/include/ringbuffer/frontend_internal.h @@ -71,62 +71,63 @@ unsigned long subbuf_index(unsigned long offset, struct lttng_kernel_ring_buffer } /* - * Last TSC comparison functions. Check if the current TSC overflows tsc_bits - * bits from the last TSC read. When overflows are detected, the full 64-bit - * timestamp counter should be written in the record header. Reads and writes - * last_tsc atomically. + * Last timestamp comparison functions. Check if the current timestamp + * overflows timestamp_bits bits from the last timestamp read. When + * overflows are detected, the full 64-bit timestamp counter should be + * written in the record header. Reads and writes last_timestamp + * atomically. */ #if (BITS_PER_LONG == 32) static inline -void save_last_tsc(const struct lttng_kernel_ring_buffer_config *config, - struct lttng_kernel_ring_buffer *buf, u64 tsc) +void save_last_timestamp(const struct lttng_kernel_ring_buffer_config *config, + struct lttng_kernel_ring_buffer *buf, u64 timestamp) { - if (config->tsc_bits == 0 || config->tsc_bits == 64) + if (config->timestamp_bits == 0 || config->timestamp_bits == 64) return; /* * Ensure the compiler performs this update in a single instruction. */ - v_set(config, &buf->last_tsc, (unsigned long)(tsc >> config->tsc_bits)); + v_set(config, &buf->last_timestamp, (unsigned long)(timestamp >> config->timestamp_bits)); } static inline -int last_tsc_overflow(const struct lttng_kernel_ring_buffer_config *config, - struct lttng_kernel_ring_buffer *buf, u64 tsc) +int last_timestamp_overflow(const struct lttng_kernel_ring_buffer_config *config, + struct lttng_kernel_ring_buffer *buf, u64 timestamp) { - unsigned long tsc_shifted; + unsigned long timestamp_shifted; - if (config->tsc_bits == 0 || config->tsc_bits == 64) + if (config->timestamp_bits == 0 || config->timestamp_bits == 64) return 0; - tsc_shifted = (unsigned long)(tsc >> config->tsc_bits); - if (unlikely(tsc_shifted - - (unsigned long)v_read(config, &buf->last_tsc))) + timestamp_shifted = (unsigned long)(timestamp >> config->timestamp_bits); + if (unlikely(timestamp_shifted + - (unsigned long)v_read(config, &buf->last_timestamp))) return 1; else return 0; } #else static inline -void save_last_tsc(const struct lttng_kernel_ring_buffer_config *config, - struct lttng_kernel_ring_buffer *buf, u64 tsc) +void save_last_timestamp(const struct lttng_kernel_ring_buffer_config *config, + struct lttng_kernel_ring_buffer *buf, u64 timestamp) { - if (config->tsc_bits == 0 || config->tsc_bits == 64) + if (config->timestamp_bits == 0 || config->timestamp_bits == 64) return; - v_set(config, &buf->last_tsc, (unsigned long)tsc); + v_set(config, &buf->last_timestamp, (unsigned long)timestamp); } static inline -int last_tsc_overflow(const struct lttng_kernel_ring_buffer_config *config, - struct lttng_kernel_ring_buffer *buf, u64 tsc) +int last_timestamp_overflow(const struct lttng_kernel_ring_buffer_config *config, + struct lttng_kernel_ring_buffer *buf, u64 timestamp) { - if (config->tsc_bits == 0 || config->tsc_bits == 64) + if (config->timestamp_bits == 0 || config->timestamp_bits == 64) return 0; - if (unlikely((tsc - v_read(config, &buf->last_tsc)) - >> config->tsc_bits)) + if (unlikely((timestamp - v_read(config, &buf->last_timestamp)) + >> config->timestamp_bits)) return 1; else return 0; @@ -264,7 +265,7 @@ int lib_ring_buffer_reserve_committed(const struct lttng_kernel_ring_buffer_conf } /* - * Receive end of subbuffer TSC as parameter. It has been read in the + * Receive end of subbuffer timestamp as parameter. It has been read in the * space reservation loop of either reserve or switch, which ensures it * progresses monotonically with event records in the buffer. Therefore, * it ensures that the end timestamp of a subbuffer is <= begin