From: Michael Jeanson Date: Tue, 30 Mar 2021 23:30:49 +0000 (-0400) Subject: cleanup: function attribute 'always_inline' X-Git-Tag: v2.13.0-rc1~162 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5f6daaef86c3b4cff5af523cbbd8f2630634259d;p=lttng-ust.git cleanup: function attribute 'always_inline' Function attributes should be located after the declaration. Change-Id: If2b7dbb9a80870ec403b6ffbd115154dd739b508 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/ust-helper.h b/include/ust-helper.h index e8b393a8..f1695516 100644 --- a/include/ust-helper.h +++ b/include/ust-helper.h @@ -11,7 +11,10 @@ #include -static inline __attribute__((always_inline)) +static inline +void *zmalloc(size_t len) + __attribute__((always_inline)); +static inline void *zmalloc(size_t len) { return calloc(len, 1); diff --git a/libringbuffer/backend.h b/libringbuffer/backend.h index 80fa2b64..6b18e4cf 100644 --- a/libringbuffer/backend.h +++ b/libringbuffer/backend.h @@ -63,7 +63,12 @@ lib_ring_buffer_read_offset_address(struct lttng_ust_lib_ring_buffer_backend *bu * backend-specific memcpy() operation. Calls the slow path (_ring_buffer_write) * if copy is crossing a page boundary. */ -static inline __attribute__((always_inline)) +static inline +void lib_ring_buffer_write(const struct lttng_ust_lib_ring_buffer_config *config, + struct lttng_ust_lib_ring_buffer_ctx *ctx, + const void *src, size_t len) + __attribute__((always_inline)); +static inline void lib_ring_buffer_write(const struct lttng_ust_lib_ring_buffer_config *config, struct lttng_ust_lib_ring_buffer_ctx *ctx, const void *src, size_t len) @@ -99,7 +104,11 @@ void lib_ring_buffer_write(const struct lttng_ust_lib_ring_buffer_config *config * terminating character is found in @src. Returns the number of bytes * copied. Does *not* terminate @dest with NULL terminating character. */ -static inline __attribute__((always_inline)) +static inline +size_t lib_ring_buffer_do_strcpy(const struct lttng_ust_lib_ring_buffer_config *config, + char *dest, const char *src, size_t len) + __attribute__((always_inline)); +static inline size_t lib_ring_buffer_do_strcpy(const struct lttng_ust_lib_ring_buffer_config *config, char *dest, const char *src, size_t len) { @@ -135,7 +144,12 @@ size_t lib_ring_buffer_do_strcpy(const struct lttng_ust_lib_ring_buffer_config * * character is found in @src before @len - 1 characters are copied, pad * the buffer with @pad characters (e.g. '#'). */ -static inline __attribute__((always_inline)) +static inline +void lib_ring_buffer_strcpy(const struct lttng_ust_lib_ring_buffer_config *config, + struct lttng_ust_lib_ring_buffer_ctx *ctx, + const char *src, size_t len, char pad) + __attribute__((always_inline)); +static inline void lib_ring_buffer_strcpy(const struct lttng_ust_lib_ring_buffer_config *config, struct lttng_ust_lib_ring_buffer_ctx *ctx, const char *src, size_t len, char pad) @@ -200,7 +214,12 @@ void lib_ring_buffer_strcpy(const struct lttng_ust_lib_ring_buffer_config *confi * The length of the pascal strings in the ring buffer is explicit: it * is either the array or sequence length. */ -static inline __attribute__((always_inline)) +static inline +void lib_ring_buffer_pstrcpy(const struct lttng_ust_lib_ring_buffer_config *config, + struct lttng_ust_lib_ring_buffer_ctx *ctx, + const char *src, size_t len, char pad) + __attribute__((always_inline)); +static inline void lib_ring_buffer_pstrcpy(const struct lttng_ust_lib_ring_buffer_config *config, struct lttng_ust_lib_ring_buffer_ctx *ctx, const char *src, size_t len, char pad) diff --git a/libringbuffer/backend_internal.h b/libringbuffer/backend_internal.h index 0e5e7940..67c6e901 100644 --- a/libringbuffer/backend_internal.h +++ b/libringbuffer/backend_internal.h @@ -596,7 +596,11 @@ int update_read_sb_index(const struct lttng_ust_lib_ring_buffer_config *config, #define inline_memcpy(dest, src, n) memcpy(dest, src, n) #endif -static inline __attribute__((always_inline)) +static inline +void lttng_inline_memcpy(void *dest, const void *src, + unsigned long len) + __attribute__((always_inline)); +static inline void lttng_inline_memcpy(void *dest, const void *src, unsigned long len) {