diff options
Diffstat (limited to 'litmus/trace.c')
-rw-r--r-- | litmus/trace.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/litmus/trace.c b/litmus/trace.c index 1e916aa406b9..f0eb2c706488 100644 --- a/litmus/trace.c +++ b/litmus/trace.c | |||
@@ -61,6 +61,26 @@ feather_callback void save_timestamp_cpu(unsigned long event, | |||
61 | __save_timestamp_cpu(event, TSK_UNKNOWN, cpu); | 61 | __save_timestamp_cpu(event, TSK_UNKNOWN, cpu); |
62 | } | 62 | } |
63 | 63 | ||
64 | feather_callback void save_task_latency(unsigned long event, | ||
65 | unsigned long when_ptr) | ||
66 | { | ||
67 | lt_t now = litmus_clock(); | ||
68 | lt_t *when = (lt_t*) when_ptr; | ||
69 | unsigned int seq_no; | ||
70 | int cpu = raw_smp_processor_id(); | ||
71 | struct timestamp *ts; | ||
72 | |||
73 | seq_no = fetch_and_inc((int *) &ts_seq_no); | ||
74 | if (ft_buffer_start_write(trace_ts_buf, (void**) &ts)) { | ||
75 | ts->event = event; | ||
76 | ts->timestamp = now - *when; | ||
77 | ts->seq_no = seq_no; | ||
78 | ts->cpu = cpu; | ||
79 | ts->task_type = TSK_RT; | ||
80 | ft_buffer_finish_write(trace_ts_buf, ts); | ||
81 | } | ||
82 | } | ||
83 | |||
64 | /******************************************************************************/ | 84 | /******************************************************************************/ |
65 | /* DEVICE FILE DRIVER */ | 85 | /* DEVICE FILE DRIVER */ |
66 | /******************************************************************************/ | 86 | /******************************************************************************/ |