Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracing federate interactions #178

Merged
merged 61 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0917536
Rough start on tracing federated execution
edwardalee Feb 16, 2023
fcb9c6b
Merge remote-tracking branch 'origin/main' into tracing-federates
edwardalee Feb 17, 2023
f46f85b
Renamed variable
edwardalee Feb 17, 2023
3758128
Start on tracing federates
edwardalee Feb 17, 2023
7440c74
Add trace points for TAG and PTAG messages
byeonggiljun Feb 18, 2023
1ae0206
Fix complilation when tracing==false
ChadliaJerad Feb 18, 2023
d02e568
Create working canvas for RTI tracing. It collects trace points of me…
ChadliaJerad Feb 21, 2023
376503c
Get the federate id into the tracepoint. This is done at the federate…
ChadliaJerad Feb 22, 2023
e4bc739
Renamed reaction_number to id_number
edwardalee Feb 23, 2023
b4b035a
Cleaned up fed_id on RTI side
edwardalee Feb 23, 2023
a8eb6b1
Silence warning
edwardalee Feb 23, 2023
b00c107
Reordered imports and removed unneeded include
edwardalee Feb 23, 2023
d96abd7
Comment only
edwardalee Feb 23, 2023
8e82cd9
Replaced cascading ifs with switch statement
edwardalee Feb 23, 2023
ea4afb2
Refactored to customize trace messages by type
edwardalee Feb 23, 2023
c6f15c0
Tracing RTI sent messages
ChadliaJerad Feb 23, 2023
3da6c76
Fixed minor bug and a warning
ChadliaJerad Feb 23, 2023
8526388
merge latest updates from main
ChadliaJerad Mar 2, 2023
c0fd5fb
Record the tracepoint right after writing to the socket, instead of a…
ChadliaJerad Mar 3, 2023
3b5e707
Replace .c includes with .h includes
edwardalee Mar 5, 2023
b79cdc9
Uniforming trace function calls and trace event names + Add more trac…
ChadliaJerad Mar 5, 2023
ecca71e
Merge updates from main to use refactored rti
ChadliaJerad Mar 6, 2023
8648737
Improve tracepoints event names. Add more tracepoints. Use worker fie…
ChadliaJerad Mar 7, 2023
8edf614
Fix warnings on debug printfs
edwardalee Mar 7, 2023
b540139
Remove comments that are redundant with .h file and make args const
edwardalee Mar 7, 2023
5eb44e0
Reorganized tracing fields to have two IDs and adjusted methods to ta…
edwardalee Mar 7, 2023
f1cac1f
Better reporting of the physical_time when tracing
ChadliaJerad Mar 7, 2023
fc06a47
More precise physical time in tracepoints within federated execution …
ChadliaJerad Mar 8, 2023
f45ab42
Add more tracepoints at the federate side
ChadliaJerad Mar 8, 2023
e2db34b
Restoring the accidentally deleted CMakeLists.txt file
ChadliaJerad Mar 8, 2023
391d418
Revert manually reporting physical time in tracing federate and RTI e…
ChadliaJerad Mar 8, 2023
e13c963
Revert "Add more tracepoints at the federate side"
ChadliaJerad Mar 8, 2023
7fcb0e1
Revert "More precise physical time in tracepoints within federated ex…
ChadliaJerad Mar 8, 2023
544de90
Revert "Better reporting of the physical_time when tracing"
ChadliaJerad Mar 8, 2023
aa22860
Add more tracepoints
ChadliaJerad Mar 9, 2023
cdfd1b9
Added some missing tracepoints
edwardalee Mar 9, 2023
91c9316
Added some missing tracepoints
edwardalee Mar 9, 2023
81a4fab
Shortened names of messages further
edwardalee Mar 9, 2023
64a3ec5
Merge branch 'main' into tracing-federates
ChadliaJerad Mar 9, 2023
c2f895a
Fixed bogus indent
edwardalee Mar 10, 2023
d9c956b
Removed atexit invocation of stop_trace because it was being invoked …
edwardalee Mar 10, 2023
c2cff2a
Attempt to get mysterious unreproducible compile error to go
edwardalee Mar 10, 2023
25b1d89
Augment RESIGN message to carry a timestamp, and thus matches when tr…
ChadliaJerad Mar 10, 2023
85d5375
Align with tracing-federates branch of LF
edwardalee Mar 12, 2023
b7f54d8
Suppress warning
edwardalee Mar 12, 2023
edee7f1
Added mysterious define(EXECUTABLE_PREAMBLE)
edwardalee Mar 12, 2023
a3e8497
Address 'unfinished' reviews + Add more tracepoints
ChadliaJerad Mar 15, 2023
2e19c93
Merge branch 'main' into tracing-federates
edwardalee Mar 15, 2023
6093207
Remove runtime tracing check in federate.c, as the tarcefunctions are…
ChadliaJerad Mar 16, 2023
c52dee9
Remove compile-time checking of RTI tracing
ChadliaJerad Mar 16, 2023
31404ff
Simplified tracing so it doesn't require threads
edwardalee Mar 22, 2023
1f4bc48
Removed deadlock risk
edwardalee Mar 22, 2023
9263c04
Implement critical section functions for RTI
edwardalee Mar 22, 2023
b1171b7
Put braces around if..else for g++
edwardalee Mar 22, 2023
18e6940
Suppress warning
edwardalee Mar 22, 2023
a58831b
Another if..else without braces
edwardalee Mar 22, 2023
ea429a8
Address reviews on rti.c and rti_lib.c
ChadliaJerad Mar 22, 2023
66d7b9e
Remove obsolete FIXME
edwardalee Mar 22, 2023
684e354
Pass worker ID and added is_interval_start start arg to tracepoint
edwardalee Mar 23, 2023
4d6bb55
Put mutex around user-defined tracepoints because we don't know the w…
edwardalee Mar 23, 2023
e8c0521
Comment only
edwardalee Mar 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/federated/RTI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ add_executable(
RTI
rti.c
rti_lib.c
${CoreLib}/trace.c
${LF_PLATFORM_FILE}
${CoreLib}/platform/lf_unix_clock_support.c
${CoreLib}/utils/util.c
Expand All @@ -80,6 +81,9 @@ ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG)
target_compile_definitions(RTI PUBLIC LF_THREADED=1 FEDERATED=1)
target_compile_definitions(RTI PUBLIC PLATFORM_${CMAKE_SYSTEM_NAME})

# Set RTI Tracing
target_compile_definitions(RTI PUBLIC RTI_TRACE)

# Find threads and link to it
find_package(Threads REQUIRED)
target_link_libraries(RTI Threads::Threads)
Expand Down
2 changes: 1 addition & 1 deletion core/federated/RTI/message_record/message_record.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ tag_t get_minimum_in_transit_message_tag(in_transit_message_record_q_t* queue) {

if (head_of_in_transit_messages != NULL) {
LF_PRINT_DEBUG(
"RTI: Minimum tag of all in-transit messages: (%ld, %u).",
"RTI: Minimum tag of all in-transit messages: " PRINTF_TAG,
head_of_in_transit_messages->tag.time - lf_time_start(),
head_of_in_transit_messages->tag.microstep
);
Expand Down
16 changes: 15 additions & 1 deletion core/federated/RTI/rti.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,25 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "rti_lib.h"
unsigned int _lf_number_of_workers = 0u;

extern RTI_instance_t _RTI;

int main(int argc, char* argv[]) {
/**
* RTI trace file name
*/
const char *rti_trace_file_name = "rti.lft";

int main(int argc, const char* argv[]) {
if (!process_args(argc, argv)) {
// Processing command-line arguments failed.
return -1;
}
if (_RTI.tracing_enabled) {
_lf_number_of_workers = _RTI.number_of_federates;
start_trace(rti_trace_file_name);
printf("Tracing the RTI execution in %s file.\n", rti_trace_file_name);
}
printf("Starting RTI for %d federates in federation ID %s\n", _RTI.number_of_federates, _RTI.federation_id);
assert(_RTI.number_of_federates < UINT16_MAX);
_RTI.federates = (federate_t*)calloc(_RTI.number_of_federates, sizeof(federate_t));
Expand All @@ -63,6 +74,9 @@ int main(int argc, char* argv[]) {
}
int socket_descriptor = start_rti_server(_RTI.user_specified_port);
wait_for_federates(socket_descriptor);
if (_RTI.tracing_enabled) {
stop_trace();
}
printf("RTI is exiting.\n");
return 0;
}
Loading