| 1 |
#! stap -p4 |
| 2 |
|
| 3 |
# Normally we don't test "internal" probes (ones starting with '__'), |
| 4 |
# but let's make sure the kprobes-based fallback probes for |
| 5 |
# tracepoint-based probes actually work. So, we'll test the *.kp |
| 6 |
# probes. |
| 7 |
|
| 8 |
# scheduler.cpu_off test moved to scheduler-cpu_off.stp |
| 9 |
|
| 10 |
# scheduler.cpu_on test moved to scheduler-cpu_on.stp |
| 11 |
|
| 12 |
probe scheduler.tick |
| 13 |
{ |
| 14 |
printf("%s: %d\n", name, idle) |
| 15 |
} |
| 16 |
|
| 17 |
probe scheduler.balance ? |
| 18 |
{ |
| 19 |
printf("%s\n", name) |
| 20 |
} |
| 21 |
|
| 22 |
# scheduler.ctxswitch/__scheduler.ctxswitch.kp tests moved to |
| 23 |
# scheduler-ctxswitch.stp |
| 24 |
|
| 25 |
probe scheduler.kthread_stop |
| 26 |
{ |
| 27 |
printf("%s\n", name) |
| 28 |
printf("pid = %d, priority = %d\n", thread_pid, thread_priority) |
| 29 |
} |
| 30 |
probe __scheduler.kthread_stop.kp |
| 31 |
{ |
| 32 |
printf("pid = %d, priority = %d\n", thread_pid, thread_priority) |
| 33 |
} |
| 34 |
|
| 35 |
probe scheduler.kthread_stop.return |
| 36 |
{ |
| 37 |
printf("%s\n", name) |
| 38 |
printf("return value = %d\n", return_value) |
| 39 |
} |
| 40 |
probe __scheduler.kthread_stop.return.kp |
| 41 |
{ |
| 42 |
printf("return value = %d\n", return_value) |
| 43 |
} |
| 44 |
|
| 45 |
probe scheduler.wait_task ? |
| 46 |
{ |
| 47 |
printf("%s\n", name) |
| 48 |
printf("pid = %d, priority = %d\n", task_pid, task_priority) |
| 49 |
} |
| 50 |
|
| 51 |
probe scheduler.wakeup |
| 52 |
{ |
| 53 |
printf("%s\n", name) |
| 54 |
printf("pid = %d, priority = %d\n, state = %d, cpu = %d, tid = %d\n", |
| 55 |
task_pid, task_priority, task_state, task_cpu, task_tid) |
| 56 |
printf("task = %p\n", task) |
| 57 |
} |
| 58 |
|
| 59 |
probe scheduler.wakeup_new |
| 60 |
{ |
| 61 |
printf("%s\n", name) |
| 62 |
printf("pid = %d, priority = %d, state = %d, cpu = %d, tid = %d\n", |
| 63 |
task_pid, task_priority, task_state, task_cpu, task_tid) |
| 64 |
printf("task = %p\n", task) |
| 65 |
} |
| 66 |
|
| 67 |
# scheduler.migrate/__scheduler.migrate.kp tests moved to |
| 68 |
# scheduler-migrate.stp |
| 69 |
|
| 70 |
probe scheduler.process_free, scheduler.process_exit |
| 71 |
{ |
| 72 |
printf("%s\n", name) |
| 73 |
printf("pid = %d, priority = %d\n", pid, priority) |
| 74 |
} |
| 75 |
probe __scheduler.process_free.kp, __scheduler.process_exit.kp |
| 76 |
{ |
| 77 |
printf("pid = %d, priority = %d\n", pid, priority) |
| 78 |
} |
| 79 |
|
| 80 |
probe scheduler.process_wait |
| 81 |
{ |
| 82 |
printf("%s\n", name) |
| 83 |
printf("pid = %d\n", pid) |
| 84 |
} |
| 85 |
probe __scheduler.process_wait.kp |
| 86 |
{ |
| 87 |
printf("pid = %d\n", pid) |
| 88 |
} |
| 89 |
|
| 90 |
probe scheduler.process_fork |
| 91 |
{ |
| 92 |
printf("%s\n", name) |
| 93 |
printf("parent_pid = %d, child_pid = %d\n", parent_pid, child_pid) |
| 94 |
} |
| 95 |
probe __scheduler.process_fork.kp |
| 96 |
{ |
| 97 |
printf("parent_pid = %d, child_pid = %d\n", parent_pid, child_pid) |
| 98 |
} |
| 99 |
|
| 100 |
probe scheduler.signal_send |
| 101 |
{ |
| 102 |
printf("%s\n", name) |
| 103 |
printf("pid = %d, signal_number = %d\n", pid, signal_number) |
| 104 |
} |
| 105 |
probe __scheduler.signal_send.kp |
| 106 |
{ |
| 107 |
printf("pid = %d\n", pid) |
| 108 |
} |