Skip to content

Commit b91473f

Browse files
Peter ZijlstraKAGA-KOKO
Peter Zijlstra
authored andcommitted
sched,tracing: Update trace_sched_pi_setprio()
Pass the PI donor task, instead of a numerical priority. Numerical priorities are not sufficient to describe state ever since SCHED_DEADLINE. Annotate all sched tracepoints that are currently broken; fixing them will bork userspace. *hate*. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Steven Rostedt <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
1 parent acd5862 commit b91473f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

include/trace/events/sched.h

+9-7
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ DECLARE_EVENT_CLASS(sched_wakeup_template,
7070
TP_fast_assign(
7171
memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
7272
__entry->pid = p->pid;
73-
__entry->prio = p->prio;
73+
__entry->prio = p->prio; /* XXX SCHED_DEADLINE */
7474
__entry->success = 1; /* rudiment, kill when possible */
7575
__entry->target_cpu = task_cpu(p);
7676
),
@@ -147,6 +147,7 @@ TRACE_EVENT(sched_switch,
147147
memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
148148
__entry->next_pid = next->pid;
149149
__entry->next_prio = next->prio;
150+
/* XXX SCHED_DEADLINE */
150151
),
151152

152153
TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s%s ==> next_comm=%s next_pid=%d next_prio=%d",
@@ -181,7 +182,7 @@ TRACE_EVENT(sched_migrate_task,
181182
TP_fast_assign(
182183
memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
183184
__entry->pid = p->pid;
184-
__entry->prio = p->prio;
185+
__entry->prio = p->prio; /* XXX SCHED_DEADLINE */
185186
__entry->orig_cpu = task_cpu(p);
186187
__entry->dest_cpu = dest_cpu;
187188
),
@@ -206,7 +207,7 @@ DECLARE_EVENT_CLASS(sched_process_template,
206207
TP_fast_assign(
207208
memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
208209
__entry->pid = p->pid;
209-
__entry->prio = p->prio;
210+
__entry->prio = p->prio; /* XXX SCHED_DEADLINE */
210211
),
211212

212213
TP_printk("comm=%s pid=%d prio=%d",
@@ -253,7 +254,7 @@ TRACE_EVENT(sched_process_wait,
253254
TP_fast_assign(
254255
memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
255256
__entry->pid = pid_nr(pid);
256-
__entry->prio = current->prio;
257+
__entry->prio = current->prio; /* XXX SCHED_DEADLINE */
257258
),
258259

259260
TP_printk("comm=%s pid=%d prio=%d",
@@ -413,9 +414,9 @@ DEFINE_EVENT(sched_stat_runtime, sched_stat_runtime,
413414
*/
414415
TRACE_EVENT(sched_pi_setprio,
415416

416-
TP_PROTO(struct task_struct *tsk, int newprio),
417+
TP_PROTO(struct task_struct *tsk, struct task_struct *pi_task),
417418

418-
TP_ARGS(tsk, newprio),
419+
TP_ARGS(tsk, pi_task),
419420

420421
TP_STRUCT__entry(
421422
__array( char, comm, TASK_COMM_LEN )
@@ -428,7 +429,8 @@ TRACE_EVENT(sched_pi_setprio,
428429
memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
429430
__entry->pid = tsk->pid;
430431
__entry->oldprio = tsk->prio;
431-
__entry->newprio = newprio;
432+
__entry->newprio = pi_task ? pi_task->prio : tsk->prio;
433+
/* XXX SCHED_DEADLINE bits missing */
432434
),
433435

434436
TP_printk("comm=%s pid=%d oldprio=%d newprio=%d",

kernel/sched/core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3752,7 +3752,7 @@ void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task)
37523752
goto out_unlock;
37533753
}
37543754

3755-
trace_sched_pi_setprio(p, prio); /* broken */
3755+
trace_sched_pi_setprio(p, pi_task);
37563756
oldprio = p->prio;
37573757

37583758
if (oldprio == prio)

0 commit comments

Comments
 (0)