reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
trace.h File Reference
#include "lf_types.h"
#include <stdio.h>

Go to the source code of this file.

Macros

#define TRACE_H
 
#define _lf_register_trace_event(...)
 
#define register_user_trace_event(...)
 
#define tracepoint(...)
 
#define tracepoint_reaction_starts(...)
 
#define tracepoint_reaction_ends(...)
 
#define tracepoint_schedule(...)
 
#define tracepoint_user_event(...)
 
#define tracepoint_user_value(...)
 
#define tracepoint_worker_wait_starts(...)
 
#define tracepoint_worker_wait_ends(...)
 
#define tracepoint_scheduler_advancing_time_starts(...)   ;
 
#define tracepoint_scheduler_advancing_time_ends(...)   ;
 
#define tracepoint_reaction_deadline_missed(...)   ;
 
#define tracepoint_federate_to_rti(...)   ;
 
#define tracepoint_federate_from_rti(...)   ;
 
#define tracepoint_federate_to_federate(...)   ;
 
#define tracepoint_federate_from_federate(...)   ;
 
#define tracepoint_rti_to_federate(...)   ;
 
#define tracepoint_rti_from_federate(...)   ;
 
#define start_trace(...)
 
#define stop_trace(...)
 
#define trace_new(...)   NULL
 
#define trace_free(...)
 

Enumerations

enum  trace_event_t {
  reaction_starts , reaction_ends , reaction_deadline_missed , schedule_called ,
  user_event , user_value , worker_wait_starts , worker_wait_ends ,
  scheduler_advancing_time_starts , scheduler_advancing_time_ends , federated , send_ACK ,
  send_TIMESTAMP , send_NET , send_LTC , send_STOP_REQ ,
  send_STOP_REQ_REP , send_STOP_GRN , send_FED_ID , send_PTAG ,
  send_TAG , send_REJECT , send_RESIGN , send_PORT_ABS ,
  send_CLOSE_RQ , send_TAGGED_MSG , send_P2P_TAGGED_MSG , send_MSG ,
  send_P2P_MSG , send_ADR_AD , send_ADR_QR , receive_ACK ,
  receive_TIMESTAMP , receive_NET , receive_LTC , receive_STOP_REQ ,
  receive_STOP_REQ_REP , receive_STOP_GRN , receive_FED_ID , receive_PTAG ,
  receive_TAG , receive_REJECT , receive_RESIGN , receive_PORT_ABS ,
  receive_CLOSE_RQ , receive_TAGGED_MSG , receive_P2P_TAGGED_MSG , receive_MSG ,
  receive_P2P_MSG , receive_ADR_AD , receive_ADR_QR , receive_UNIDENTIFIED ,
  NUM_EVENT_TYPES
}
 

Detailed Description

Author
Edward A. Lee

LICENSE

Copyright (c) 2020, The University of California at Berkeley and TU Dresden

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Functions intitializing and freeing memory for environments.

Definitions of tracepoint events for use with the C code generator and any other code generator that uses the C infrastructure (such as the Python code generator).

See: https://www.lf-lang.org/docs/handbook/tracing?target=c

The trace file is named trace.lft and is a binary file with the following format:

Header:

  • instant_t: The start time. This is both the starting physical time and the starting logical time.
  • int: Size N of the table mapping pointers to descriptions. This is followed by N records each of which has:
  • A pointer value (the key).
  • A null-terminated string (the description).

Traces: A sequence of traces, each of which begins with an int giving the length of the trace followed by binary representations of the trace_record struct written using fwrite().

Macro Definition Documentation

◆ _lf_register_trace_event

#define _lf_register_trace_event (   ...)

◆ register_user_trace_event

#define register_user_trace_event (   ...)

◆ start_trace

#define start_trace (   ...)

◆ stop_trace

#define stop_trace (   ...)

◆ trace_free

#define trace_free (   ...)

◆ TRACE_H

#define TRACE_H

◆ trace_new

#define trace_new (   ...)    NULL

◆ tracepoint

#define tracepoint (   ...)

◆ tracepoint_federate_from_federate

#define tracepoint_federate_from_federate (   ...)    ;

◆ tracepoint_federate_from_rti

#define tracepoint_federate_from_rti (   ...)    ;

◆ tracepoint_federate_to_federate

#define tracepoint_federate_to_federate (   ...)    ;

◆ tracepoint_federate_to_rti

#define tracepoint_federate_to_rti (   ...)    ;

◆ tracepoint_reaction_deadline_missed

#define tracepoint_reaction_deadline_missed (   ...)    ;

◆ tracepoint_reaction_ends

#define tracepoint_reaction_ends (   ...)

◆ tracepoint_reaction_starts

#define tracepoint_reaction_starts (   ...)

◆ tracepoint_rti_from_federate

#define tracepoint_rti_from_federate (   ...)    ;

◆ tracepoint_rti_to_federate

#define tracepoint_rti_to_federate (   ...)    ;

◆ tracepoint_schedule

#define tracepoint_schedule (   ...)

◆ tracepoint_scheduler_advancing_time_ends

#define tracepoint_scheduler_advancing_time_ends (   ...)    ;

◆ tracepoint_scheduler_advancing_time_starts

#define tracepoint_scheduler_advancing_time_starts (   ...)    ;

◆ tracepoint_user_event

#define tracepoint_user_event (   ...)

◆ tracepoint_user_value

#define tracepoint_user_value (   ...)

◆ tracepoint_worker_wait_ends

#define tracepoint_worker_wait_ends (   ...)

◆ tracepoint_worker_wait_starts

#define tracepoint_worker_wait_starts (   ...)

Enumeration Type Documentation

◆ trace_event_t

Trace event types. If you update this, be sure to update the string representation below. Also, create a tracepoint function for each event type.

Enumerator
reaction_starts 
reaction_ends 
reaction_deadline_missed 
schedule_called 
user_event 
user_value 
worker_wait_starts 
worker_wait_ends 
scheduler_advancing_time_starts 
scheduler_advancing_time_ends 
federated 
send_ACK 
send_TIMESTAMP 
send_NET 
send_LTC 
send_STOP_REQ 
send_STOP_REQ_REP 
send_STOP_GRN 
send_FED_ID 
send_PTAG 
send_TAG 
send_REJECT 
send_RESIGN 
send_PORT_ABS 
send_CLOSE_RQ 
send_TAGGED_MSG 
send_P2P_TAGGED_MSG 
send_MSG 
send_P2P_MSG 
send_ADR_AD 
send_ADR_QR 
receive_ACK 
receive_TIMESTAMP 
receive_NET 
receive_LTC 
receive_STOP_REQ 
receive_STOP_REQ_REP 
receive_STOP_GRN 
receive_FED_ID 
receive_PTAG 
receive_TAG 
receive_REJECT 
receive_RESIGN 
receive_PORT_ABS 
receive_CLOSE_RQ 
receive_TAGGED_MSG 
receive_P2P_TAGGED_MSG 
receive_MSG 
receive_P2P_MSG 
receive_ADR_AD 
receive_ADR_QR 
receive_UNIDENTIFIED 
NUM_EVENT_TYPES