11/*
2- * Copyright (C) 2021,2024 Cornelis Networks.
2+ * Copyright (C) 2021,2025 Cornelis Networks.
33 *
44 * This software is available to you under a choice of one of two
55 * licenses. You may choose to be licensed under the terms of the GNU
@@ -139,31 +139,34 @@ static inline void flight_recorder_dump_packet_payload(struct flight_recorder_en
139139 }
140140}
141141
142- static inline void flight_recorder_dump (struct flight_recorder * fr )
142+ static inline void flight_recorder_dump (struct fi_opx_ep * opx_ep , struct flight_recorder * fr )
143143{
144144 const unsigned count = fr -> count ;
145145 struct timespec current_time ;
146146 fi_opx_timer_now (fr -> now , fr -> timer );
147147 if (!fr -> timer -> cycle_timer .use_cycle_timer ) {
148148 current_time = fr -> now -> tp ;
149149 fprintf (stderr ,
150+ "#FLIGHT_RECORDER t%d |EP: %p\n"
150151 "#FLIGHT_RECORDER t%d |Last Dump Time: %ld.%ld\n"
151152 "#FLIGHT_RECORDER t%d |Current Time: %ld.%ld\n"
152153 "#FLIGHT_RECORDER t%d |Entry Count : %u\n" ,
153- fr -> tid , fr -> last_dump .tv_sec , fr -> last_dump .tv_nsec , fr -> tid , current_time . tv_sec ,
154- current_time .tv_nsec , fr -> tid , count );
154+ fr -> tid , opx_ep , fr -> tid , fr -> last_dump .tv_sec , fr -> last_dump .tv_nsec , fr -> tid ,
155+ current_time .tv_sec , current_time . tv_nsec , fr -> tid , count );
155156 fr -> last_dump = current_time ;
156157 if (count == 0 ) {
157158 fr -> last_dump = current_time ;
158159 return ;
159160 }
160161 } else {
161162 fprintf (stderr ,
163+ "#FLIGHT_RECORDER t%d |EP: %p\n"
162164 "#FLIGHT_RECORDER t%d |Last Dump Time: %0.9lf\n"
163165 "#FLIGHT_RECORDER t%d |Current Time: %0.9lf\n"
164166 "#FLIGHT_RECORDER t%d |Entry Count : %u\n" ,
165- fr -> tid , fr -> last_dump_cycles * fr -> timer -> cycle_timer .picos_per_cycle / 1e12 , fr -> tid ,
166- fr -> now -> cycle_timer .cycles * fr -> timer -> cycle_timer .picos_per_cycle / 1e12 , fr -> tid , count );
167+ fr -> tid , opx_ep , fr -> tid , fr -> last_dump_cycles * fr -> timer -> cycle_timer .picos_per_cycle / 1e12 ,
168+ fr -> tid , fr -> now -> cycle_timer .cycles * fr -> timer -> cycle_timer .picos_per_cycle / 1e12 , fr -> tid ,
169+ count );
167170 fr -> last_dump_cycles = fr -> now -> cycle_timer .cycles ;
168171 if (count == 0 ) {
169172 fr -> last_dump_cycles = fr -> now -> cycle_timer .cycles ;
@@ -199,33 +202,33 @@ static inline void flight_recorder_dump(struct flight_recorder *fr)
199202 fr -> count = 0 ;
200203}
201204
202- #define FLIGHT_RECORDER_STRING (fr , event_id , format , ...) \
205+ #define FLIGHT_RECORDER_STRING (ep , fr , event_id , format , ...) \
203206 { \
204207 struct flight_recorder_entry *next = \
205208 flight_recorder_init_next_entry((fr), (event_id), FR_ENTRY_TYPE_STRING); \
206209 int actual_len = snprintf((char *) next->data, FLIGHT_RECORDER_ENTRY_DATA_LEN, format, ##__VA_ARGS__); \
207210 int end_of_string = MIN(actual_len, FLIGHT_RECORDER_ENTRY_DATA_LEN - 1); \
208211 next->data[end_of_string] = 0; \
209212 if ((fr)->count + 1 == FLIGHT_RECORDER_ENTRY_COUNT) \
210- flight_recorder_dump(( fr)); \
213+ flight_recorder_dump(ep, fr); \
211214 }
212215
213- #define FLIGHT_RECORDER_PACKET_HDR (fr , event_id , packet_hdr ) \
216+ #define FLIGHT_RECORDER_PACKET_HDR (ep , fr , event_id , packet_hdr ) \
214217 { \
215218 struct flight_recorder_entry *next = \
216219 flight_recorder_init_next_entry((fr), (event_id), FR_ENTRY_TYPE_PACKET_HDR); \
217220 memcpy((void *) next->data, (void *) &(packet_hdr), sizeof(struct fi_opx_hfi1_stl_packet_hdr_9B)); \
218221 if ((fr)->count + 1 == FLIGHT_RECORDER_ENTRY_COUNT) \
219- flight_recorder_dump(( fr)); \
222+ flight_recorder_dump(ep, fr); \
220223 }
221224
222- #define FLIGHT_RECORDER_PACKET (fr , event_id , packet ) \
225+ #define FLIGHT_RECORDER_PACKET (ep , fr , event_id , packet ) \
223226 { \
224227 struct flight_recorder_entry *next = \
225228 flight_recorder_init_next_entry((fr), (event_id), FR_ENTRY_TYPE_PACKET); \
226229 memcpy((void *) next->data, (void *) &(packet), sizeof(union fi_opx_hfi1_packet_payload)); \
227230 if ((fr)->count + 1 == FLIGHT_RECORDER_ENTRY_COUNT) \
228- flight_recorder_dump(( fr)); \
231+ flight_recorder_dump(ep, fr); \
229232 }
230233
231234#define FLIGHT_RECORDER_INIT (fr ) \
@@ -235,9 +238,9 @@ static inline void flight_recorder_dump(struct flight_recorder *fr)
235238
236239#else /* !FLIGHT_RECORDER_ENABLE */
237240
238- #define FLIGHT_RECORDER_STRING (fr , event_id , format , ...)
239- #define FLIGHT_RECORDER_PACKET_HDR (fr , event_id , packet_hdr )
240- #define FLIGHT_RECORDER_PACKET (fr , event_id , packet )
241+ #define FLIGHT_RECORDER_STRING (ep , fr , event_id , format , ...)
242+ #define FLIGHT_RECORDER_PACKET_HDR (ep , fr , event_id , packet_hdr )
243+ #define FLIGHT_RECORDER_PACKET (ep , fr , event_id , packet )
241244
242245#endif /* #ifdef FLIGHT_RECORDER_ENABLE */
243246
0 commit comments