--- include/linux/logdev_marker.h | 2 ++ kernel/logdev/logdev_tracers.c | 27 +++++++++++++++++++++++++++ kernel/posix-timers.c | 3 +++ 3 files changed, 32 insertions(+) Index: linux-2.6.21.5-rt20/include/linux/logdev_marker.h =================================================================== --- linux-2.6.21.5-rt20.orig/include/linux/logdev_marker.h 2007-07-13 16:44:28.000000000 +0200 +++ linux-2.6.21.5-rt20/include/linux/logdev_marker.h 2007-07-13 16:47:35.000000000 +0200 @@ -56,6 +56,8 @@ void LDCALLER(context_switch) (struct task_struct *prev, struct task_struct *next); +void LDCALLER(sys_clock_getres) (const clockid_t which_clock); + #endif /* CONFIG_LOGDEV_TRACING */ Index: linux-2.6.21.5-rt20/kernel/logdev/logdev_tracers.c =================================================================== --- linux-2.6.21.5-rt20.orig/kernel/logdev/logdev_tracers.c 2007-07-13 16:44:40.000000000 +0200 +++ linux-2.6.21.5-rt20/kernel/logdev/logdev_tracers.c 2007-07-13 17:16:23.000000000 +0200 @@ -41,6 +41,7 @@ struct logdev_mark_hdr { #define LOGMARK_E_ID(x) ((LOGMARK_EXAMPLE_ID << 16)|(x)) #define LOGMARK_CNTXTSW LOGMARK_E_ID(1) +#define LOGMARK_GETRES LOGMARK_E_ID(3) struct logdev_mark_switch { struct logdev_mark_hdr hdr; @@ -59,6 +60,12 @@ struct logdev_mark_switch { char next_comm[TASK_COMM_LEN]; }; +struct logdev_mark_getres { + struct logdev_mark_hdr hdr; + short pid; + clockid_t clock; + char comm[TASK_COMM_LEN]; +}; /* ---------------- end of user space custom headers ---------------- */ @@ -169,6 +176,26 @@ void __kprobes LDCALLER(context_switch) &lm, sizeof(lm), NULL); } +void LDCALLER(sys_clock_getres) (const clockid_t which_clock) +{ + struct logdev_mark_getres lm; + + /* Filter on task */ + if (strncmp(current->comm, "sched_football", 14) != 0) + return; + + + logmark_hdr(&lm.hdr, LOGMARK_GETRES); + lm.pid = current->pid; + lm.clock = which_clock; + memcpy(lm.comm, current->comm, TASK_COMM_LEN); + + logdev_record(LOGMARK_ID_MARK, sizeof(lm), + &lm, sizeof(lm), NULL); +} + + + static int __init logdev_tracer_init(void) { logdev_register_callback(LOGMARK_ID_MARK, logdev_mark_callback); Index: linux-2.6.21.5-rt20/kernel/posix-timers.c =================================================================== --- linux-2.6.21.5-rt20.orig/kernel/posix-timers.c 2007-07-13 16:44:12.000000000 +0200 +++ linux-2.6.21.5-rt20/kernel/posix-timers.c 2007-07-13 16:46:33.000000000 +0200 @@ -48,6 +48,7 @@ #include #include #include +#include /* * Management arrays for POSIX timers. Timers are kept in slab memory @@ -964,6 +965,8 @@ sys_clock_getres(const clockid_t which_c struct timespec rtn_tp; int error; + LD_MARK1(sys_clock_getres, which_clock); + if (invalid_clockid(which_clock)) return -EINVAL;