From 2208d8b5689264e35ed0a660d8c3c82021cc0367 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 31 Mar 2021 12:19:05 -0400 Subject: [PATCH] cleanup: explicitly mark unused parameters (-Wunused-parameter) Add the 'unused' attribute to function parameters that are unused to allow turning on -Wunused-parameter and distinguish unused parameters that are actual errors. Change-Id: I5a4b3790ae84da0c5135a214f2a63b513bb199eb Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- .../aligner.cpp | 2 +- .../tester.cpp | 2 +- doc/examples/easy-ust/sample.c | 2 +- doc/examples/gen-tp/sample.c | 2 +- doc/examples/hello-static-lib/hello.c | 2 +- include/lttng/ringbuffer-context.h | 3 +- libcounter/counter-internal.h | 14 +++-- libcounter/counter.c | 7 ++- liblttng-ust-comm/lttng-ust-comm.c | 2 +- liblttng-ust-ctl/ustctl.c | 5 +- .../lttng-ust-cyg-profile-fast.c | 4 +- .../jni/common/lttng_ust_context.c | 6 +- .../jni/jul/lttng_ust_jul.c | 4 +- .../jni/log4j/lttng_ust_log4j.c | 4 +- liblttng-ust-java/LTTngUst.c | 10 +-- liblttng-ust-libc-wrapper/lttng-ust-malloc.c | 6 +- liblttng-ust/lttng-bytecode-interpreter.c | 14 +++-- liblttng-ust/lttng-bytecode-validator.c | 8 ++- liblttng-ust/lttng-bytecode.c | 4 +- liblttng-ust/lttng-context-cgroup-ns.c | 7 ++- liblttng-ust/lttng-context-cpu-id.c | 7 ++- liblttng-ust/lttng-context-ip.c | 5 +- liblttng-ust/lttng-context-ipc-ns.c | 7 ++- liblttng-ust/lttng-context-mnt-ns.c | 7 ++- liblttng-ust/lttng-context-net-ns.c | 7 ++- liblttng-ust/lttng-context-perf-counters.c | 3 +- liblttng-ust/lttng-context-pid-ns.c | 7 ++- liblttng-ust/lttng-context-procname.c | 7 ++- liblttng-ust/lttng-context-pthread-id.c | 7 ++- liblttng-ust/lttng-context-time-ns.c | 7 ++- liblttng-ust/lttng-context-user-ns.c | 7 ++- liblttng-ust/lttng-context-uts-ns.c | 7 ++- liblttng-ust/lttng-context-vegid.c | 7 ++- liblttng-ust/lttng-context-veuid.c | 7 ++- liblttng-ust/lttng-context-vgid.c | 7 ++- liblttng-ust/lttng-context-vpid.c | 7 ++- liblttng-ust/lttng-context-vsgid.c | 7 ++- liblttng-ust/lttng-context-vsuid.c | 7 ++- liblttng-ust/lttng-context-vtid.c | 7 ++- liblttng-ust/lttng-context-vuid.c | 7 ++- liblttng-ust/lttng-events.c | 5 +- .../lttng-ring-buffer-client-template.h | 47 +++++++++----- ...tng-ring-buffer-metadata-client-template.h | 63 +++++++++++-------- liblttng-ust/lttng-ust-abi.c | 20 +++--- liblttng-ust/lttng-ust-statedump.c | 6 +- liblttng-ust/rculfhash.c | 9 ++- liblttng-ust/rculfhash.h | 2 +- liblttng-ust/ust-core.c | 7 ++- libringbuffer/backend.h | 3 +- libringbuffer/backend_internal.h | 22 ++++--- libringbuffer/frontend.h | 10 +-- libringbuffer/frontend_api.h | 36 ++++++----- libringbuffer/frontend_internal.h | 15 ++--- libringbuffer/ring_buffer_backend.c | 6 +- libringbuffer/ring_buffer_frontend.c | 39 +++++++----- libringbuffer/ringbuffer-config.h | 3 +- libringbuffer/vatomic.h | 2 +- tests/benchmark/bench.c | 2 +- tests/compile/hello.cxx/hello.cpp | 2 +- tests/compile/hello/hello.c | 2 +- tests/compile/test-app-ctx/hello.c | 8 +-- tests/unit/libmsgpack/test_msgpack.c | 2 +- 62 files changed, 319 insertions(+), 234 deletions(-) diff --git a/doc/examples/cmake-multiple-shared-libraries/aligner.cpp b/doc/examples/cmake-multiple-shared-libraries/aligner.cpp index d28f7788..cdb1e908 100644 --- a/doc/examples/cmake-multiple-shared-libraries/aligner.cpp +++ b/doc/examples/cmake-multiple-shared-libraries/aligner.cpp @@ -6,7 +6,7 @@ #include "aligner-lib.h" -int main(int argc, char **argv) +int main(void) { align_query("molecule-foo"); diff --git a/doc/examples/cmake-multiple-shared-libraries/tester.cpp b/doc/examples/cmake-multiple-shared-libraries/tester.cpp index b0312a42..9c7a1d69 100644 --- a/doc/examples/cmake-multiple-shared-libraries/tester.cpp +++ b/doc/examples/cmake-multiple-shared-libraries/tester.cpp @@ -7,7 +7,7 @@ #include "aligner-lib.h" #include "tester-lib.h" -int main(int argc, char **argv) +int main(void) { /* Generate alignment */ align_query("moleculeX"); diff --git a/doc/examples/easy-ust/sample.c b/doc/examples/easy-ust/sample.c index 01478c27..36509ebc 100644 --- a/doc/examples/easy-ust/sample.c +++ b/doc/examples/easy-ust/sample.c @@ -14,7 +14,7 @@ #define TRACEPOINT_DEFINE #include "sample_component_provider.h" -int main(int argc, char **argv) +int main(void) { int i = 0; diff --git a/doc/examples/gen-tp/sample.c b/doc/examples/gen-tp/sample.c index 94feb5e5..e56c332e 100644 --- a/doc/examples/gen-tp/sample.c +++ b/doc/examples/gen-tp/sample.c @@ -8,7 +8,7 @@ #include #include "sample_tracepoint.h" -int main(int argc, char **argv) +int main(void) { int i = 0; diff --git a/doc/examples/hello-static-lib/hello.c b/doc/examples/hello-static-lib/hello.c index e54b1e1b..8121d1fe 100644 --- a/doc/examples/hello-static-lib/hello.c +++ b/doc/examples/hello-static-lib/hello.c @@ -21,7 +21,7 @@ #include "ust_tests_hello.h" static -void inthandler(int sig) +void inthandler(int sig __attribute__((unused))) { printf("in SIGUSR1 handler\n"); tracepoint(ust_tests_hello, tptest_sighandler); diff --git a/include/lttng/ringbuffer-context.h b/include/lttng/ringbuffer-context.h index b80a69cf..8c9595fd 100644 --- a/include/lttng/ringbuffer-context.h +++ b/include/lttng/ringbuffer-context.h @@ -116,7 +116,8 @@ static inline unsigned int lttng_ust_lib_ring_buffer_align(size_t align_drift, size_t size_of_type) lttng_ust_notrace; static inline -unsigned int lttng_ust_lib_ring_buffer_align(size_t align_drift, size_t size_of_type) +unsigned int lttng_ust_lib_ring_buffer_align(size_t align_drift __attribute__((unused)), + size_t size_of_type __attribute__((unused))) { /* * On architectures with efficient unaligned memory access, the content diff --git a/libcounter/counter-internal.h b/libcounter/counter-internal.h index fbf96389..10668ecf 100644 --- a/libcounter/counter-internal.h +++ b/libcounter/counter-internal.h @@ -14,9 +14,10 @@ #include #include "counter-types.h" -static inline int lttng_counter_validate_indexes(const struct lib_counter_config *config, - struct lib_counter *counter, - const size_t *dimension_indexes) +static inline int lttng_counter_validate_indexes( + const struct lib_counter_config *config __attribute__((unused)), + struct lib_counter *counter, + const size_t *dimension_indexes) { size_t nr_dimensions = counter->nr_dimensions, i; @@ -28,9 +29,10 @@ static inline int lttng_counter_validate_indexes(const struct lib_counter_config } -static inline size_t lttng_counter_get_index(const struct lib_counter_config *config, - struct lib_counter *counter, - const size_t *dimension_indexes) +static inline size_t lttng_counter_get_index( + const struct lib_counter_config *config __attribute__((unused)), + struct lib_counter *counter, + const size_t *dimension_indexes) { size_t nr_dimensions = counter->nr_dimensions, i; size_t index = 0; diff --git a/libcounter/counter.c b/libcounter/counter.c index fae7266c..a825ac95 100644 --- a/libcounter/counter.c +++ b/libcounter/counter.c @@ -23,8 +23,9 @@ static size_t lttng_counter_get_dimension_nr_elements(struct lib_counter_dimensi return dimension->max_nr_elem; } -static int lttng_counter_init_stride(const struct lib_counter_config *config, - struct lib_counter *counter) +static int lttng_counter_init_stride( + const struct lib_counter_config *config __attribute__((unused)), + struct lib_counter *counter) { size_t nr_dimensions = counter->nr_dimensions; size_t stride = 1; @@ -162,7 +163,7 @@ int lttng_counter_set_global_sum_step(struct lib_counter *counter, static int validate_args(const struct lib_counter_config *config, - size_t nr_dimensions, + size_t nr_dimensions __attribute__((unused)), const size_t *max_nr_elem, int64_t global_sum_step, int global_counter_fd, diff --git a/liblttng-ust-comm/lttng-ust-comm.c b/liblttng-ust-comm/lttng-ust-comm.c index 8141ace3..998e5569 100644 --- a/liblttng-ust-comm/lttng-ust-comm.c +++ b/liblttng-ust-comm/lttng-ust-comm.c @@ -698,7 +698,7 @@ error: } int ustcomm_recv_stream_from_sessiond(int sock, - uint64_t *memory_map_size, + uint64_t *memory_map_size __attribute__((unused)), int *shm_fd, int *wakeup_fd) { ssize_t len; diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index e1c9ac7d..a12e9dd3 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -707,7 +707,8 @@ int ustctl_wait_quiescent(int sock) return 0; } -int ustctl_calibrate(int sock, struct lttng_ust_abi_calibrate *calibrate) +int ustctl_calibrate(int sock __attribute__((unused)), + struct lttng_ust_abi_calibrate *calibrate) { if (!calibrate) return -EINVAL; @@ -1809,7 +1810,7 @@ void ustctl_clear_buffer(struct ustctl_consumer_stream *stream) static struct lttng_ust_client_lib_ring_buffer_client_cb *get_client_cb( - struct lttng_ust_lib_ring_buffer *buf, + struct lttng_ust_lib_ring_buffer *buf __attribute__((unused)), struct lttng_ust_lib_ring_buffer_channel *chan) { const struct lttng_ust_lib_ring_buffer_config *config; diff --git a/liblttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c b/liblttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c index 2025bd93..bee7ac04 100644 --- a/liblttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c +++ b/liblttng-ust-cyg-profile/lttng-ust-cyg-profile-fast.c @@ -20,12 +20,12 @@ void __cyg_profile_func_enter(void *this_fn, void *call_site) void __cyg_profile_func_exit(void *this_fn, void *call_site) __attribute__((no_instrument_function)); -void __cyg_profile_func_enter(void *this_fn, void *call_site) +void __cyg_profile_func_enter(void *this_fn, void *call_site __attribute__((unused))) { tracepoint(lttng_ust_cyg_profile_fast, func_entry, this_fn); } -void __cyg_profile_func_exit(void *this_fn, void *call_site) +void __cyg_profile_func_exit(void *this_fn, void *call_site __attribute__((unused))) { tracepoint(lttng_ust_cyg_profile_fast, func_exit, this_fn); } diff --git a/liblttng-ust-java-agent/jni/common/lttng_ust_context.c b/liblttng-ust-java-agent/jni/common/lttng_ust_context.c index 95679f53..51b7c8e5 100644 --- a/liblttng-ust-java-agent/jni/common/lttng_ust_context.c +++ b/liblttng-ust-java-agent/jni/common/lttng_ust_context.c @@ -311,7 +311,7 @@ static void get_value_cb(struct lttng_ust_ctx_field *field, * so we create and register a corresponding provider on the C side. */ JNIEXPORT jlong JNICALL Java_org_lttng_ust_agent_context_LttngContextApi_registerProvider(JNIEnv *env, - jobject jobj, + jobject jobj __attribute__((unused)), jstring provider_name) { jboolean iscopy; @@ -367,8 +367,8 @@ error_jstr: * Called from the Java side when an application unregisters a context retriever, * so we unregister and delete the corresponding provider on the C side. */ -JNIEXPORT void JNICALL Java_org_lttng_ust_agent_context_LttngContextApi_unregisterProvider(JNIEnv *env, - jobject jobj, +JNIEXPORT void JNICALL Java_org_lttng_ust_agent_context_LttngContextApi_unregisterProvider(JNIEnv *env __attribute__((unused)), + jobject jobj __attribute__((unused)), jlong provider_ref) { struct lttng_ust_context_provider *provider = diff --git a/liblttng-ust-java-agent/jni/jul/lttng_ust_jul.c b/liblttng-ust-java-agent/jni/jul/lttng_ust_jul.c index 84578eec..afc9f111 100644 --- a/liblttng-ust-java-agent/jni/jul/lttng_ust_jul.c +++ b/liblttng-ust-java-agent/jni/jul/lttng_ust_jul.c @@ -18,7 +18,7 @@ * Deprecated function from before the context information was passed. */ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_jul_LttngJulApi_tracepoint(JNIEnv *env, - jobject jobj, + jobject jobj __attribute__((unused)), jstring msg, jstring logger_name, jstring class_name, @@ -46,7 +46,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_jul_LttngJulApi_tracepoint(JNIEn * Tracepoint used by Java applications using the JUL handler. */ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_jul_LttngJulApi_tracepointWithContext(JNIEnv *env, - jobject jobj, + jobject jobj __attribute__((unused)), jstring msg, jstring logger_name, jstring class_name, diff --git a/liblttng-ust-java-agent/jni/log4j/lttng_ust_log4j.c b/liblttng-ust-java-agent/jni/log4j/lttng_ust_log4j.c index ff7395c8..e88235a6 100644 --- a/liblttng-ust-java-agent/jni/log4j/lttng_ust_log4j.c +++ b/liblttng-ust-java-agent/jni/log4j/lttng_ust_log4j.c @@ -18,7 +18,7 @@ * Deprecated function from before the context information was passed. */ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_log4j_LttngLog4jApi_tracepoint(JNIEnv *env, - jobject jobj, + jobject jobj __attribute__((unused)), jstring msg, jstring logger_name, jstring class_name, @@ -53,7 +53,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_log4j_LttngLog4jApi_tracepoint(J * Tracepoint used by Java applications using the log4j handler. */ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_log4j_LttngLog4jApi_tracepointWithContext(JNIEnv *env, - jobject jobj, + jobject jobj __attribute__((unused)), jstring msg, jstring logger_name, jstring class_name, diff --git a/liblttng-ust-java/LTTngUst.c b/liblttng-ust-java/LTTngUst.c index 64b42f3b..f5e0c96b 100644 --- a/liblttng-ust-java/LTTngUst.c +++ b/liblttng-ust-java/LTTngUst.c @@ -12,7 +12,7 @@ #include "lttng_ust_java.h" JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointInt(JNIEnv *env, - jobject jobj, + jobject jobj __attribute__((unused)), jstring ev_name, jint payload) { @@ -25,7 +25,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointInt(JNIEnv *env, } JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointIntInt(JNIEnv *env, - jobject jobj, + jobject jobj __attribute__((unused)), jstring ev_name, jint payload1, jint payload2) @@ -39,7 +39,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointIntInt(JNIEnv *env, } JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointLong(JNIEnv *env, - jobject jobj, + jobject jobj __attribute__((unused)), jstring ev_name, jlong payload) { @@ -52,7 +52,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointLong(JNIEnv *env, } JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointLongLong(JNIEnv *env, - jobject jobj, + jobject jobj __attribute__((unused)), jstring ev_name, jlong payload1, jlong payload2) @@ -66,7 +66,7 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointLongLong(JNIEnv *en } JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointString(JNIEnv *env, - jobject jobj, + jobject jobj __attribute__((unused)), jstring ev_name, jstring payload) { diff --git a/liblttng-ust-libc-wrapper/lttng-ust-malloc.c b/liblttng-ust-libc-wrapper/lttng-ust-malloc.c index d407985f..e1ff8e80 100644 --- a/liblttng-ust-libc-wrapper/lttng-ust-malloc.c +++ b/liblttng-ust-libc-wrapper/lttng-ust-malloc.c @@ -65,7 +65,7 @@ static void ust_malloc_spin_lock(pthread_mutex_t *lock) __attribute__((unused)); static -void ust_malloc_spin_lock(pthread_mutex_t *lock) +void ust_malloc_spin_lock(pthread_mutex_t *lock __attribute__((unused))) { /* * The memory barrier within cmpxchg takes care of ordering @@ -80,7 +80,7 @@ static void ust_malloc_spin_unlock(pthread_mutex_t *lock) __attribute__((unused)); static -void ust_malloc_spin_unlock(pthread_mutex_t *lock) +void ust_malloc_spin_unlock(pthread_mutex_t *lock __attribute__((unused))) { /* * Ensure memory accesses within the critical section do not @@ -150,7 +150,7 @@ void *static_malloc(size_t size) } static -void static_free(void *ptr) +void static_free(void *ptr __attribute__((unused))) { /* no-op. */ } diff --git a/liblttng-ust/lttng-bytecode-interpreter.c b/liblttng-ust/lttng-bytecode-interpreter.c index 4ca1338a..56b06884 100644 --- a/liblttng-ust/lttng-bytecode-interpreter.c +++ b/liblttng-ust/lttng-bytecode-interpreter.c @@ -57,7 +57,8 @@ size_t get_str_or_seq_len(const struct estack_entry *entry) } static -int stack_star_glob_match(struct estack *stack, int top, const char *cmp_type) +int stack_star_glob_match(struct estack *stack, int top, + const char *cmp_type __attribute__((unused))) { const char *pattern; const char *candidate; @@ -83,7 +84,7 @@ int stack_star_glob_match(struct estack *stack, int top, const char *cmp_type) } static -int stack_strcmp(struct estack *stack, int top, const char *cmp_type) +int stack_strcmp(struct estack *stack, int top, const char *cmp_type __attribute__((unused))) { const char *p = estack_bx(stack, top)->u.s.str, *q = estack_ax(stack, top)->u.s.str; int ret; @@ -149,9 +150,10 @@ int stack_strcmp(struct estack *stack, int top, const char *cmp_type) return diff; } -int lttng_bytecode_interpret_error(struct lttng_ust_bytecode_runtime *bytecode_runtime, - const char *stack_data, - void *ctx) +int lttng_bytecode_interpret_error( + struct lttng_ust_bytecode_runtime *bytecode_runtime __attribute__((unused)), + const char *stack_data __attribute__((unused)), + void *ctx __attribute__((unused))) { return LTTNG_UST_BYTECODE_INTERPRETER_ERROR; } @@ -2511,7 +2513,7 @@ end: */ int lttng_ust_interpret_event_filter(struct lttng_ust_event_common *event, const char *interpreter_stack_data, - void *event_filter_ctx) + void *event_filter_ctx __attribute__((unused))) { struct lttng_ust_bytecode_runtime *filter_bc_runtime; struct cds_list_head *filter_bytecode_runtime_head = &event->priv->filter_bytecode_runtime_head; diff --git a/liblttng-ust/lttng-bytecode-validator.c b/liblttng-ust/lttng-bytecode-validator.c index 68b9e008..267c5c19 100644 --- a/liblttng-ust/lttng-bytecode-validator.c +++ b/liblttng-ust/lttng-bytecode-validator.c @@ -209,7 +209,8 @@ error_type: * (unknown), negative error value on error. */ static -int bin_op_bitwise_check(struct vstack *stack, bytecode_opcode_t opcode, +int bin_op_bitwise_check(struct vstack *stack, + bytecode_opcode_t opcode __attribute__((unused)), const char *str) { if (unlikely(!vstack_ax(stack) || !vstack_bx(stack))) @@ -553,7 +554,8 @@ unsigned long delete_all_nodes(struct lttng_ust_lfht *ht) * <0: error */ static -int validate_instruction_context(struct bytecode_runtime *bytecode, +int validate_instruction_context( + struct bytecode_runtime *bytecode __attribute__((unused)), struct vstack *stack, char *start_pc, char *pc) @@ -1254,7 +1256,7 @@ int validate_instruction_all_contexts(struct bytecode_runtime *bytecode, * <0: error */ static -int exec_insn(struct bytecode_runtime *bytecode, +int exec_insn(struct bytecode_runtime *bytecode __attribute__((unused)), struct lttng_ust_lfht *merge_points, struct vstack *stack, char **_next_pc, diff --git a/liblttng-ust/lttng-bytecode.c b/liblttng-ust/lttng-bytecode.c index 67fb1a06..387fc4b9 100644 --- a/liblttng-ust/lttng-bytecode.c +++ b/liblttng-ust/lttng-bytecode.c @@ -174,7 +174,7 @@ const char *lttng_bytecode_print_op(enum bytecode_op op) static int apply_field_reloc(const struct lttng_ust_event_desc *event_desc, struct bytecode_runtime *runtime, - uint32_t runtime_len, + uint32_t runtime_len __attribute__((unused)), uint32_t reloc_offset, const char *field_name, enum bytecode_op bytecode_op) @@ -282,7 +282,7 @@ int apply_field_reloc(const struct lttng_ust_event_desc *event_desc, static int apply_context_reloc(struct bytecode_runtime *runtime, - uint32_t runtime_len, + uint32_t runtime_len __attribute__((unused)), uint32_t reloc_offset, const char *context_name, enum bytecode_op bytecode_op) diff --git a/liblttng-ust/lttng-context-cgroup-ns.c b/liblttng-ust/lttng-context-cgroup-ns.c index d25a9b13..51991cc6 100644 --- a/liblttng-ust/lttng-context-cgroup-ns.c +++ b/liblttng-ust/lttng-context-cgroup-ns.c @@ -91,7 +91,8 @@ void lttng_context_cgroup_ns_reset(void) } static -size_t cgroup_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t cgroup_ns_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -101,7 +102,7 @@ size_t cgroup_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void cgroup_ns_record(struct lttng_ust_ctx_field *field, +void cgroup_ns_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -113,7 +114,7 @@ void cgroup_ns_record(struct lttng_ust_ctx_field *field, } static -void cgroup_ns_get_value(struct lttng_ust_ctx_field *field, +void cgroup_ns_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_cgroup_ns(); diff --git a/liblttng-ust/lttng-context-cpu-id.c b/liblttng-ust/lttng-context-cpu-id.c index b3c64974..9fa4c371 100644 --- a/liblttng-ust/lttng-context-cpu-id.c +++ b/liblttng-ust/lttng-context-cpu-id.c @@ -25,7 +25,8 @@ #include "context-internal.h" static -size_t cpu_id_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t cpu_id_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -35,7 +36,7 @@ size_t cpu_id_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void cpu_id_record(struct lttng_ust_ctx_field *field, +void cpu_id_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -46,7 +47,7 @@ void cpu_id_record(struct lttng_ust_ctx_field *field, } static -void cpu_id_get_value(struct lttng_ust_ctx_field *field, +void cpu_id_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = lttng_ust_get_cpu(); diff --git a/liblttng-ust/lttng-context-ip.c b/liblttng-ust/lttng-context-ip.c index 4f4ef632..bdf2f123 100644 --- a/liblttng-ust/lttng-context-ip.c +++ b/liblttng-ust/lttng-context-ip.c @@ -18,7 +18,8 @@ #include "context-internal.h" static -size_t ip_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t ip_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -28,7 +29,7 @@ size_t ip_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void ip_record(struct lttng_ust_ctx_field *field, +void ip_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { diff --git a/liblttng-ust/lttng-context-ipc-ns.c b/liblttng-ust/lttng-context-ipc-ns.c index a08b9a02..464887bb 100644 --- a/liblttng-ust/lttng-context-ipc-ns.c +++ b/liblttng-ust/lttng-context-ipc-ns.c @@ -90,7 +90,8 @@ void lttng_context_ipc_ns_reset(void) } static -size_t ipc_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t ipc_ns_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -100,7 +101,7 @@ size_t ipc_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void ipc_ns_record(struct lttng_ust_ctx_field *field, +void ipc_ns_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -111,7 +112,7 @@ void ipc_ns_record(struct lttng_ust_ctx_field *field, } static -void ipc_ns_get_value(struct lttng_ust_ctx_field *field, +void ipc_ns_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_ipc_ns(); diff --git a/liblttng-ust/lttng-context-mnt-ns.c b/liblttng-ust/lttng-context-mnt-ns.c index 8a2b7e86..8d4bdb1d 100644 --- a/liblttng-ust/lttng-context-mnt-ns.c +++ b/liblttng-ust/lttng-context-mnt-ns.c @@ -73,7 +73,8 @@ void lttng_context_mnt_ns_reset(void) } static -size_t mnt_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t mnt_ns_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -83,7 +84,7 @@ size_t mnt_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void mnt_ns_record(struct lttng_ust_ctx_field *field, +void mnt_ns_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -94,7 +95,7 @@ void mnt_ns_record(struct lttng_ust_ctx_field *field, } static -void mnt_ns_get_value(struct lttng_ust_ctx_field *field, +void mnt_ns_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_mnt_ns(); diff --git a/liblttng-ust/lttng-context-net-ns.c b/liblttng-ust/lttng-context-net-ns.c index 655759ac..004d3978 100644 --- a/liblttng-ust/lttng-context-net-ns.c +++ b/liblttng-ust/lttng-context-net-ns.c @@ -90,7 +90,8 @@ void lttng_context_net_ns_reset(void) } static -size_t net_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t net_ns_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -100,7 +101,7 @@ size_t net_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void net_ns_record(struct lttng_ust_ctx_field *field, +void net_ns_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -111,7 +112,7 @@ void net_ns_record(struct lttng_ust_ctx_field *field, } static -void net_ns_get_value(struct lttng_ust_ctx_field *field, +void net_ns_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_net_ns(); diff --git a/liblttng-ust/lttng-context-perf-counters.c b/liblttng-ust/lttng-context-perf-counters.c index 94f4e95d..dac953ff 100644 --- a/liblttng-ust/lttng-context-perf-counters.c +++ b/liblttng-ust/lttng-context-perf-counters.c @@ -158,7 +158,8 @@ void lttng_perf_unlock(void) } static -size_t perf_counter_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t perf_counter_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; diff --git a/liblttng-ust/lttng-context-pid-ns.c b/liblttng-ust/lttng-context-pid-ns.c index 21dae9a8..10b0c1b2 100644 --- a/liblttng-ust/lttng-context-pid-ns.c +++ b/liblttng-ust/lttng-context-pid-ns.c @@ -76,7 +76,8 @@ void lttng_context_pid_ns_reset(void) } static -size_t pid_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t pid_ns_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -86,7 +87,7 @@ size_t pid_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void pid_ns_record(struct lttng_ust_ctx_field *field, +void pid_ns_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -97,7 +98,7 @@ void pid_ns_record(struct lttng_ust_ctx_field *field, } static -void pid_ns_get_value(struct lttng_ust_ctx_field *field, +void pid_ns_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_pid_ns(); diff --git a/liblttng-ust/lttng-context-procname.c b/liblttng-ust/lttng-context-procname.c index 53c42d9e..0edde6e8 100644 --- a/liblttng-ust/lttng-context-procname.c +++ b/liblttng-ust/lttng-context-procname.c @@ -66,13 +66,14 @@ void lttng_ust_context_procname_reset(void) } static -size_t procname_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t procname_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset __attribute__((unused))) { return LTTNG_UST_ABI_PROCNAME_LEN; } static -void procname_record(struct lttng_ust_ctx_field *field, +void procname_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -83,7 +84,7 @@ void procname_record(struct lttng_ust_ctx_field *field, } static -void procname_get_value(struct lttng_ust_ctx_field *field, +void procname_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.str = wrapper_getprocname(); diff --git a/liblttng-ust/lttng-context-pthread-id.c b/liblttng-ust/lttng-context-pthread-id.c index b6aa5470..a032b26a 100644 --- a/liblttng-ust/lttng-context-pthread-id.c +++ b/liblttng-ust/lttng-context-pthread-id.c @@ -17,7 +17,8 @@ #include "context-internal.h" static -size_t pthread_id_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t pthread_id_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -27,7 +28,7 @@ size_t pthread_id_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void pthread_id_record(struct lttng_ust_ctx_field *field, +void pthread_id_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -38,7 +39,7 @@ void pthread_id_record(struct lttng_ust_ctx_field *field, } static -void pthread_id_get_value(struct lttng_ust_ctx_field *field, +void pthread_id_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = (unsigned long) pthread_self(); diff --git a/liblttng-ust/lttng-context-time-ns.c b/liblttng-ust/lttng-context-time-ns.c index b9d07d08..a8a30df8 100644 --- a/liblttng-ust/lttng-context-time-ns.c +++ b/liblttng-ust/lttng-context-time-ns.c @@ -89,7 +89,8 @@ void lttng_context_time_ns_reset(void) } static -size_t time_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t time_ns_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -99,7 +100,7 @@ size_t time_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void time_ns_record(struct lttng_ust_ctx_field *field, +void time_ns_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -110,7 +111,7 @@ void time_ns_record(struct lttng_ust_ctx_field *field, } static -void time_ns_get_value(struct lttng_ust_ctx_field *field, +void time_ns_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_time_ns(); diff --git a/liblttng-ust/lttng-context-user-ns.c b/liblttng-ust/lttng-context-user-ns.c index f42ac079..53303d0f 100644 --- a/liblttng-ust/lttng-context-user-ns.c +++ b/liblttng-ust/lttng-context-user-ns.c @@ -73,7 +73,8 @@ void lttng_context_user_ns_reset(void) } static -size_t user_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t user_ns_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -83,7 +84,7 @@ size_t user_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void user_ns_record(struct lttng_ust_ctx_field *field, +void user_ns_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -94,7 +95,7 @@ void user_ns_record(struct lttng_ust_ctx_field *field, } static -void user_ns_get_value(struct lttng_ust_ctx_field *field, +void user_ns_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_user_ns(); diff --git a/liblttng-ust/lttng-context-uts-ns.c b/liblttng-ust/lttng-context-uts-ns.c index f8b0bd8c..5ac0205f 100644 --- a/liblttng-ust/lttng-context-uts-ns.c +++ b/liblttng-ust/lttng-context-uts-ns.c @@ -91,7 +91,8 @@ void lttng_context_uts_ns_reset(void) } static -size_t uts_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t uts_ns_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -101,7 +102,7 @@ size_t uts_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void uts_ns_record(struct lttng_ust_ctx_field *field, +void uts_ns_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -112,7 +113,7 @@ void uts_ns_record(struct lttng_ust_ctx_field *field, } static -void uts_ns_get_value(struct lttng_ust_ctx_field *field, +void uts_ns_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_uts_ns(); diff --git a/liblttng-ust/lttng-context-vegid.c b/liblttng-ust/lttng-context-vegid.c index a6306f3c..6b7d0698 100644 --- a/liblttng-ust/lttng-context-vegid.c +++ b/liblttng-ust/lttng-context-vegid.c @@ -62,7 +62,8 @@ void lttng_context_vegid_reset(void) } static -size_t vegid_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t vegid_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -72,7 +73,7 @@ size_t vegid_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void vegid_record(struct lttng_ust_ctx_field *field, +void vegid_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -83,7 +84,7 @@ void vegid_record(struct lttng_ust_ctx_field *field, } static -void vegid_get_value(struct lttng_ust_ctx_field *field, +void vegid_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_vegid(); diff --git a/liblttng-ust/lttng-context-veuid.c b/liblttng-ust/lttng-context-veuid.c index d5ef5199..506422e9 100644 --- a/liblttng-ust/lttng-context-veuid.c +++ b/liblttng-ust/lttng-context-veuid.c @@ -62,7 +62,8 @@ void lttng_context_veuid_reset(void) } static -size_t veuid_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t veuid_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -72,7 +73,7 @@ size_t veuid_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void veuid_record(struct lttng_ust_ctx_field *field, +void veuid_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -83,7 +84,7 @@ void veuid_record(struct lttng_ust_ctx_field *field, } static -void veuid_get_value(struct lttng_ust_ctx_field *field, +void veuid_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_veuid(); diff --git a/liblttng-ust/lttng-context-vgid.c b/liblttng-ust/lttng-context-vgid.c index 78316139..17026112 100644 --- a/liblttng-ust/lttng-context-vgid.c +++ b/liblttng-ust/lttng-context-vgid.c @@ -62,7 +62,8 @@ void lttng_context_vgid_reset(void) } static -size_t vgid_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t vgid_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -72,7 +73,7 @@ size_t vgid_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void vgid_record(struct lttng_ust_ctx_field *field, +void vgid_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -83,7 +84,7 @@ void vgid_record(struct lttng_ust_ctx_field *field, } static -void vgid_get_value(struct lttng_ust_ctx_field *field, +void vgid_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_vgid(); diff --git a/liblttng-ust/lttng-context-vpid.c b/liblttng-ust/lttng-context-vpid.c index 43685960..9f20d8cb 100644 --- a/liblttng-ust/lttng-context-vpid.c +++ b/liblttng-ust/lttng-context-vpid.c @@ -46,7 +46,8 @@ void lttng_context_vpid_reset(void) } static -size_t vpid_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t vpid_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -56,7 +57,7 @@ size_t vpid_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void vpid_record(struct lttng_ust_ctx_field *field, +void vpid_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -66,7 +67,7 @@ void vpid_record(struct lttng_ust_ctx_field *field, } static -void vpid_get_value(struct lttng_ust_ctx_field *field, +void vpid_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = wrapper_getvpid(); diff --git a/liblttng-ust/lttng-context-vsgid.c b/liblttng-ust/lttng-context-vsgid.c index d2ac2a70..387e931b 100644 --- a/liblttng-ust/lttng-context-vsgid.c +++ b/liblttng-ust/lttng-context-vsgid.c @@ -66,7 +66,8 @@ void lttng_context_vsgid_reset(void) } static -size_t vsgid_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t vsgid_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -76,7 +77,7 @@ size_t vsgid_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void vsgid_record(struct lttng_ust_ctx_field *field, +void vsgid_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -87,7 +88,7 @@ void vsgid_record(struct lttng_ust_ctx_field *field, } static -void vsgid_get_value(struct lttng_ust_ctx_field *field, +void vsgid_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_vsgid(); diff --git a/liblttng-ust/lttng-context-vsuid.c b/liblttng-ust/lttng-context-vsuid.c index ff58a741..f1fe8e21 100644 --- a/liblttng-ust/lttng-context-vsuid.c +++ b/liblttng-ust/lttng-context-vsuid.c @@ -66,7 +66,8 @@ void lttng_context_vsuid_reset(void) } static -size_t vsuid_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t vsuid_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -76,7 +77,7 @@ size_t vsuid_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void vsuid_record(struct lttng_ust_ctx_field *field, +void vsuid_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -87,7 +88,7 @@ void vsuid_record(struct lttng_ust_ctx_field *field, } static -void vsuid_get_value(struct lttng_ust_ctx_field *field, +void vsuid_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_vsuid(); diff --git a/liblttng-ust/lttng-context-vtid.c b/liblttng-ust/lttng-context-vtid.c index 297d8025..a7e7679b 100644 --- a/liblttng-ust/lttng-context-vtid.c +++ b/liblttng-ust/lttng-context-vtid.c @@ -37,7 +37,8 @@ void lttng_context_vtid_reset(void) } static -size_t vtid_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t vtid_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -60,7 +61,7 @@ pid_t wrapper_getvtid(void) } static -void vtid_record(struct lttng_ust_ctx_field *field, +void vtid_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -70,7 +71,7 @@ void vtid_record(struct lttng_ust_ctx_field *field, } static -void vtid_get_value(struct lttng_ust_ctx_field *field, +void vtid_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = wrapper_getvtid(); diff --git a/liblttng-ust/lttng-context-vuid.c b/liblttng-ust/lttng-context-vuid.c index 0e05fc4f..d945e309 100644 --- a/liblttng-ust/lttng-context-vuid.c +++ b/liblttng-ust/lttng-context-vuid.c @@ -62,7 +62,8 @@ void lttng_context_vuid_reset(void) } static -size_t vuid_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t vuid_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -72,7 +73,7 @@ size_t vuid_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void vuid_record(struct lttng_ust_ctx_field *field, +void vuid_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -83,7 +84,7 @@ void vuid_record(struct lttng_ust_ctx_field *field, } static -void vuid_get_value(struct lttng_ust_ctx_field *field, +void vuid_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->u.s64 = get_vuid(); diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index d411dcf1..16fb9f44 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -1654,8 +1654,9 @@ int lttng_attach_context(struct lttng_ust_abi_context *context_param, } } -int lttng_event_enabler_attach_context(struct lttng_event_enabler *enabler, - struct lttng_ust_abi_context *context_param) +int lttng_event_enabler_attach_context( + struct lttng_event_enabler *enabler __attribute__((unused)), + struct lttng_ust_abi_context *context_param __attribute__((unused))) { return -ENOSYS; } diff --git a/liblttng-ust/lttng-ring-buffer-client-template.h b/liblttng-ust/lttng-ring-buffer-client-template.h index dfc98cee..d4f25fcc 100644 --- a/liblttng-ust/lttng-ring-buffer-client-template.h +++ b/liblttng-ust/lttng-ring-buffer-client-template.h @@ -83,7 +83,8 @@ void RING_BUFFER_MODE_TEMPLATE_TLS_FIXUP(void) asm volatile ("" : : "m" (URCU_TLS(private_ctx_stack))); } -static inline uint64_t lib_ring_buffer_clock_read(struct lttng_ust_lib_ring_buffer_channel *chan) +static inline uint64_t lib_ring_buffer_clock_read( + struct lttng_ust_lib_ring_buffer_channel *chan __attribute__((unused))) { return trace_clock_read64(); } @@ -184,12 +185,13 @@ void ctx_record(struct lttng_ust_lib_ring_buffer_ctx *bufctx, * contains. */ static __inline__ -size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer_channel *chan, - size_t offset, - size_t *pre_header_padding, - struct lttng_ust_lib_ring_buffer_ctx *ctx, - struct lttng_client_ctx *client_ctx) +size_t record_header_size( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_channel *chan, + size_t offset, + size_t *pre_header_padding, + struct lttng_ust_lib_ring_buffer_ctx *ctx, + struct lttng_client_ctx *client_ctx) { struct lttng_ust_channel_buffer *lttng_chan = channel_get_private(chan); size_t orig_offset = offset; @@ -467,25 +469,35 @@ static void client_buffer_end(struct lttng_ust_lib_ring_buffer *buf, uint64_t ts header->ctx.events_discarded = records_lost; } -static int client_buffer_create(struct lttng_ust_lib_ring_buffer *buf, void *priv, - int cpu, const char *name, struct lttng_ust_shm_handle *handle) +static int client_buffer_create( + struct lttng_ust_lib_ring_buffer *buf __attribute__((unused)), + void *priv __attribute__((unused)), + int cpu __attribute__((unused)), + const char *name __attribute__((unused)), + struct lttng_ust_shm_handle *handle __attribute__((unused))) { return 0; } -static void client_buffer_finalize(struct lttng_ust_lib_ring_buffer *buf, void *priv, int cpu, struct lttng_ust_shm_handle *handle) +static void client_buffer_finalize( + struct lttng_ust_lib_ring_buffer *buf __attribute__((unused)), + void *priv __attribute__((unused)), + int cpu __attribute__((unused)), + struct lttng_ust_shm_handle *handle __attribute__((unused))) { } -static void client_content_size_field(const struct lttng_ust_lib_ring_buffer_config *config, - size_t *offset, size_t *length) +static void client_content_size_field( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + size_t *offset, size_t *length) { *offset = offsetof(struct packet_header, ctx.content_size); *length = sizeof(((struct packet_header *) NULL)->ctx.content_size); } -static void client_packet_size_field(const struct lttng_ust_lib_ring_buffer_config *config, - size_t *offset, size_t *length) +static void client_packet_size_field( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + size_t *offset, size_t *length) { *offset = offsetof(struct packet_header, ctx.packet_size); *length = sizeof(((struct packet_header *) NULL)->ctx.packet_size); @@ -567,7 +579,7 @@ static int client_packet_size(struct lttng_ust_lib_ring_buffer *buf, return 0; } -static int client_stream_id(struct lttng_ust_lib_ring_buffer *buf, +static int client_stream_id(struct lttng_ust_lib_ring_buffer *buf __attribute__((unused)), struct lttng_ust_lib_ring_buffer_channel *chan, uint64_t *stream_id) { @@ -578,7 +590,8 @@ static int client_stream_id(struct lttng_ust_lib_ring_buffer *buf, return 0; } -static int client_current_timestamp(struct lttng_ust_lib_ring_buffer *buf, +static int client_current_timestamp( + struct lttng_ust_lib_ring_buffer *buf __attribute__((unused)), struct lttng_ust_lib_ring_buffer_channel *chan, uint64_t *ts) { @@ -602,7 +615,7 @@ static int client_sequence_number(struct lttng_ust_lib_ring_buffer *buf, } static int client_instance_id(struct lttng_ust_lib_ring_buffer *buf, - struct lttng_ust_lib_ring_buffer_channel *chan, + struct lttng_ust_lib_ring_buffer_channel *chan __attribute__((unused)), uint64_t *id) { *id = buf->backend.cpu; diff --git a/liblttng-ust/lttng-ring-buffer-metadata-client-template.h b/liblttng-ust/lttng-ring-buffer-metadata-client-template.h index f4d1362a..fe080dca 100644 --- a/liblttng-ust/lttng-ring-buffer-metadata-client-template.h +++ b/liblttng-ust/lttng-ring-buffer-metadata-client-template.h @@ -40,18 +40,20 @@ static const struct lttng_ust_lib_ring_buffer_config client_config; /* No nested use supported for metadata ring buffer. */ static DEFINE_URCU_TLS(struct lttng_ust_lib_ring_buffer_ctx_private, private_ctx); -static inline uint64_t lib_ring_buffer_clock_read(struct lttng_ust_lib_ring_buffer_channel *chan) +static inline uint64_t lib_ring_buffer_clock_read( + struct lttng_ust_lib_ring_buffer_channel *chan __attribute__((unused))) { return 0; } static inline -size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer_channel *chan, - size_t offset, - size_t *pre_header_padding, - struct lttng_ust_lib_ring_buffer_ctx *ctx, - void *client_ctx) +size_t record_header_size( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_channel *chan __attribute__((unused)), + size_t offset __attribute__((unused)), + size_t *pre_header_padding __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_ctx *ctx __attribute__((unused)), + void *client_ctx __attribute__((unused))) { return 0; } @@ -59,18 +61,20 @@ size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config, #include "../libringbuffer/api.h" #include "lttng-rb-clients.h" -static uint64_t client_ring_buffer_clock_read(struct lttng_ust_lib_ring_buffer_channel *chan) +static uint64_t client_ring_buffer_clock_read( + struct lttng_ust_lib_ring_buffer_channel *chan __attribute__((unused))) { return 0; } static -size_t client_record_header_size(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer_channel *chan, - size_t offset, - size_t *pre_header_padding, - struct lttng_ust_lib_ring_buffer_ctx *ctx, - void *client_ctx) +size_t client_record_header_size( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_channel *chan __attribute__((unused)), + size_t offset __attribute__((unused)), + size_t *pre_header_padding __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_ctx *ctx __attribute__((unused)), + void *client_ctx __attribute__((unused))) { return 0; } @@ -87,9 +91,10 @@ static size_t client_packet_header_size(void) return offsetof(struct metadata_packet_header, header_end); } -static void client_buffer_begin(struct lttng_ust_lib_ring_buffer *buf, uint64_t tsc, - unsigned int subbuf_idx, - struct lttng_ust_shm_handle *handle) +static void client_buffer_begin(struct lttng_ust_lib_ring_buffer *buf, + uint64_t tsc __attribute__((unused)), + unsigned int subbuf_idx, + struct lttng_ust_shm_handle *handle) { struct lttng_ust_lib_ring_buffer_channel *chan = shmp(handle, buf->backend.chan); struct metadata_packet_header *header = @@ -118,9 +123,10 @@ static void client_buffer_begin(struct lttng_ust_lib_ring_buffer *buf, uint64_t * offset is assumed to never be 0 here : never deliver a completely empty * subbuffer. data_size is between 1 and subbuf_size. */ -static void client_buffer_end(struct lttng_ust_lib_ring_buffer *buf, uint64_t tsc, - unsigned int subbuf_idx, unsigned long data_size, - struct lttng_ust_shm_handle *handle) +static void client_buffer_end(struct lttng_ust_lib_ring_buffer *buf, + uint64_t tsc __attribute__((unused)), + unsigned int subbuf_idx, unsigned long data_size, + struct lttng_ust_shm_handle *handle) { struct lttng_ust_lib_ring_buffer_channel *chan = shmp(handle, buf->backend.chan); struct metadata_packet_header *header = @@ -145,16 +151,21 @@ static void client_buffer_end(struct lttng_ust_lib_ring_buffer *buf, uint64_t ts WARN_ON_ONCE(records_lost != 0); } -static int client_buffer_create(struct lttng_ust_lib_ring_buffer *buf, void *priv, - int cpu, const char *name, - struct lttng_ust_shm_handle *handle) +static int client_buffer_create( + struct lttng_ust_lib_ring_buffer *buf __attribute__((unused)), + void *priv __attribute__((unused)), + int cpu __attribute__((unused)), + const char *name __attribute__((unused)), + struct lttng_ust_shm_handle *handle __attribute__((unused))) { return 0; } -static void client_buffer_finalize(struct lttng_ust_lib_ring_buffer *buf, - void *priv, int cpu, - struct lttng_ust_shm_handle *handle) +static void client_buffer_finalize( + struct lttng_ust_lib_ring_buffer *buf __attribute__((unused)), + void *priv __attribute__((unused)), + int cpu __attribute__((unused)), + struct lttng_ust_shm_handle *handle __attribute__((unused))) { } diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index b3997225..61105ace 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -323,7 +323,7 @@ objd_error: } static -long lttng_abi_tracer_version(int objd, +long lttng_abi_tracer_version(int objd __attribute__((unused)), struct lttng_ust_abi_tracer_version *v) { v->major = LTTNG_UST_MAJOR_VERSION; @@ -377,7 +377,7 @@ fd_error: } static -long lttng_abi_add_context(int objd, +long lttng_abi_add_context(int objd __attribute__((unused)), struct lttng_ust_abi_context *context_param, union lttng_ust_abi_args *uargs, struct lttng_ust_ctx **ctx, struct lttng_ust_session *session) @@ -714,7 +714,8 @@ objd_error: static long lttng_event_notifier_enabler_cmd(int objd, unsigned int cmd, unsigned long arg, - union lttng_ust_abi_args *uargs, void *owner) + union lttng_ust_abi_args *uargs __attribute__((unused)), + void *owner __attribute__((unused))) { struct lttng_event_notifier_enabler *event_notifier_enabler = objd_private(objd); switch (cmd) { @@ -755,7 +756,7 @@ long lttng_event_notifier_enabler_cmd(int objd, unsigned int cmd, unsigned long */ static long lttng_event_notifier_group_error_counter_cmd(int objd, unsigned int cmd, unsigned long arg, - union lttng_ust_abi_args *uargs, void *owner) + union lttng_ust_abi_args *uargs, void *owner __attribute__((unused))) { int ret; struct lttng_counter *counter = objd_private(objd); @@ -956,7 +957,8 @@ static const struct lttng_ust_abi_objd_ops lttng_event_notifier_group_ops = { static long lttng_tracepoint_list_cmd(int objd, unsigned int cmd, unsigned long arg, - union lttng_ust_abi_args *uargs, void *owner) + union lttng_ust_abi_args *uargs __attribute__((unused)), + void *owner __attribute__((unused))) { struct lttng_ust_tracepoint_list *list = objd_private(objd); struct lttng_ust_abi_tracepoint_iter *tp = @@ -1036,7 +1038,8 @@ static const struct lttng_ust_abi_objd_ops lttng_tracepoint_list_ops = { static long lttng_tracepoint_field_list_cmd(int objd, unsigned int cmd, - unsigned long arg, union lttng_ust_abi_args *uargs, void *owner) + unsigned long arg __attribute__((unused)), union lttng_ust_abi_args *uargs, + void *owner __attribute__((unused))) { struct lttng_ust_field_list *list = objd_private(objd); struct lttng_ust_abi_field_iter *tp = &uargs->field_list.entry; @@ -1116,7 +1119,7 @@ static const struct lttng_ust_abi_objd_ops lttng_tracepoint_field_list_ops = { static int lttng_abi_map_stream(int channel_objd, struct lttng_ust_abi_stream *info, - union lttng_ust_abi_args *uargs, void *owner) + union lttng_ust_abi_args *uargs, void *owner __attribute__((unused))) { struct lttng_ust_channel_buffer *lttng_chan_buf = objd_private(channel_objd); int ret; @@ -1297,7 +1300,8 @@ static const struct lttng_ust_abi_objd_ops lttng_channel_ops = { */ static long lttng_event_enabler_cmd(int objd, unsigned int cmd, unsigned long arg, - union lttng_ust_abi_args *uargs, void *owner) + union lttng_ust_abi_args *uargs __attribute__((unused)), + void *owner __attribute__((unused))) { struct lttng_event_enabler *enabler = objd_private(objd); diff --git a/liblttng-ust/lttng-ust-statedump.c b/liblttng-ust/lttng-ust-statedump.c index 98b80b35..eaee338a 100644 --- a/liblttng-ust/lttng-ust-statedump.c +++ b/liblttng-ust/lttng-ust-statedump.c @@ -243,13 +243,13 @@ void procname_cb(struct lttng_ust_session *session, void *priv) } static -void trace_start_cb(struct lttng_ust_session *session, void *priv) +void trace_start_cb(struct lttng_ust_session *session, void *priv __attribute__((unused))) { tracepoint(lttng_ust_statedump, start, session); } static -void trace_end_cb(struct lttng_ust_session *session, void *priv) +void trace_end_cb(struct lttng_ust_session *session, void *priv __attribute__((unused))) { tracepoint(lttng_ust_statedump, end, session); } @@ -444,7 +444,7 @@ end: } static -int extract_bin_info_events(struct dl_phdr_info *info, size_t size, void *_data) +int extract_bin_info_events(struct dl_phdr_info *info, size_t size __attribute__((unused)), void *_data) { int j, ret = 0; struct dl_iterate_data *data = _data; diff --git a/liblttng-ust/rculfhash.c b/liblttng-ust/rculfhash.c index efdb5e70..de90d710 100644 --- a/liblttng-ust/rculfhash.c +++ b/liblttng-ust/rculfhash.c @@ -334,7 +334,8 @@ void lttng_ust_lfht_iter_debug_set_ht(struct lttng_ust_lfht *ht, struct lttng_us #else static -void lttng_ust_lfht_iter_debug_set_ht(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_iter *iter) +void lttng_ust_lfht_iter_debug_set_ht(struct lttng_ust_lfht *ht __attribute__((unused)), + struct lttng_ust_lfht_iter *iter __attribute__((unused))) { } @@ -1105,7 +1106,8 @@ void lttng_ust_lfht_lookup(struct lttng_ust_lfht *ht, unsigned long hash, iter->next = next; } -void lttng_ust_lfht_next_duplicate(struct lttng_ust_lfht *ht, lttng_ust_lfht_match_fct match, +void lttng_ust_lfht_next_duplicate(struct lttng_ust_lfht *ht __attribute__((unused)), + lttng_ust_lfht_match_fct match, const void *key, struct lttng_ust_lfht_iter *iter) { struct lttng_ust_lfht_node *node, *next; @@ -1139,7 +1141,8 @@ void lttng_ust_lfht_next_duplicate(struct lttng_ust_lfht *ht, lttng_ust_lfht_mat iter->next = next; } -void lttng_ust_lfht_next(struct lttng_ust_lfht *ht, struct lttng_ust_lfht_iter *iter) +void lttng_ust_lfht_next(struct lttng_ust_lfht *ht __attribute__((unused)), + struct lttng_ust_lfht_iter *iter) { struct lttng_ust_lfht_node *node, *next; diff --git a/liblttng-ust/rculfhash.h b/liblttng-ust/rculfhash.h index 6ac20409..9f5016a0 100644 --- a/liblttng-ust/rculfhash.h +++ b/liblttng-ust/rculfhash.h @@ -75,7 +75,7 @@ typedef int (*lttng_ust_lfht_match_fct)(struct lttng_ust_lfht_node *node, const * (detection of memory corruption). */ static inline -void lttng_ust_lfht_node_init(struct lttng_ust_lfht_node *node) +void lttng_ust_lfht_node_init(struct lttng_ust_lfht_node *node __attribute__((unused))) { } diff --git a/liblttng-ust/ust-core.c b/liblttng-ust/ust-core.c index 61293d13..6569c6f4 100644 --- a/liblttng-ust/ust-core.c +++ b/liblttng-ust/ust-core.c @@ -108,7 +108,8 @@ struct lttng_enum *lttng_ust_enum_get_from_desc(struct lttng_ust_session *sessio return NULL; } -size_t lttng_ust_dummy_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t lttng_ust_dummy_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), + size_t offset) { size_t size = 0; @@ -117,7 +118,7 @@ size_t lttng_ust_dummy_get_size(struct lttng_ust_ctx_field *field, size_t offset return size; } -void lttng_ust_dummy_record(struct lttng_ust_ctx_field *field, +void lttng_ust_dummy_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *chan) { @@ -126,7 +127,7 @@ void lttng_ust_dummy_record(struct lttng_ust_ctx_field *field, chan->ops->event_write(ctx, &sel_char, sizeof(sel_char), lttng_ust_rb_alignof(sel_char)); } -void lttng_ust_dummy_get_value(struct lttng_ust_ctx_field *field, +void lttng_ust_dummy_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { value->sel = LTTNG_UST_DYNAMIC_TYPE_NONE; diff --git a/libringbuffer/backend.h b/libringbuffer/backend.h index 6b18e4cf..0b482182 100644 --- a/libringbuffer/backend.h +++ b/libringbuffer/backend.h @@ -109,7 +109,8 @@ size_t lib_ring_buffer_do_strcpy(const struct lttng_ust_lib_ring_buffer_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, +size_t lib_ring_buffer_do_strcpy( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), char *dest, const char *src, size_t len) { size_t count; diff --git a/libringbuffer/backend_internal.h b/libringbuffer/backend_internal.h index 67c6e901..a325875c 100644 --- a/libringbuffer/backend_internal.h +++ b/libringbuffer/backend_internal.h @@ -122,8 +122,9 @@ unsigned long subbuffer_id(const struct lttng_ust_lib_ring_buffer_config *config * bits are identical, else 0. */ static inline -int subbuffer_id_compare_offset(const struct lttng_ust_lib_ring_buffer_config *config, - unsigned long id, unsigned long offset) +int subbuffer_id_compare_offset( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + unsigned long id, unsigned long offset) { return (id & SB_ID_OFFSET_MASK) == (offset << SB_ID_OFFSET_SHIFT); } @@ -241,7 +242,8 @@ int lib_ring_buffer_backend_get_pages(const struct lttng_ust_lib_ring_buffer_con /* Get backend pages from cache. */ static inline struct lttng_ust_lib_ring_buffer_backend_pages * - lib_ring_buffer_get_backend_pages_from_ctx(const struct lttng_ust_lib_ring_buffer_config *config, + lib_ring_buffer_get_backend_pages_from_ctx( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx) { return ctx->priv->backend_pages; @@ -269,10 +271,11 @@ void subbuffer_count_record(const struct lttng_ust_lib_ring_buffer_config *confi } #else /* LTTNG_RING_BUFFER_COUNT_EVENTS */ static inline -void subbuffer_count_record(const struct lttng_ust_lib_ring_buffer_config *config, - const struct lttng_ust_lib_ring_buffer_ctx *ctx, - struct lttng_ust_lib_ring_buffer_backend *bufb, - unsigned long idx, struct lttng_ust_shm_handle *handle) +void subbuffer_count_record(const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + const struct lttng_ust_lib_ring_buffer_ctx *ctx __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_backend *bufb __attribute__((unused)), + unsigned long idx __attribute__((unused)), + struct lttng_ust_shm_handle *handle __attribute__((unused))) { } #endif /* #else LTTNG_RING_BUFFER_COUNT_EVENTS */ @@ -440,7 +443,8 @@ unsigned long subbuffer_get_data_size( } static inline -void subbuffer_inc_packet_count(const struct lttng_ust_lib_ring_buffer_config *config, +void subbuffer_inc_packet_count( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), struct lttng_ust_lib_ring_buffer_backend *bufb, unsigned long idx, struct lttng_ust_shm_handle *handle) { @@ -544,7 +548,7 @@ void lib_ring_buffer_set_noref_offset(const struct lttng_ust_lib_ring_buffer_con static inline int update_read_sb_index(const struct lttng_ust_lib_ring_buffer_config *config, struct lttng_ust_lib_ring_buffer_backend *bufb, - struct channel_backend *chanb, + struct channel_backend *chanb __attribute__((unused)), unsigned long consumed_idx, unsigned long consumed_count, struct lttng_ust_shm_handle *handle) diff --git a/libringbuffer/frontend.h b/libringbuffer/frontend.h index ed255c74..12e21005 100644 --- a/libringbuffer/frontend.h +++ b/libringbuffer/frontend.h @@ -201,8 +201,9 @@ unsigned long lib_ring_buffer_get_offset(const struct lttng_ust_lib_ring_buffer_ } static inline -unsigned long lib_ring_buffer_get_consumed(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf) +unsigned long lib_ring_buffer_get_consumed( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer *buf) { return uatomic_read(&buf->consumed); } @@ -212,8 +213,9 @@ unsigned long lib_ring_buffer_get_consumed(const struct lttng_ust_lib_ring_buffe * ordering enforced with respect to trace teardown). */ static inline -int lib_ring_buffer_is_finalized(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf) +int lib_ring_buffer_is_finalized( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer *buf) { int finalized = CMM_ACCESS_ONCE(buf->finalized); /* diff --git a/libringbuffer/frontend_api.h b/libringbuffer/frontend_api.h index be077e51..ac5e31bf 100644 --- a/libringbuffer/frontend_api.h +++ b/libringbuffer/frontend_api.h @@ -32,7 +32,8 @@ * section. */ static inline -int lib_ring_buffer_nesting_inc(const struct lttng_ust_lib_ring_buffer_config *config) +int lib_ring_buffer_nesting_inc( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused))) { int nesting; @@ -47,13 +48,15 @@ int lib_ring_buffer_nesting_inc(const struct lttng_ust_lib_ring_buffer_config *c } static inline -int lib_ring_buffer_nesting_count(const struct lttng_ust_lib_ring_buffer_config *config) +int lib_ring_buffer_nesting_count( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused))) { return URCU_TLS(lib_ring_buffer_nesting); } static inline -void lib_ring_buffer_nesting_dec(const struct lttng_ust_lib_ring_buffer_config *config) +void lib_ring_buffer_nesting_dec( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused))) { cmm_barrier(); URCU_TLS(lib_ring_buffer_nesting)--; /* TLS */ @@ -215,9 +218,10 @@ slow_path: * disabled, for RING_BUFFER_SYNC_PER_CPU configuration. */ static inline -void lib_ring_buffer_switch(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf, enum switch_mode mode, - struct lttng_ust_shm_handle *handle) +void lib_ring_buffer_switch( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer *buf, enum switch_mode mode, + struct lttng_ust_shm_handle *handle) { lib_ring_buffer_switch_slow(buf, mode, handle); } @@ -332,29 +336,33 @@ int lib_ring_buffer_try_discard_reserve(const struct lttng_ust_lib_ring_buffer_c } static inline -void channel_record_disable(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer_channel *chan) +void channel_record_disable( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_channel *chan) { uatomic_inc(&chan->record_disabled); } static inline -void channel_record_enable(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer_channel *chan) +void channel_record_enable( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_channel *chan) { uatomic_dec(&chan->record_disabled); } static inline -void lib_ring_buffer_record_disable(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf) +void lib_ring_buffer_record_disable( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer *buf) { uatomic_inc(&buf->record_disabled); } static inline -void lib_ring_buffer_record_enable(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf) +void lib_ring_buffer_record_enable( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer *buf) { uatomic_dec(&buf->record_disabled); } diff --git a/libringbuffer/frontend_internal.h b/libringbuffer/frontend_internal.h index fc0b0535..7d905d4b 100644 --- a/libringbuffer/frontend_internal.h +++ b/libringbuffer/frontend_internal.h @@ -322,13 +322,14 @@ void lib_ring_buffer_check_deliver(const struct lttng_ust_lib_ring_buffer_config * useful for crash dump. */ static inline -void lib_ring_buffer_write_commit_counter(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf, - struct lttng_ust_lib_ring_buffer_channel *chan, - unsigned long buf_offset, - unsigned long commit_count, - struct lttng_ust_shm_handle *handle, - struct commit_counters_hot *cc_hot) +void lib_ring_buffer_write_commit_counter( + const struct lttng_ust_lib_ring_buffer_config *config, + struct lttng_ust_lib_ring_buffer *buf __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_channel *chan, + unsigned long buf_offset, + unsigned long commit_count, + struct lttng_ust_shm_handle *handle __attribute__((unused)), + struct commit_counters_hot *cc_hot) { unsigned long commit_seq_old; diff --git a/libringbuffer/ring_buffer_backend.c b/libringbuffer/ring_buffer_backend.c index ac45446b..6ba0d8b1 100644 --- a/libringbuffer/ring_buffer_backend.c +++ b/libringbuffer/ring_buffer_backend.c @@ -33,7 +33,7 @@ static int lib_ring_buffer_backend_allocate(const struct lttng_ust_lib_ring_buffer_config *config, struct lttng_ust_lib_ring_buffer_backend *bufb, - size_t size, size_t num_subbuf, + size_t size __attribute__((unused)), size_t num_subbuf, int extra_reader_sb, struct lttng_ust_shm_handle *handle, struct shm_object *shmobj) @@ -395,8 +395,8 @@ end: * * Destroy all channel buffers and frees the channel. */ -void channel_backend_free(struct channel_backend *chanb, - struct lttng_ust_shm_handle *handle) +void channel_backend_free(struct channel_backend *chanb __attribute__((unused)), + struct lttng_ust_shm_handle *handle __attribute__((unused))) { /* SHM teardown takes care of everything */ } diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index 8112ced4..1b9ec40d 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -428,7 +428,8 @@ free_chanbuf: } static -void lib_ring_buffer_channel_switch_timer(int sig, siginfo_t *si, void *uc) +void lib_ring_buffer_channel_switch_timer(int sig __attribute__((unused)), + siginfo_t *si, void *uc __attribute__((unused))) { const struct lttng_ust_lib_ring_buffer_config *config; struct lttng_ust_shm_handle *handle; @@ -628,7 +629,8 @@ end: } static -void lib_ring_buffer_channel_read_timer(int sig, siginfo_t *si, void *uc) +void lib_ring_buffer_channel_read_timer(int sig __attribute__((unused)), + siginfo_t *si, void *uc __attribute__((unused))) { struct lttng_ust_lib_ring_buffer_channel *chan; @@ -663,7 +665,7 @@ void rb_setmask(sigset_t *mask) } static -void *sig_thread(void *arg) +void *sig_thread(void *arg __attribute__((unused))) { sigset_t mask; siginfo_t info; @@ -895,7 +897,7 @@ void lib_ring_buffer_channel_read_timer_stop(struct lttng_ust_lib_ring_buffer_ch } static void channel_unregister_notifiers(struct lttng_ust_lib_ring_buffer_channel *chan, - struct lttng_ust_shm_handle *handle) + struct lttng_ust_shm_handle *handle __attribute__((unused))) { lib_ring_buffer_channel_switch_timer_stop(chan); lib_ring_buffer_channel_read_timer_stop(chan); @@ -963,7 +965,7 @@ struct lttng_ust_shm_handle *channel_create(const struct lttng_ust_lib_ring_buff size_t priv_data_size, void *priv_data_init, void *priv, - void *buf_addr, size_t subbuf_size, + void *buf_addr __attribute__((unused)), size_t subbuf_size, size_t num_subbuf, unsigned int switch_timer_interval, unsigned int read_timer_interval, const int *stream_fds, int nr_stream_fds, @@ -1197,9 +1199,10 @@ struct lttng_ust_lib_ring_buffer *channel_get_ring_buffer( return shmp(handle, chan->backend.buf[cpu].shmp); } -int ring_buffer_channel_close_wait_fd(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer_channel *chan, - struct lttng_ust_shm_handle *handle) +int ring_buffer_channel_close_wait_fd( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_channel *chan __attribute__((unused)), + struct lttng_ust_shm_handle *handle) { struct shm_ref *ref; @@ -1207,9 +1210,10 @@ int ring_buffer_channel_close_wait_fd(const struct lttng_ust_lib_ring_buffer_con return shm_close_wait_fd(handle, ref); } -int ring_buffer_channel_close_wakeup_fd(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer_channel *chan, - struct lttng_ust_shm_handle *handle) +int ring_buffer_channel_close_wakeup_fd( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_channel *chan __attribute__((unused)), + struct lttng_ust_shm_handle *handle) { struct shm_ref *ref; @@ -1256,7 +1260,7 @@ int ring_buffer_stream_close_wakeup_fd(const struct lttng_ust_lib_ring_buffer_co } int lib_ring_buffer_open_read(struct lttng_ust_lib_ring_buffer *buf, - struct lttng_ust_shm_handle *handle) + struct lttng_ust_shm_handle *handle __attribute__((unused))) { if (uatomic_cmpxchg(&buf->active_readers, 0, 1) != 0) return -EBUSY; @@ -2423,10 +2427,11 @@ void deliver_count_events(const struct lttng_ust_lib_ring_buffer_config *config, } #else /* LTTNG_RING_BUFFER_COUNT_EVENTS */ static -void deliver_count_events(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf, - unsigned long idx, - struct lttng_ust_shm_handle *handle) +void deliver_count_events( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + struct lttng_ust_lib_ring_buffer *buf __attribute__((unused)), + unsigned long idx __attribute__((unused)), + struct lttng_ust_shm_handle *handle __attribute__((unused))) { } #endif /* #else LTTNG_RING_BUFFER_COUNT_EVENTS */ @@ -2438,7 +2443,7 @@ void lib_ring_buffer_check_deliver_slow(const struct lttng_ust_lib_ring_buffer_c unsigned long commit_count, unsigned long idx, struct lttng_ust_shm_handle *handle, - uint64_t tsc) + uint64_t tsc __attribute__((unused))) { unsigned long old_commit_count = commit_count - chan->backend.subbuf_size; diff --git a/libringbuffer/ringbuffer-config.h b/libringbuffer/ringbuffer-config.h index 37669b0d..2e10de03 100644 --- a/libringbuffer/ringbuffer-config.h +++ b/libringbuffer/ringbuffer-config.h @@ -226,10 +226,11 @@ int lib_ring_buffer_check_config(const struct lttng_ust_lib_ring_buffer_config * unsigned int switch_timer_interval, unsigned int read_timer_interval) lttng_ust_notrace; + static inline int lib_ring_buffer_check_config(const struct lttng_ust_lib_ring_buffer_config *config, unsigned int switch_timer_interval, - unsigned int read_timer_interval) + unsigned int read_timer_interval __attribute__((unused))) { if (config->alloc == RING_BUFFER_ALLOC_GLOBAL && config->sync == RING_BUFFER_SYNC_PER_CPU diff --git a/libringbuffer/vatomic.h b/libringbuffer/vatomic.h index 0f5cc03d..199d2c77 100644 --- a/libringbuffer/vatomic.h +++ b/libringbuffer/vatomic.h @@ -56,7 +56,7 @@ void v_inc(const struct lttng_ust_lib_ring_buffer_config *config, union v_atomic * Non-atomic decrement. Only used by reader, apply to reader-owned subbuffer. */ static inline -void _v_dec(const struct lttng_ust_lib_ring_buffer_config *config, union v_atomic *v_a) +void _v_dec(const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), union v_atomic *v_a) { --v_a->v; } diff --git a/tests/benchmark/bench.c b/tests/benchmark/bench.c index d42d0b65..a5afa769 100644 --- a/tests/benchmark/bench.c +++ b/tests/benchmark/bench.c @@ -54,7 +54,7 @@ void do_stuff(void) static -void *function(void *arg) +void *function(void *arg __attribute__((unused))) { unsigned long long nr_loops = 0; struct thread_counter *thread_counter = arg; diff --git a/tests/compile/hello.cxx/hello.cpp b/tests/compile/hello.cxx/hello.cpp index bd40323e..afbcf469 100644 --- a/tests/compile/hello.cxx/hello.cpp +++ b/tests/compile/hello.cxx/hello.cpp @@ -21,7 +21,7 @@ #include "ust_tests_hello.h" static -void inthandler(int sig) +void inthandler(int sig __attribute__((unused))) { printf("in SIGUSR1 handler\n"); tracepoint(ust_tests_hello, tptest_sighandler); diff --git a/tests/compile/hello/hello.c b/tests/compile/hello/hello.c index 9ef33099..87f2637b 100644 --- a/tests/compile/hello/hello.c +++ b/tests/compile/hello/hello.c @@ -27,7 +27,7 @@ struct mmsghdr; #include "ust_tests_hello.h" static -void inthandler(int sig) +void inthandler(int sig __attribute__((unused))) { printf("in SIGUSR1 handler\n"); tracepoint(ust_tests_hello, tptest_sighandler); diff --git a/tests/compile/test-app-ctx/hello.c b/tests/compile/test-app-ctx/hello.c index da347714..bff2bdb5 100644 --- a/tests/compile/test-app-ctx/hello.c +++ b/tests/compile/test-app-ctx/hello.c @@ -42,7 +42,7 @@ void test_inc_count(void) } static -size_t test_get_size(struct lttng_ust_ctx_field *field, size_t offset) +size_t test_get_size(struct lttng_ust_ctx_field *field __attribute__((unused)), size_t offset) { int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES; size_t size = 0; @@ -103,7 +103,7 @@ size_t test_get_size(struct lttng_ust_ctx_field *field, size_t offset) } static -void test_record(struct lttng_ust_ctx_field *field, +void test_record(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_channel_buffer *lttng_chan_buf) { @@ -196,7 +196,7 @@ void test_record(struct lttng_ust_ctx_field *field, } static -void test_get_value(struct lttng_ust_ctx_field *field, +void test_get_value(struct lttng_ust_ctx_field *field __attribute__((unused)), struct lttng_ust_ctx_value *value) { int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES; @@ -253,7 +253,7 @@ struct lttng_ust_context_provider myprovider = { }; static -void inthandler(int sig) +void inthandler(int sig __attribute__((unused))) { printf("in SIGUSR1 handler\n"); tracepoint(ust_tests_hello, tptest_sighandler); diff --git a/tests/unit/libmsgpack/test_msgpack.c b/tests/unit/libmsgpack/test_msgpack.c index ee226883..f7edf033 100644 --- a/tests/unit/libmsgpack/test_msgpack.c +++ b/tests/unit/libmsgpack/test_msgpack.c @@ -255,7 +255,7 @@ static void nil_test(uint8_t *buf) lttng_msgpack_writer_fini(&writer); } -int main(int argc, char *argv[]) +int main(void) { uint8_t buf[BUFFER_SIZE] = {0}; double arr_double[] = {1.1, 2.3, -12345.2}; -- 2.34.1