aboutsummaryrefslogtreecommitdiffstats
path: root/litmus
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-07-25 17:22:29 -0400
committerChristopher Kenna <cjk@cs.unc.edu>2011-10-10 17:28:36 -0400
commitc83d480d352ca8b2eae419966d6feae02d16aeff (patch)
treea78ed74e9bd25685780b12542368be11fcdf70c9 /litmus
parentb1a51931633520901fa771dcf0b7c7d78fe4a304 (diff)
Feather-Trace: record PID fragments for locking overheads
We need to be able to figure out overlapping suspensions, etc. So to reuse the existing format, just encode the lower 16bits of the PID in the cpu and task-type fields (which we don't care about when collecting locking overheads).
Diffstat (limited to 'litmus')
-rw-r--r--litmus/trace.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/litmus/trace.c b/litmus/trace.c
index 23763c19fa6b..49f8246cda50 100644
--- a/litmus/trace.c
+++ b/litmus/trace.c
@@ -37,14 +37,7 @@ static inline void __save_timestamp(unsigned long event,
37 __save_timestamp_cpu(event, type, raw_smp_processor_id()); 37 __save_timestamp_cpu(event, type, raw_smp_processor_id());
38} 38}
39 39
40static inline uint8_t task_type(struct task_struct* t) 40/* hack: fake timestamp to user-reported time, and record parts of the PID */
41{
42 if (!t)
43 return TSK_UNKNOWN;
44 else
45 return is_realtime(t) ? TSK_RT : TSK_BE;
46}
47
48feather_callback void save_timestamp_time(unsigned long event, unsigned long ptr) 41feather_callback void save_timestamp_time(unsigned long event, unsigned long ptr)
49{ 42{
50 uint64_t* time = (uint64_t*) ptr; 43 uint64_t* time = (uint64_t*) ptr;
@@ -55,12 +48,25 @@ feather_callback void save_timestamp_time(unsigned long event, unsigned long ptr
55 ts->event = event; 48 ts->event = event;
56 ts->timestamp = *time; 49 ts->timestamp = *time;
57 ts->seq_no = seq_no; 50 ts->seq_no = seq_no;
58 ts->cpu = raw_smp_processor_id(); 51 /* type takes lowest byte of PID */
59 ts->task_type = task_type(current); 52 ts->task_type = (uint8_t) current->pid;
53 /* cpu takes second-lowest byte of PID*/
54 ts->cpu = (uint8_t) (current->pid >> 8);
55
60 ft_buffer_finish_write(trace_ts_buf, ts); 56 ft_buffer_finish_write(trace_ts_buf, ts);
61 } 57 }
62} 58}
63 59
60feather_callback void save_timestamp_pid(unsigned long event)
61{
62 /* Abuse existing fields to partially export PID. */
63 __save_timestamp_cpu(event,
64 /* type takes lowest byte of PID */
65 (uint8_t) current->pid,
66 /* cpu takes second-lowest byte of PID*/
67 (uint8_t) (current->pid >> 8));
68}
69
64feather_callback void save_timestamp(unsigned long event) 70feather_callback void save_timestamp(unsigned long event)
65{ 71{
66 __save_timestamp(event, TSK_UNKNOWN); 72 __save_timestamp(event, TSK_UNKNOWN);