diff options
Diffstat (limited to 'litmus/trace.c')
-rw-r--r-- | litmus/trace.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/litmus/trace.c b/litmus/trace.c index 7d726a8e8e02..fc1d03f35d39 100644 --- a/litmus/trace.c +++ b/litmus/trace.c | |||
@@ -74,6 +74,7 @@ static void __add_timestamp_user(struct timestamp *pre_recorded) | |||
74 | if (ft_buffer_start_write(trace_ts_buf, (void**) &ts)) { | 74 | if (ft_buffer_start_write(trace_ts_buf, (void**) &ts)) { |
75 | *ts = *pre_recorded; | 75 | *ts = *pre_recorded; |
76 | ts->seq_no = seq_no; | 76 | ts->seq_no = seq_no; |
77 | ts->cpu = raw_smp_processor_id(); | ||
77 | __save_irq_flags(ts); | 78 | __save_irq_flags(ts); |
78 | ft_buffer_finish_write(trace_ts_buf, ts); | 79 | ft_buffer_finish_write(trace_ts_buf, ts); |
79 | } | 80 | } |
@@ -136,6 +137,26 @@ feather_callback void save_task_latency(unsigned long event, | |||
136 | } | 137 | } |
137 | } | 138 | } |
138 | 139 | ||
140 | /* fake timestamp to user-reported time */ | ||
141 | void save_timestamp_time(unsigned long event, | ||
142 | unsigned long ptr) | ||
143 | { | ||
144 | uint64_t* time = (uint64_t*) ptr; | ||
145 | unsigned int seq_no; | ||
146 | struct timestamp *ts; | ||
147 | seq_no = fetch_and_inc((int *) &ts_seq_no); | ||
148 | if (ft_buffer_start_write(trace_ts_buf, (void**) &ts)) { | ||
149 | ts->event = event; | ||
150 | ts->seq_no = seq_no; | ||
151 | ts->pid = current->pid; | ||
152 | ts->cpu = raw_smp_processor_id(); | ||
153 | ts->task_type = is_realtime(current) ? TSK_RT : TSK_BE; | ||
154 | __save_irq_flags(ts); | ||
155 | ts->timestamp = *time; | ||
156 | ft_buffer_finish_write(trace_ts_buf, ts); | ||
157 | } | ||
158 | } | ||
159 | |||
139 | /******************************************************************************/ | 160 | /******************************************************************************/ |
140 | /* DEVICE FILE DRIVER */ | 161 | /* DEVICE FILE DRIVER */ |
141 | /******************************************************************************/ | 162 | /******************************************************************************/ |