diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-10-06 11:36:10 -0400 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-10-06 11:36:10 -0400 |
| commit | 32a53a4274c3cee072604869a8db5b761c8ea5c0 (patch) | |
| tree | 20edd86277e55219d711a7401068713d56e7ec01 /include | |
| parent | a810715b458ce4ed51fea9e017355d84e8990a6a (diff) | |
sched_trace: new implementation
This provides and hooks up a new made-from-scratch sched_trace()
implementation based on Feather-Trace and ftdev.
Diffstat (limited to 'include')
| -rw-r--r-- | include/litmus/sched_trace.h | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index 3be349a69b..c5c55c6554 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
| @@ -12,8 +12,9 @@ struct st_trace_header { | |||
| 12 | u32 job; /* The job sequence number. */ | 12 | u32 job; /* The job sequence number. */ |
| 13 | }; | 13 | }; |
| 14 | 14 | ||
| 15 | #define ST_NAME_LEN 16 | ||
| 15 | struct st_name_data { | 16 | struct st_name_data { |
| 16 | char cmd[16]; /* The name of the executable of this process. */ | 17 | char cmd[ST_NAME_LEN];/* The name of the executable of this process. */ |
| 17 | }; | 18 | }; |
| 18 | 19 | ||
| 19 | struct st_param_data { /* regular params */ | 20 | struct st_param_data { /* regular params */ |
| @@ -104,31 +105,45 @@ struct st_event_record { | |||
| 104 | #ifdef __KERNEL__ | 105 | #ifdef __KERNEL__ |
| 105 | 106 | ||
| 106 | #include <linux/sched.h> | 107 | #include <linux/sched.h> |
| 107 | 108 | #include <litmus/feather_trace.h> | |
| 108 | /* dummies, need to be re-implemented */ | ||
| 109 | /* used in sched.c */ | ||
| 110 | #define sched_trace_task_arrival(t) | ||
| 111 | #define sched_trace_task_departure(t) | ||
| 112 | #define sched_trace_task_preemption(t, by) | ||
| 113 | #define sched_trace_task_scheduled(t) | ||
| 114 | |||
| 115 | /* used in scheduler plugins */ | ||
| 116 | #define sched_trace_job_release(t) | ||
| 117 | #define sched_trace_job_completion(t) | ||
| 118 | |||
| 119 | |||
| 120 | 109 | ||
| 121 | #ifdef CONFIG_SCHED_TASK_TRACE | 110 | #ifdef CONFIG_SCHED_TASK_TRACE |
| 122 | 111 | ||
| 123 | 112 | #define SCHED_TRACE(id, callback, task) \ | |
| 124 | 113 | ft_event1(id, callback, task) | |
| 114 | #define SCHED_TRACE2(id, callback, task, xtra) \ | ||
| 115 | ft_event2(id, callback, task, xtra) | ||
| 125 | 116 | ||
| 126 | #else | 117 | #else |
| 127 | 118 | ||
| 119 | #define SCHED_TRACE(id, callback, task) /* no tracing */ | ||
| 120 | #define SCHED_TRACE2(id, callback, task, xtra) /* no tracing */ | ||
| 128 | 121 | ||
| 129 | #endif | 122 | #endif |
| 130 | 123 | ||
| 131 | 124 | ||
| 125 | #define SCHED_TRACE_BASE_ID 500 | ||
| 126 | |||
| 127 | |||
| 128 | #define sched_trace_task_name(t) \ | ||
| 129 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 1, do_sched_trace_task_name, t) | ||
| 130 | #define sched_trace_task_param(t) \ | ||
| 131 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 2, do_sched_trace_task_param, t) | ||
| 132 | #define sched_trace_task_release(t) \ | ||
| 133 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 3, do_sched_trace_task_release, t) | ||
| 134 | #define sched_trace_task_switch_to(t) \ | ||
| 135 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 4, do_sched_trace_task_switch_to, t) | ||
| 136 | #define sched_trace_task_switch_away(t) \ | ||
| 137 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 5, do_sched_trace_task_switch_away, t) | ||
| 138 | #define sched_trace_task_completion(t, forced) \ | ||
| 139 | SCHED_TRACE2(SCHED_TRACE_BASE_ID + 6, do_sched_trace_task_completion, t, \ | ||
| 140 | forced) | ||
| 141 | #define sched_trace_task_block(t) \ | ||
| 142 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 7, do_sched_trace_task_block, t) | ||
| 143 | #define sched_trace_task_resume(t) \ | ||
| 144 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 8, do_sched_trace_task_resume, t) | ||
| 145 | |||
| 146 | |||
| 132 | #ifdef CONFIG_SCHED_DEBUG_TRACE | 147 | #ifdef CONFIG_SCHED_DEBUG_TRACE |
| 133 | void sched_trace_log_message(const char* fmt, ...); | 148 | void sched_trace_log_message(const char* fmt, ...); |
| 134 | 149 | ||
