X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=libringbuffer%2Fbackend_internal.h;h=3c09382ed117b262f5f4baf275043271f069359d;hb=a9ff648cc;hp=373e3147e383c143dc7273253d584f922a421a50;hpb=e92f3e285939848f248af08f11a39a04a7fcf852;p=lttng-ust.git diff --git a/libringbuffer/backend_internal.h b/libringbuffer/backend_internal.h index 373e3147..3c09382e 100644 --- a/libringbuffer/backend_internal.h +++ b/libringbuffer/backend_internal.h @@ -45,7 +45,8 @@ int channel_backend_init(struct channel_backend *chanb, const char *name, const struct lttng_ust_lib_ring_buffer_config *config, size_t subbuf_size, - size_t num_subbuf, struct lttng_ust_shm_handle *handle); + size_t num_subbuf, struct lttng_ust_shm_handle *handle, + const char *shm_path); void channel_backend_free(struct channel_backend *chanb, struct lttng_ust_shm_handle *handle); @@ -240,9 +241,10 @@ unsigned long subbuffer_get_records_count( /* * Must be executed at subbuffer delivery when the writer has _exclusive_ - * subbuffer access. See ring_buffer_check_deliver() for details. - * ring_buffer_get_records_count() must be called to get the records count - * before this function, because it resets the records_commit count. + * subbuffer access. See lib_ring_buffer_check_deliver() for details. + * lib_ring_buffer_get_records_count() must be called to get the records + * count before this function, because it resets the records_commit + * count. */ static inline unsigned long subbuffer_count_records_overrun( @@ -446,9 +448,21 @@ do { \ inline_memcpy(dest, src, __len); \ } while (0) +/* + * write len bytes to dest with c + */ +static inline +void lib_ring_buffer_do_memset(char *dest, int c, unsigned long len) +{ + unsigned long i; + + for (i = 0; i < len; i++) + dest[i] = c; +} + /* arch-agnostic implementation */ -static inline int fls(unsigned int x) +static inline int lttng_ust_fls(unsigned int x) { int r = 32; @@ -481,7 +495,7 @@ static inline int get_count_order(unsigned int count) { int order; - order = fls(count) - 1; + order = lttng_ust_fls(count) - 1; if (count & (count - 1)) order++; return order;