diff options
Diffstat (limited to 'meta/recipes-kernel/systemtap/systemtap/scheduler-stp.patch')
-rw-r--r-- | meta/recipes-kernel/systemtap/systemtap/scheduler-stp.patch | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap/scheduler-stp.patch b/meta/recipes-kernel/systemtap/systemtap/scheduler-stp.patch new file mode 100644 index 0000000000..9897e481a3 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/scheduler-stp.patch | |||
@@ -0,0 +1,109 @@ | |||
1 | scheduler.stp: Handle missing symbols. | ||
2 | |||
3 | Compiler output code optimization leads to missing debug data for some | ||
4 | target variables, in particular some inline functions parameters, e.g. | ||
5 | context_switch. | ||
6 | |||
7 | Handle this by testing for variable name resolvability and provide default | ||
8 | variable values in case no suitable target data is available through variable | ||
9 | name. Affected functions: ctxswitch,wakeup. | ||
10 | |||
11 | This fix does not affect the intended context switch tracing. | ||
12 | |||
13 | |||
14 | Upstream-Status: Pending | ||
15 | |||
16 | Signed-off-by: George Nita <george.nita@enea.com> | ||
17 | |||
18 | |||
19 | diff --git a/tapset/linux/scheduler.stp b/tapset/linux/scheduler.stp | ||
20 | index 7596a46..539a0f1 100644 | ||
21 | --- a/tapset/linux/scheduler.stp | ||
22 | +++ b/tapset/linux/scheduler.stp | ||
23 | @@ -120,7 +120,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, | ||
24 | %( arch != "x86_64" && arch != "ia64" && arch != "arm" %? | ||
25 | kernel.function("__switch_to") | ||
26 | %: | ||
27 | - kernel.function("context_switch") | ||
28 | + kernel.function("prepare_task_switch") | ||
29 | %) | ||
30 | { | ||
31 | name = "ctxswitch" | ||
32 | @@ -140,7 +140,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, | ||
33 | prev_task_name = task_execname($prev_p) | ||
34 | prevtsk_state = $prev_p->state | ||
35 | } | ||
36 | - else { | ||
37 | + else if (@defined($prev)) { | ||
38 | prev_priority = $prev->prio | ||
39 | prev_pid = $prev->tgid | ||
40 | prev_tid = $prev->pid | ||
41 | @@ -148,6 +148,15 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, | ||
42 | prev_task_name = task_execname($prev) | ||
43 | prevtsk_state = $prev->state | ||
44 | } | ||
45 | + else { | ||
46 | + prev_priority = 0 | ||
47 | + prev_pid = 0 | ||
48 | + prev_tid = 0 | ||
49 | + /* No prev_task, dummy */ | ||
50 | + prev_task = task_current() | ||
51 | + prev_task_name = "UNAVAILABLE" | ||
52 | + prevtsk_state = 0 | ||
53 | + } | ||
54 | |||
55 | if (@defined($next)) { | ||
56 | next_priority = $next->prio | ||
57 | @@ -165,7 +174,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, | ||
58 | next_task_name = task_execname($next_p) | ||
59 | nexttsk_state = $next_p->state | ||
60 | } | ||
61 | - else { | ||
62 | + else if (@defined($new)) { | ||
63 | next_priority = $new->prio | ||
64 | next_pid = $new->tgid | ||
65 | next_tid = $new->pid | ||
66 | @@ -173,6 +182,14 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, | ||
67 | next_task_name = task_execname($new) | ||
68 | nexttsk_state = $new->state | ||
69 | } | ||
70 | + else { | ||
71 | + next_task = task_current() | ||
72 | + next_priority = task_prio(next_task) | ||
73 | + next_pid = task_pid(next_task) | ||
74 | + next_tid = task_tid(next_task) | ||
75 | + next_task_name = task_execname(next_task) | ||
76 | + nexttsk_state = task_state(next_task) | ||
77 | + } | ||
78 | } | ||
79 | |||
80 | |||
81 | @@ -254,12 +271,22 @@ probe scheduler.wakeup = | ||
82 | kernel.function("try_to_wake_up") | ||
83 | { | ||
84 | name = "wakeup" | ||
85 | - task = $p | ||
86 | - task_pid = $p->tgid | ||
87 | - task_tid = $p->pid | ||
88 | - task_priority = $p->prio | ||
89 | - task_cpu = task_cpu($p) | ||
90 | - task_state = task_state($p) | ||
91 | + if (@defined($p)) { | ||
92 | + task = $p | ||
93 | + task_pid = $p->tgid | ||
94 | + task_tid = $p->pid | ||
95 | + task_priority = $p->prio | ||
96 | + task_cpu = task_cpu($p) | ||
97 | + task_state = task_state($p) | ||
98 | + } | ||
99 | + else { | ||
100 | + task = task_current() | ||
101 | + task_pid = task_pid(task) | ||
102 | + task_tid = task_tid(task) | ||
103 | + task_priority = task_prio(task) | ||
104 | + task_cpu = task_cpu(task) | ||
105 | + task_state = task_state(task) | ||
106 | + } | ||
107 | } | ||
108 | |||
109 | /** | ||