From c2706b9004265e92b5702ffcdccc30e45a2eb96c Mon Sep 17 00:00:00 2001 From: erlingrj Date: Thu, 7 Mar 2024 15:00:44 +0100 Subject: [PATCH] Format --- trace/impl/include/trace_impl.h | 2 +- trace/impl/src/trace_impl.c | 6 +++--- util/tracing/trace_util.h | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/trace/impl/include/trace_impl.h b/trace/impl/include/trace_impl.h index 2ac6d51f5..779a7be4a 100644 --- a/trace/impl/include/trace_impl.h +++ b/trace/impl/include/trace_impl.h @@ -23,7 +23,7 @@ typedef struct trace_t { * which will create a significant pause in the calling thread. */ trace_record_nodeps_t** _lf_trace_buffer; - size_t * _lf_trace_buffer_size; + size_t* _lf_trace_buffer_size; /** The number of trace buffers allocated when tracing starts. */ size_t _lf_number_of_trace_buffers; diff --git a/trace/impl/src/trace_impl.c b/trace/impl/src/trace_impl.c index c372e71fd..ea6c85182 100644 --- a/trace/impl/src/trace_impl.c +++ b/trace/impl/src/trace_impl.c @@ -137,7 +137,7 @@ static void start_trace(trace_t* trace, int max_num_local_threads) { trace->_lf_trace_buffer = (trace_record_nodeps_t**)malloc(sizeof(trace_record_nodeps_t*) * (trace->_lf_number_of_trace_buffers + 1)); trace->_lf_trace_buffer++; // the buffer at index -1 is a fallback for user threads. - for (int i = -1; i < (int) trace->_lf_number_of_trace_buffers; i++) { + for (int i = -1; i < (int)trace->_lf_number_of_trace_buffers; i++) { trace->_lf_trace_buffer[i] = (trace_record_nodeps_t*)malloc(sizeof(trace_record_nodeps_t) * TRACE_BUFFER_CAPACITY); } // Array of counters that track the size of each trace record (per thread). @@ -169,7 +169,7 @@ static void stop_trace_locked(trace_t* trace) { // Trace was already stopped. Nothing to do. return; } - for (int i = -1; i < (int) trace->_lf_number_of_trace_buffers; i++) { + for (int i = -1; i < (int)trace->_lf_number_of_trace_buffers; i++) { // Flush the buffer if it has data. LF_PRINT_DEBUG("Trace buffer %d has %zu records.", i, trace->_lf_trace_buffer_size[i]); if (trace->_lf_trace_buffer_size && trace->_lf_trace_buffer_size[i] > 0) { @@ -231,7 +231,7 @@ void lf_tracing_tracepoint(int worker, trace_record_nodeps_t* tr) { // Therefore we should fall back to using a mutex. lf_platform_mutex_lock(trace_mutex); } - if (((size_t) tid) > trace._lf_number_of_trace_buffers) { + if (((size_t)tid) > trace._lf_number_of_trace_buffers) { lf_print_error_and_exit("the thread id (%d) exceeds the number of trace buffers (%zu)", tid, trace._lf_number_of_trace_buffers); } diff --git a/util/tracing/trace_util.h b/util/tracing/trace_util.h index 2521cb2f3..089e57ee1 100644 --- a/util/tracing/trace_util.h +++ b/util/tracing/trace_util.h @@ -38,7 +38,6 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ extern const char* trace_event_names[]; - /** Macro to use when access to trace file fails. */ #define _LF_TRACE_FAILURE(trace_file) \ do { \