From 5454446ed47708b26d40337e47affea5e1f298ef Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Wed, 15 Aug 2012 13:13:08 +0200 Subject: Feather-Trace: update locking timestamps Reassing locking timestamps and prepare support for tracing system call overheads. --- litmus/locking.c | 2 ++ litmus/trace.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'litmus') diff --git a/litmus/locking.c b/litmus/locking.c index ca5a073a989e..df7d0a939c08 100644 --- a/litmus/locking.c +++ b/litmus/locking.c @@ -2,6 +2,8 @@ #ifdef CONFIG_LITMUS_LOCKING +#include +#include #include #include #include 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) if (ft_buffer_start_write(trace_ts_buf, (void**) &ts)) { *ts = *pre_recorded; ts->seq_no = seq_no; + ts->cpu = raw_smp_processor_id(); __save_irq_flags(ts); ft_buffer_finish_write(trace_ts_buf, ts); } @@ -136,6 +137,26 @@ feather_callback void save_task_latency(unsigned long event, } } +/* fake timestamp to user-reported time */ +void save_timestamp_time(unsigned long event, + unsigned long ptr) +{ + uint64_t* time = (uint64_t*) ptr; + unsigned int seq_no; + struct timestamp *ts; + seq_no = fetch_and_inc((int *) &ts_seq_no); + if (ft_buffer_start_write(trace_ts_buf, (void**) &ts)) { + ts->event = event; + ts->seq_no = seq_no; + ts->pid = current->pid; + ts->cpu = raw_smp_processor_id(); + ts->task_type = is_realtime(current) ? TSK_RT : TSK_BE; + __save_irq_flags(ts); + ts->timestamp = *time; + ft_buffer_finish_write(trace_ts_buf, ts); + } +} + /******************************************************************************/ /* DEVICE FILE DRIVER */ /******************************************************************************/ -- cgit v1.2.2