diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index e4a9f1b6c..3000ee723 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -145,6 +145,7 @@ define(_LF_CLOCK_SYNC_EXCHANGES_PER_INTERVAL) define(_LF_CLOCK_SYNC_INITIAL) define(_LF_CLOCK_SYNC_ON) define(_LF_CLOCK_SYNC_PERIOD_NS) +define(_LF_FEDERATE_NAMES_COMMA_SEPARATED) define(ADVANCE_MESSAGE_INTERVAL) define(EXECUTABLE_PREAMBLE) define(FEDERATED_CENTRALIZED) diff --git a/core/federated/RTI/main.c b/core/federated/RTI/main.c index e57327c6c..4278dc86c 100644 --- a/core/federated/RTI/main.c +++ b/core/federated/RTI/main.c @@ -312,7 +312,7 @@ int main(int argc, const char* argv[]) { // sync thread. Add 1 for the thread that responds to erroneous // connections attempted after initialization phase has completed. Add 1 // for the main thread. - lf_tracing_global_init("rti", -1, _lf_number_of_workers * 2 + 3); + lf_tracing_global_init("rti", NULL, -1, _lf_number_of_workers * 2 + 3); lf_print("Tracing the RTI execution in %s file.", rti_trace_file_name); } diff --git a/core/reactor_common.c b/core/reactor_common.c index 17127532d..ea46b9f84 100644 --- a/core/reactor_common.c +++ b/core/reactor_common.c @@ -1215,9 +1215,9 @@ void initialize_global(void) { // -- threads are spawned to listen to upstream federates. Add 1 for the // clock sync thread and add 1 for the staa thread max_threads_tracing += NUMBER_OF_FEDERATES + 2; - lf_tracing_global_init(envs[0].name, FEDERATE_ID, max_threads_tracing); + lf_tracing_global_init(envs[0].name, _LF_FEDERATE_NAMES_COMMA_SEPARATED, FEDERATE_ID, max_threads_tracing); #else - lf_tracing_global_init("trace", 0, max_threads_tracing); + lf_tracing_global_init("main", NULL, 0, max_threads_tracing); #endif // Call the code-generated function to initialize all actions, timers, and ports // This is done for all environments/enclaves at the same time. diff --git a/include/core/tracepoint.h b/include/core/tracepoint.h index 779b3e98d..f6e369a1e 100644 --- a/include/core/tracepoint.h +++ b/include/core/tracepoint.h @@ -351,8 +351,9 @@ static inline void tracepoint_federate_from_federate(trace_event_t event_type, i (void)partner_id; (void)tag; } -static inline void lf_tracing_global_init(char* file_name_prefix, int process_id, int max_num_local_threads) { - (void)file_name_prefix; +static inline void lf_tracing_global_init(char* process_name, char* process_names, int process_id, int max_num_local_threads) { + (void)process_name; + (void)process_names; (void)process_id; (void)max_num_local_threads; } diff --git a/trace/api/trace.h b/trace/api/trace.h index 19b4d6208..afe538c48 100644 --- a/trace/api/trace.h +++ b/trace/api/trace.h @@ -176,12 +176,14 @@ typedef struct { * calling this procedure is undefined behavior. * * @param process_name The name of the current federate, or a placeholder if this is not a federate. + * @param process_names The names of all federates, separated by commas, or NULL + * if that information is not available. * @param process_id The ID of the current federate, or -1 if this is the RTI. 0 * if unfederated. * @param max_num_local_threads An upper bound on the number of threads created * by this process. */ -void lf_tracing_global_init(char* process_name, int process_id, int max_num_local_threads); +void lf_tracing_global_init(char* process_name, char* process_names, int process_id, int max_num_local_threads); /** * @brief Register a kind of trace event. This should be called before * tracepoints are reached. diff --git a/trace/impl/src/trace_impl.c b/trace/impl/src/trace_impl.c index ed0439376..bd577b337 100644 --- a/trace/impl/src/trace_impl.c +++ b/trace/impl/src/trace_impl.c @@ -253,7 +253,7 @@ void lf_tracing_tracepoint(int worker, trace_record_nodeps_t* tr) { } } -void lf_tracing_global_init(char* process_name, int fedid, int max_num_local_threads) { +void lf_tracing_global_init(char* process_name, char* process_names, int fedid, int max_num_local_threads) { trace_mutex = lf_platform_mutex_new(); if (!trace_mutex) { fprintf(stderr, "WARNING: Failed to initialize trace mutex.\n");