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 c511003ea911..45cd662c021d 100644 --- a/litmus/trace.c +++ b/litmus/trace.c | |||
@@ -166,6 +166,27 @@ void save_timestamp_time(unsigned long event, | |||
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
169 | /* Record user-reported IRQ count */ | ||
170 | void save_timestamp_irq(unsigned long event, | ||
171 | unsigned long irq_counter_ptr) | ||
172 | { | ||
173 | uint64_t* irqs = (uint64_t*) irq_counter_ptr; | ||
174 | unsigned int seq_no; | ||
175 | struct timestamp *ts; | ||
176 | seq_no = fetch_and_inc((int *) &ts_seq_no); | ||
177 | if (ft_buffer_start_write(trace_ts_buf, (void**) &ts)) { | ||
178 | ts->event = event; | ||
179 | ts->seq_no = seq_no; | ||
180 | ts->pid = current->pid; | ||
181 | ts->cpu = raw_smp_processor_id(); | ||
182 | ts->task_type = is_realtime(current) ? TSK_RT : TSK_BE; | ||
183 | ts->irq_count = *irqs; | ||
184 | ts->irq_flag = *irqs > 0; | ||
185 | ts->timestamp = ft_timestamp(); | ||
186 | ft_buffer_finish_write(trace_ts_buf, ts); | ||
187 | } | ||
188 | } | ||
189 | |||
169 | /******************************************************************************/ | 190 | /******************************************************************************/ |
170 | /* DEVICE FILE DRIVER */ | 191 | /* DEVICE FILE DRIVER */ |
171 | /******************************************************************************/ | 192 | /******************************************************************************/ |