aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2014-03-20 05:55:02 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2016-03-08 10:12:48 -0500
commit4fb320b47187343c44be8fd01387fd57241e6a86 (patch)
tree4269a04e247314bf527b6ba0731f77b01efcd014
parent11e71127c200008ec7b904ed9c74c7870efa3849 (diff)
Feather-Trace: Add macros for message-passing timestamps
Add timestamp tracing macros that reverse on which cores the timestamps are recorded. This intended to reduce tracing contention if some cores receive a lot of messages. These macros are useful for plugins based on message-passing such as the (non-mainline) G-EDF-MP.
-rw-r--r--include/litmus/trace.h17
-rw-r--r--litmus/trace.c17
2 files changed, 28 insertions, 6 deletions
diff --git a/include/litmus/trace.h b/include/litmus/trace.h
index 8ac4bb41a707..2646136e3881 100644
--- a/include/litmus/trace.h
+++ b/include/litmus/trace.h
@@ -28,14 +28,23 @@ struct timestamp {
28}; 28};
29 29
30/* tracing callbacks */ 30/* tracing callbacks */
31feather_callback void msg_sent(unsigned long event, unsigned long to); 31feather_callback void msg_sent_to(unsigned long event, unsigned long to);
32feather_callback void msg_received(unsigned long event); 32feather_callback void msg_received_local(unsigned long event);
33
34feather_callback void msg_sent_local(unsigned long event);
35feather_callback void msg_received_from(unsigned long event, unsigned long from);
33 36
34#define MSG_TIMESTAMP_SENT(id, to) \ 37#define MSG_TIMESTAMP_SENT(id, to) \
35 ft_event1(id, msg_sent, (unsigned long) to); 38 ft_event1(id, msg_sent_to, (unsigned long) (to));
36 39
37#define MSG_TIMESTAMP_RECEIVED(id) \ 40#define MSG_TIMESTAMP_RECEIVED(id) \
38 ft_event0(id, msg_received); 41 ft_event0(id, msg_received_local);
42
43#define MSG_TIMESTAMP_SENT_LOCAL(id) \
44 ft_event0(id, msg_sent_local);
45
46#define MSG_TIMESTAMP_RECEIVED_FROM(id, from) \
47 ft_event1(id, msg_received_from, (unsigned long) (from))
39 48
40feather_callback void save_cpu_timestamp(unsigned long event); 49feather_callback void save_cpu_timestamp(unsigned long event);
41feather_callback void save_cpu_timestamp_time(unsigned long event, unsigned long time_ptr); 50feather_callback void save_cpu_timestamp_time(unsigned long event, unsigned long time_ptr);
diff --git a/litmus/trace.c b/litmus/trace.c
index 330d1e8240be..99846039286e 100644
--- a/litmus/trace.c
+++ b/litmus/trace.c
@@ -270,18 +270,31 @@ feather_callback void save_cpu_task_latency(unsigned long event,
270 now - *when, DO_NOT_RECORD_TIMESTAMP); 270 now - *when, DO_NOT_RECORD_TIMESTAMP);
271} 271}
272 272
273feather_callback void msg_sent(unsigned long event, unsigned long to) 273/* Record to remote trace buffer */
274feather_callback void msg_sent_to(unsigned long event, unsigned long to)
274{ 275{
275 save_remote_msg_timestamp(event, to); 276 save_remote_msg_timestamp(event, to);
276} 277}
277 278
279/* Record to local trace buffer */
280feather_callback void msg_sent_local(unsigned long event)
281{
282 save_msg_timestamp(event, 0);
283}
284
278/* Suppresses one IRQ from the irq count. Used by TS_SEND_RESCHED_END, which is 285/* Suppresses one IRQ from the irq count. Used by TS_SEND_RESCHED_END, which is
279 * called from within an interrupt that is expected. */ 286 * called from within an interrupt that is expected. */
280feather_callback void msg_received(unsigned long event) 287feather_callback void msg_received_local(unsigned long event)
281{ 288{
282 save_msg_timestamp(event, 1); 289 save_msg_timestamp(event, 1);
283} 290}
284 291
292/* Record to remote trace buffer */
293feather_callback void msg_received_from(unsigned long event, unsigned long from)
294{
295 save_remote_msg_timestamp(event, from);
296}
297
285static void __add_timestamp_user(struct timestamp *pre_recorded) 298static void __add_timestamp_user(struct timestamp *pre_recorded)
286{ 299{
287 unsigned long flags; 300 unsigned long flags;