diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-05-16 23:44:11 -0400 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-05-16 23:44:11 -0400 |
| commit | 4e87ccced9533fac1e943bcb9e88e1f580f01b1a (patch) | |
| tree | accf4fefbbd2094d3c53aff1db5f14b17596e6a3 | |
| parent | 0a460221dc2e0338f08ce7421cae7a4763412375 (diff) | |
Insert trigger for enter_np()/exit_np() tracing.
| -rw-r--r-- | include/linux/trace.h | 5 | ||||
| -rw-r--r-- | kernel/litmus.c | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/trace.h b/include/linux/trace.h index e241ed45be..ae3fd3bfce 100644 --- a/include/linux/trace.h +++ b/include/linux/trace.h | |||
| @@ -48,6 +48,11 @@ asmlinkage void save_timestamp(unsigned long event); | |||
| 48 | #define TS_PLUGIN_TICK_START TIMESTAMP(130) | 48 | #define TS_PLUGIN_TICK_START TIMESTAMP(130) |
| 49 | #define TS_PLUGIN_TICK_END TIMESTAMP(131) | 49 | #define TS_PLUGIN_TICK_END TIMESTAMP(131) |
| 50 | 50 | ||
| 51 | #define TS_ENTER_NP_START TIMESTAMP(140) | ||
| 52 | #define TS_ENTER_NP_END TIMESTAMP(141) | ||
| 53 | |||
| 54 | #define TS_EXIT_NP_START TIMESTAMP(150) | ||
| 55 | #define TS_EXIT_NP_END TIMESTAMP(151) | ||
| 51 | 56 | ||
| 52 | 57 | ||
| 53 | #endif /* !_SYS_TRACE_H_ */ | 58 | #endif /* !_SYS_TRACE_H_ */ |
diff --git a/kernel/litmus.c b/kernel/litmus.c index 4b0788ae8e..3715d4df6e 100644 --- a/kernel/litmus.c +++ b/kernel/litmus.c | |||
| @@ -236,6 +236,8 @@ asmlinkage long sys_sleep_next_period(void) | |||
| 236 | asmlinkage long sys_enter_np(void) | 236 | asmlinkage long sys_enter_np(void) |
| 237 | { | 237 | { |
| 238 | int retval = -EINVAL; | 238 | int retval = -EINVAL; |
| 239 | preempt_disable(); | ||
| 240 | TS_ENTER_NP_START; | ||
| 239 | if (!is_realtime(current)) | 241 | if (!is_realtime(current)) |
| 240 | goto out; | 242 | goto out; |
| 241 | /* Let the plugin decide. The default callback will return -EPERM. | 243 | /* Let the plugin decide. The default callback will return -EPERM. |
| @@ -244,6 +246,8 @@ asmlinkage long sys_enter_np(void) | |||
| 244 | TRACE("enter_np(%s/%d) => %d and np=%d\n", | 246 | TRACE("enter_np(%s/%d) => %d and np=%d\n", |
| 245 | current->comm, current->pid, retval, is_np(current)); | 247 | current->comm, current->pid, retval, is_np(current)); |
| 246 | out: | 248 | out: |
| 249 | TS_ENTER_NP_END; | ||
| 250 | preempt_enable(); | ||
| 247 | return retval; | 251 | return retval; |
| 248 | } | 252 | } |
| 249 | 253 | ||
| @@ -258,6 +262,8 @@ asmlinkage long sys_enter_np(void) | |||
| 258 | asmlinkage long sys_exit_np(void) | 262 | asmlinkage long sys_exit_np(void) |
| 259 | { | 263 | { |
| 260 | int retval = -EINVAL; | 264 | int retval = -EINVAL; |
| 265 | preempt_disable(); | ||
| 266 | TS_EXIT_NP_START; | ||
| 261 | if (!is_realtime(current)) | 267 | if (!is_realtime(current)) |
| 262 | goto out; | 268 | goto out; |
| 263 | /* Let the plugin decide. The default callback will return -EPERM. | 269 | /* Let the plugin decide. The default callback will return -EPERM. |
| @@ -266,6 +272,8 @@ asmlinkage long sys_exit_np(void) | |||
| 266 | TRACE("exit_np(%s/%d) => %d and np=%d\n", | 272 | TRACE("exit_np(%s/%d) => %d and np=%d\n", |
| 267 | current->comm, current->pid, retval, is_np(current)); | 273 | current->comm, current->pid, retval, is_np(current)); |
| 268 | out: | 274 | out: |
| 275 | TS_EXIT_NP_END; | ||
| 276 | preempt_enable(); | ||
| 269 | return retval; | 277 | return retval; |
| 270 | } | 278 | } |
| 271 | 279 | ||
