aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/trace.c
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2012-08-15 07:13:08 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2012-10-18 16:14:02 -0400
commit5454446ed47708b26d40337e47affea5e1f298ef (patch)
treed76e1b681cf2291bf8d9269dd6820bd086ca5db8 /litmus/trace.c
parent7b84800f5ee2e35671ac08a7d281ac7f0069ce8f (diff)
Feather-Trace: update locking timestamps
Reassing locking timestamps and prepare support for tracing system call overheads.
Diffstat (limited to 'litmus/trace.c')
-rw-r--r--litmus/trace.c21
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 */
141void 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/******************************************************************************/