Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
erlingrj committed Mar 7, 2024
1 parent 0732cd8 commit c2706b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion trace/impl/include/trace_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions trace/impl/src/trace_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 0 additions & 1 deletion util/tracing/trace_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 { \
Expand Down

0 comments on commit c2706b9

Please sign in to comment.