Skip to contentSkip to conversation

perf,tools: Remove usage of trace_sched_wakeup(.success)

PATCH In review Peter Zijlstra 5 participants 17 messages May 12, 2014 – May 21, 2014

Subsystems (3)
lore
Share & tools
lore

Peter Zijlstra

author maintainer
#0 lore raw

trace_sched_wakeup(.success) is a dead argument and has been for ages, the only reason its still there is because of brain dead software, which apparently includes perf tools

There's a few more instances in pearly snake shit, but that's not supported as far as I care anyhow, so let that bitrot.

---
 tools/perf/builtin-sched.c        | 7 +------
 tools/perf/tests/evsel-tp-sched.c | 3 ---
 2 files changed, 1 insertion(+), 9 deletions(-)
tools/perf/builtin-sched.c +1 -6
index d3fb0ed7240a..ef33a2632abe 100644
@@ -1007,17 +1007,12 @@ static int latency_wakeup_event(struct perf_sched *sched,
 				struct perf_sample *sample,
 				struct machine *machine)
 {
-	const u32 pid	  = perf_evsel__intval(evsel, sample, "pid"),
-		  success = perf_evsel__intval(evsel, sample, "success");
+	const u32 pid	  = perf_evsel__intval(evsel, sample, "pid");
 	struct work_atoms *atoms;
 	struct work_atom *atom;
 	struct thread *wakee;
 	u64 timestamp = sample->time;
 
-	/* Note for later, it may be interesting to observe the failing cases */
-	if (!success)
-		return 0;
-
 	wakee = machine__findnew_thread(machine, 0, pid);
 	atoms = thread_atoms_search(&sched->atom_root, wakee, &sched->cmp_pid);
 	if (!atoms) {
tools/perf/tests/evsel-tp-sched.c +0 -3
index 4774f7fbb758..35d7fdb2328d 100644
@@ -74,9 +74,6 @@ int test__perf_evsel__tp_sched_test(void)
 	if (perf_evsel__test_field(evsel, "prio", 4, true))
 		ret = -1;
 
-	if (perf_evsel__test_field(evsel, "success", 4, true))
-		ret = -1;
-
 	if (perf_evsel__test_field(evsel, "target_cpu", 4, true))
 		ret = -1;
 
#1 lore raw

PATCH 1/1 perf_tools/sched: Remove nr_state_machine_bugs in perf latency.

As we do not use .success in sched_wakeup event any more, then we can not guarantee that the task when wakeup event happen is out of run queue. So the message of nr_state_machine_bugs is not correct.

---
 tools/perf/builtin-sched.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
tools/perf/builtin-sched.c +8 -11
index d3fb0ed..5b2fc62 100644
@@ -149,7 +149,6 @@ struct perf_sched {
 	unsigned long	 nr_runs;
 	unsigned long	 nr_timestamps;
 	unsigned long	 nr_unordered_timestamps;
-	unsigned long	 nr_state_machine_bugs;
 	unsigned long	 nr_context_switch_bugs;
 	unsigned long	 nr_events;
 	unsigned long	 nr_lost_chunks;
@@ -1037,12 +1036,18 @@ static int latency_wakeup_event(struct perf_sched *sched,
 	atom = list_entry(atoms->work_list.prev, struct work_atom, list);
 
 	/*
+	 * As we do not guarantee the wakeup event happens when
+	 * task is out of run queue, also may happen when task is
+	 * on run queue and wakeup only change ->state to TASK_RUNNING,
+	 * then we should not set the ->wake_up_time when wake up a
+	 * task which is on run queue. 
+	 *
 	 * You WILL be missing events if you've recorded only
 	 * one CPU, or are only looking at only one, so don't
-	 * make useless noise.
+	 * skip in this case.
 	 */
 	if (sched->profile_cpu == -1 && atom->state != THREAD_SLEEPING)
-		sched->nr_state_machine_bugs++;
+		return 0;
 
 	sched->nr_timestamps++;
 	if (atom->sched_out_time > timestamp) {
@@ -1496,14 +1501,6 @@ static void print_bad_events(struct perf_sched *sched)
 			(double)sched->nr_lost_events/(double)sched->nr_events * 100.0,
 			sched->nr_lost_events, sched->nr_events, sched->nr_lost_chunks);
 	}
-	if (sched->nr_state_machine_bugs && sched->nr_timestamps) {
-		printf("  INFO: %.3f%% state machine bugs (%ld out of %ld)",
-			(double)sched->nr_state_machine_bugs/(double)sched->nr_timestamps*100.0,
-			sched->nr_state_machine_bugs, sched->nr_timestamps);
-		if (sched->nr_lost_events)
-			printf(" (due to lost events?)");
-		printf("\n");
-	}
 	if (sched->nr_context_switch_bugs && sched->nr_timestamps) {
 		printf("  INFO: %.3f%% context switch bugs (%ld out of %ld)",
 			(double)sched->nr_context_switch_bugs/(double)sched->nr_timestamps*100.0,
Signature · 1 line
1.8.2.1
#2 lore raw

Re: [PATCH] perf_tools/sched: Remove nr_state_machine_bugs in perf latency.

Hi jiri or Arnaldo,
It seems Peter really do not like the usage of
sched_wakeup(.success), and
don't plan to support it in scheduler any more. Please consider to append this patch too when you take the patch from Peter. Thanx :)

Quoted 58 lines · Dongsheng Yang

As we do not use .success in sched_wakeup event any more, then we can not guarantee that the task when wakeup event happen is out of run queue. So the message of nr_state_machine_bugs is not correct.

---
  tools/perf/builtin-sched.c | 19 ++++++++-----------
  1 file changed, 8 insertions(+), 11 deletions(-)
tools/perf/builtin-sched.c +8 -11
index d3fb0ed..5b2fc62 100644
@@ -149,7 +149,6 @@ struct perf_sched {
  	unsigned long	 nr_runs;
  	unsigned long	 nr_timestamps;
  	unsigned long	 nr_unordered_timestamps;
-	unsigned long	 nr_state_machine_bugs;
  	unsigned long	 nr_context_switch_bugs;
  	unsigned long	 nr_events;
  	unsigned long	 nr_lost_chunks;
@@ -1037,12 +1036,18 @@ static int latency_wakeup_event(struct perf_sched *sched,
  	atom = list_entry(atoms->work_list.prev, struct work_atom, list);
 
  	/*
+	 * As we do not guarantee the wakeup event happens when
+	 * task is out of run queue, also may happen when task is
+	 * on run queue and wakeup only change ->state to TASK_RUNNING,
+	 * then we should not set the ->wake_up_time when wake up a
+	 * task which is on run queue.
+	 *
  	 * You WILL be missing events if you've recorded only
  	 * one CPU, or are only looking at only one, so don't
-	 * make useless noise.
+	 * skip in this case.
  	 */
  	if (sched->profile_cpu == -1 && atom->state != THREAD_SLEEPING)
-		sched->nr_state_machine_bugs++;
+		return 0;
 
  	sched->nr_timestamps++;
  	if (atom->sched_out_time > timestamp) {
@@ -1496,14 +1501,6 @@ static void print_bad_events(struct perf_sched *sched)
  			(double)sched->nr_lost_events/(double)sched->nr_events * 100.0,
  			sched->nr_lost_events, sched->nr_events, sched->nr_lost_chunks);
  	}
-	if (sched->nr_state_machine_bugs && sched->nr_timestamps) {
-		printf("  INFO: %.3f%% state machine bugs (%ld out of %ld)",
-			(double)sched->nr_state_machine_bugs/(double)sched->nr_timestamps*100.0,
-			sched->nr_state_machine_bugs, sched->nr_timestamps);
-		if (sched->nr_lost_events)
-			printf(" (due to lost events?)");
-		printf("\n");
-	}
  	if (sched->nr_context_switch_bugs && sched->nr_timestamps) {
  		printf("  INFO: %.3f%% context switch bugs (%ld out of %ld)",
  			(double)sched->nr_context_switch_bugs/(double)sched->nr_timestamps*100.0,
#3 lore raw

Re: [PATCH] perf_tools/sched: Remove nr_state_machine_bugs in perf latency.

Quoted 6 lines · Dongsheng Yang

Hi jiri or Arnaldo,
It seems Peter really do not like the usage of
sched_wakeup(.success), and
don't plan to support it in scheduler any more. Please consider to append this patch
too when you take the patch from Peter. Thanx :)

sure, any acks anyone? ;-)

thanks,
jirka

#4 lore raw

Re: [PATCH] perf_tools/sched: Remove nr_state_machine_bugs in perf latency.

In reply to Dongsheng Yang

any ACKs?

thanks,
jirka

Quoted 61 lines · Dongsheng Yang

As we do not use .success in sched_wakeup event any more, then we can not guarantee that the task when wakeup event happen is out of run queue. So the message of nr_state_machine_bugs is not correct.

---
 tools/perf/builtin-sched.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
tools/perf/builtin-sched.c +8 -11
index d3fb0ed..5b2fc62 100644
@@ -149,7 +149,6 @@ struct perf_sched {
 	unsigned long	 nr_runs;
 	unsigned long	 nr_timestamps;
 	unsigned long	 nr_unordered_timestamps;
-	unsigned long	 nr_state_machine_bugs;
 	unsigned long	 nr_context_switch_bugs;
 	unsigned long	 nr_events;
 	unsigned long	 nr_lost_chunks;
@@ -1037,12 +1036,18 @@ static int latency_wakeup_event(struct perf_sched *sched,
 	atom = list_entry(atoms->work_list.prev, struct work_atom, list);
 
 	/*
+	 * As we do not guarantee the wakeup event happens when
+	 * task is out of run queue, also may happen when task is
+	 * on run queue and wakeup only change ->state to TASK_RUNNING,
+	 * then we should not set the ->wake_up_time when wake up a
+	 * task which is on run queue. 
+	 *
 	 * You WILL be missing events if you've recorded only
 	 * one CPU, or are only looking at only one, so don't
-	 * make useless noise.
+	 * skip in this case.
 	 */
 	if (sched->profile_cpu == -1 && atom->state != THREAD_SLEEPING)
-		sched->nr_state_machine_bugs++;
+		return 0;
 
 	sched->nr_timestamps++;
 	if (atom->sched_out_time > timestamp) {
@@ -1496,14 +1501,6 @@ static void print_bad_events(struct perf_sched *sched)
 			(double)sched->nr_lost_events/(double)sched->nr_events * 100.0,
 			sched->nr_lost_events, sched->nr_events, sched->nr_lost_chunks);
 	}
-	if (sched->nr_state_machine_bugs && sched->nr_timestamps) {
-		printf("  INFO: %.3f%% state machine bugs (%ld out of %ld)",
-			(double)sched->nr_state_machine_bugs/(double)sched->nr_timestamps*100.0,
-			sched->nr_state_machine_bugs, sched->nr_timestamps);
-		if (sched->nr_lost_events)
-			printf(" (due to lost events?)");
-		printf("\n");
-	}
 	if (sched->nr_context_switch_bugs && sched->nr_timestamps) {
 		printf("  INFO: %.3f%% context switch bugs (%ld out of %ld)",
 			(double)sched->nr_context_switch_bugs/(double)sched->nr_timestamps*100.0,
Signature · 1 line
1.8.2.1
#6 lore raw

[tip:perf/core] perf sched: Remove nr_state_machine_bugs in perf latency

In reply to Dongsheng Yang
perf sched: Remove nr_state_machine_bugs in perf latency
Commit-ID:  67d6259dd021006ade25d67b045ad2089b5aba96
Gitweb:     http://git.kernel.org/tip/67d6259dd021006ade25d67b045ad2089b5aba96
Author:     Dongsheng Yang <[email protected]>
AuthorDate: Tue, 13 May 2014 10:38:21 +0900
Committer:  Jiri Olsa <[email protected]>
CommitDate: Fri, 16 May 2014 09:17:36 +0200

perf sched: Remove nr_state_machine_bugs in perf latency

As we do not use .success in sched_wakeup event any more, then we can not guarantee that the task when wakeup event happen is out of run queue. So the message of nr_state_machine_bugs is not correct.

---
 tools/perf/builtin-sched.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
tools/perf/builtin-sched.c +8 -11
index a3320f1..0b4fe53 100644
@@ -149,7 +149,6 @@ struct perf_sched {
 	unsigned long	 nr_runs;
 	unsigned long	 nr_timestamps;
 	unsigned long	 nr_unordered_timestamps;
-	unsigned long	 nr_state_machine_bugs;
 	unsigned long	 nr_context_switch_bugs;
 	unsigned long	 nr_events;
 	unsigned long	 nr_lost_chunks;
@@ -1032,12 +1031,18 @@ static int latency_wakeup_event(struct perf_sched *sched,
 	atom = list_entry(atoms->work_list.prev, struct work_atom, list);
 
 	/*
+	 * As we do not guarantee the wakeup event happens when
+	 * task is out of run queue, also may happen when task is
+	 * on run queue and wakeup only change ->state to TASK_RUNNING,
+	 * then we should not set the ->wake_up_time when wake up a
+	 * task which is on run queue.
+	 *
 	 * You WILL be missing events if you've recorded only
 	 * one CPU, or are only looking at only one, so don't
-	 * make useless noise.
+	 * skip in this case.
 	 */
 	if (sched->profile_cpu == -1 && atom->state != THREAD_SLEEPING)
-		sched->nr_state_machine_bugs++;
+		return 0;
 
 	sched->nr_timestamps++;
 	if (atom->sched_out_time > timestamp) {
@@ -1496,14 +1501,6 @@ static void print_bad_events(struct perf_sched *sched)
 			(double)sched->nr_lost_events/(double)sched->nr_events * 100.0,
 			sched->nr_lost_events, sched->nr_events, sched->nr_lost_chunks);
 	}
-	if (sched->nr_state_machine_bugs && sched->nr_timestamps) {
-		printf("  INFO: %.3f%% state machine bugs (%ld out of %ld)",
-			(double)sched->nr_state_machine_bugs/(double)sched->nr_timestamps*100.0,
-			sched->nr_state_machine_bugs, sched->nr_timestamps);
-		if (sched->nr_lost_events)
-			printf(" (due to lost events?)");
-		printf("\n");
-	}
 	if (sched->nr_context_switch_bugs && sched->nr_timestamps) {
 		printf("  INFO: %.3f%% context switch bugs (%ld out of %ld)",
 			(double)sched->nr_context_switch_bugs/(double)sched->nr_timestamps*100.0,
#8 lore raw
Quoted 4 lines · Ingo Molnar
Quoted 1 line · Peter Zijlstra

trace_sched_wakeup(.success) is a dead argument and has been for ages,

Always 0, or random value?

Hi Ingo,

It is always 1 currently.

Peter believe that .success is not useful and I pointed that perf sched latency is using it now. Then he post this patch to remove the usage here.

Please go to the following link for more about this issue.

https://lkml.org/lkml/2014/5/12/77

Thanx :)

Quoted 10 lines

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

author maintainer
#9 lore raw
Quoted 8 lines · Dongsheng Yang
Quoted 4 lines · Ingo Molnar
Quoted 1 line · Peter Zijlstra

trace_sched_wakeup(.success) is a dead argument and has been for ages,

Always 0, or random value?

Hi Ingo,

Quoted 7 lines

It is always 1 currently.

Peter believe that .success is not useful and I pointed that perf sched latency
is using it now. Then he post this patch to remove the usage here.

Please go to the following link for more about this issue.

It is _not_ usable. You're proposing to abuse the existing parameter. A wakeup doing an enqueue or not has nothing _WHAT_SO_EVER_ to do with success.

Now what I think you wanted to do is make it easier to match trace_sched_switch() statements with trace_sched_wakeup() statements. And since you only get the trace_sched_switch() on dequeue, you want to know which trace_sched_wakeup() calls did an enqueue.

But that's completely and utterly unrelated to success.

#10 lore raw
Quoted 15 lines · Peter Zijlstra
Quoted 7 lines · Dongsheng Yang
Quoted 4 lines · Ingo Molnar
Quoted 1 line · Peter Zijlstra

trace_sched_wakeup(.success) is a dead argument and has been for ages,

Always 0, or random value?

Hi Ingo,

Quoted 7 lines

It is always 1 currently.

Peter believe that .success is not useful and I pointed that perf sched latency
is using it now. Then he post this patch to remove the usage here.

Please go to the following link for more about this issue.

Quoted 8 lines

It is _not_ usable. You're proposing to abuse the existing parameter. A wakeup doing an enqueue or not has nothing _WHAT_SO_EVER_ to do with success.

Now what I think you wanted to do is make it easier to match trace_sched_switch() statements with trace_sched_wakeup() statements. And since you only get the trace_sched_switch() on dequeue, you want to know which trace_sched_wakeup() calls did an enqueue.

Ha, yes, indeed. In perf sched latency, we need to know the timestamp when a task enqueue and then we can calculate the delay time. So I want to take the use of success parameter in trace_sched_wakeup() to indicate that *this* wakeup did an enqueue.

But now I think it is okey if you really mind adding more tracepoints in scheduler. And I posted a patch after your patch in this thread to make perf sched latency work well.

Quoted 2 lines

But that's completely and utterly unrelated to success.

author maintainer
#11 lore raw
Quoted 7 lines · Dongsheng Yang
Quoted 4 lines · Peter Zijlstra

Now what I think you wanted to do is make it easier to match trace_sched_switch() statements with trace_sched_wakeup() statements. And since you only get the trace_sched_switch() on dequeue, you want to know which trace_sched_wakeup() calls did an enqueue.

Quoted 8 lines

Ha, yes, indeed. In perf sched latency, we need to know the timestamp when a task enqueue and then we can calculate the delay time. So I want to take the use of success parameter in trace_sched_wakeup() to indicate that *this* wakeup did an enqueue.

But now I think it is okey if you really mind adding more tracepoints in scheduler. And I posted a patch after your patch in this thread to make perf sched latency work well.

I don't mind adding them per-se, as long as there's a reasonable effort showing it doesn't slow down the wakeup-path.

#12 lore raw
In reply to Peter Zijlstra
Quoted 21 lines · Peter Zijlstra
Quoted 8 lines · Dongsheng Yang
Quoted 4 lines · Ingo Molnar
Quoted 1 line · Peter Zijlstra

trace_sched_wakeup(.success) is a dead argument and has been for ages,

Always 0, or random value?

Hi Ingo,

Quoted 7 lines

It is always 1 currently.

Peter believe that .success is not useful and I pointed that perf sched latency is using it now. Then he post this patch to remove the usage here.

Please go to the following link for more about this issue.

It is _not_ usable. You're proposing to abuse the existing parameter. A wakeup doing an enqueue or not has nothing _WHAT_SO_EVER_ to do with success.

Quoted 7 lines

Now what I think you wanted to do is make it easier to match trace_sched_switch() statements with trace_sched_wakeup() statements. And since you only get the trace_sched_switch() on dequeue, you want to know which trace_sched_wakeup() calls did an enqueue.

But that's completely and utterly unrelated to success.

So I always considered it 'the enqueue was successful' - that's I think why I added it to 'perf sched' originally - to be able to trace wakeups from originator to target.

Thans,

Ingo

author maintainer
#13 lore raw
Quoted 30 lines · Ingo Molnar
Quoted 27 lines · Peter Zijlstra
Quoted 8 lines · Dongsheng Yang
Quoted 4 lines · Ingo Molnar
Quoted 1 line · Peter Zijlstra

trace_sched_wakeup(.success) is a dead argument and has been for ages,

Always 0, or random value?

Hi Ingo,

Quoted 7 lines

It is always 1 currently.

Peter believe that .success is not useful and I pointed that perf sched latency is using it now. Then he post this patch to remove the usage here.

Please go to the following link for more about this issue.

It is _not_ usable. You're proposing to abuse the existing parameter. A wakeup doing an enqueue or not has nothing _WHAT_SO_EVER_ to do with success.

Now what I think you wanted to do is make it easier to match trace_sched_switch() statements with trace_sched_wakeup() statements. And since you only get the trace_sched_switch() on dequeue, you want to know which trace_sched_wakeup() calls did an enqueue.

Quoted 5 lines
Quoted 1 line

But that's completely and utterly unrelated to success.

So I always considered it 'the enqueue was successful' - that's I think why I added it to 'perf sched' originally - to be able to trace wakeups from originator to target.

So back when it still sometimes returned 0 it was the try_to_wake_up() return value, it still is, except when we re factored ttwu we moved the tracepoint such that its not on the 0 return path.

I would've removed it then, except I couldn't because some crap userspace was using it -- and that's the only reason its still in there, its been a pointless rudiment for years.

Anyway, the return value is true if it (potentially) did an actual wakeup, and that is unrelated to having done an enqueue.

And in general you want wakeups to happen before we do the dequeue, as the enqueue-less wakeups are _way_ faster. I've tried optimistic yield(), but since not all schedule() site can deal with spurious wakeups that fell flat :/

author maintainer
#14 lore raw

Anyway, ideally we'd do something like the below, except of course that it'll break userspace :-(

And that is why I loathe tracepoints.

Also, I've not looked at the code difference and or performance implications.

---
Subject: sched: Add enqueue information to trace_sched_wakeup()

trace_sched_switch() shows task dequeues, trace_sched_wakeup() shows all wakeups, including those that do not enqueue (because the task is still enqueued).

In order to easy matching dequeue to enqueue, add enqueue information to trace_sched_wakeup().

Replace the trace_sched_wakeup() success argument which is the try_to_wake_up() return value and always true (since we removed tracing the false path).

---
 include/trace/events/sched.h | 16 ++++++++--------
 kernel/sched/core.c          | 42 ++++++++++++++++++++++--------------------
 kernel/sched/sched.h         |  3 ++-
 3 files changed, 32 insertions(+), 29 deletions(-)
include/trace/events/sched.h +8 -8
index 67e1bbf83695..5e5037f794f2 100644
@@ -55,15 +55,15 @@ TRACE_EVENT(sched_kthread_stop_ret,
  */
 DECLARE_EVENT_CLASS(sched_wakeup_template,
 
-	TP_PROTO(struct task_struct *p, int success),
+	TP_PROTO(struct task_struct *p, int enqueue),
 
-	TP_ARGS(__perf_task(p), success),
+	TP_ARGS(__perf_task(p), enqueue),
 
 	TP_STRUCT__entry(
 		__array(	char,	comm,	TASK_COMM_LEN	)
 		__field(	pid_t,	pid			)
 		__field(	int,	prio			)
-		__field(	int,	success			)
+		__field(	int,	enqueue			)
 		__field(	int,	target_cpu		)
 	),
 
@@ -71,24 +71,24 @@ DECLARE_EVENT_CLASS(sched_wakeup_template,
 		memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
 		__entry->pid		= p->pid;
 		__entry->prio		= p->prio;
-		__entry->success	= success;
+		__entry->enqueue	= enqueue;
 		__entry->target_cpu	= task_cpu(p);
 	),
 
-	TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d",
+	TP_printk("comm=%s pid=%d prio=%d enqueue=%d target_cpu=%03d",
 		  __entry->comm, __entry->pid, __entry->prio,
-		  __entry->success, __entry->target_cpu)
+		  __entry->enqueue, __entry->target_cpu)
 );
 
 DEFINE_EVENT(sched_wakeup_template, sched_wakeup,
-	     TP_PROTO(struct task_struct *p, int success),
+	     TP_PROTO(struct task_struct *p, int enqueue),
 	     TP_ARGS(p, success));
 
 /*
  * Tracepoint for waking up a new task:
  */
 DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new,
-	     TP_PROTO(struct task_struct *p, int success),
+	     TP_PROTO(struct task_struct *p, int enqueue),
 	     TP_ARGS(p, success));
 
 #ifdef CREATE_TRACE_POINTS
kernel/sched/core.c +22 -20

81 lines not on this page · raw message

kernel/sched/sched.h +2 -1
index b2cbe81308af..d865415ea1d2 100644
@@ -1026,7 +1026,8 @@ static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev)
  */
 #define WF_SYNC		0x01		/* waker goes to sleep after wakeup */
 #define WF_FORK		0x02		/* child wakeup after fork */
-#define WF_MIGRATED	0x4		/* internal use, task got migrated */
+#define WF_MIGRATED	0x04		/* internal use, task got migrated */
+#define WF_ENQUEUE	0x08
 
 /*
  * To aid in avoiding the subversion of "niceness" due to uneven distribution
author maintainer
#15 lore raw
In reply to Ingo Molnar
Quoted 6 lines · Ingo Molnar
Quoted 1 line · Peter Zijlstra

trace_sched_wakeup(.success) is a dead argument and has been for ages,

Always 0, or random value?

always true, we couldn't remove it because it would break userspace :-(

#16 lore raw

[tip:perf/core] perf tools: Remove usage of trace_sched_wakeup( .success)

In reply to Peter Zijlstra
perf tools: Remove usage of trace_sched_wakeup(.success)
Commit-ID:  0680ee7db16de9c02d1d4b1a935a5daf754fe8a1
Gitweb:     http://git.kernel.org/tip/0680ee7db16de9c02d1d4b1a935a5daf754fe8a1
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Mon, 12 May 2014 20:19:46 +0200
Committer:  Jiri Olsa <[email protected]>
CommitDate: Mon, 12 May 2014 21:13:44 +0200

perf tools: Remove usage of trace_sched_wakeup(.success)

trace_sched_wakeup(.success) is a dead argument and has been for ages, the only reason its still there is because of brain dead software, which apparently includes perf tools

There's a few more instances in pearly snake shit, but that's not supported as far as I care anyhow, so let that bitrot.

---
 tools/perf/builtin-sched.c        | 7 +------
 tools/perf/tests/evsel-tp-sched.c | 3 ---
 2 files changed, 1 insertion(+), 9 deletions(-)
tools/perf/builtin-sched.c +1 -6
index 2579215..a3320f1 100644
@@ -1007,17 +1007,12 @@ static int latency_wakeup_event(struct perf_sched *sched,
 				struct perf_sample *sample,
 				struct machine *machine)
 {
-	const u32 pid	  = perf_evsel__intval(evsel, sample, "pid"),
-		  success = perf_evsel__intval(evsel, sample, "success");
+	const u32 pid	  = perf_evsel__intval(evsel, sample, "pid");
 	struct work_atoms *atoms;
 	struct work_atom *atom;
 	struct thread *wakee;
 	u64 timestamp = sample->time;
 
-	/* Note for later, it may be interesting to observe the failing cases */
-	if (!success)
-		return 0;
-
 	wakee = machine__findnew_thread(machine, 0, pid);
 	atoms = thread_atoms_search(&sched->atom_root, wakee, &sched->cmp_pid);
 	if (!atoms) {
tools/perf/tests/evsel-tp-sched.c +0 -3
index 4774f7f..35d7fdb 100644
@@ -74,9 +74,6 @@ int test__perf_evsel__tp_sched_test(void)
 	if (perf_evsel__test_field(evsel, "prio", 4, true))
 		ret = -1;
 
-	if (perf_evsel__test_field(evsel, "success", 4, true))
-		ret = -1;
-
 	if (perf_evsel__test_field(evsel, "target_cpu", 4, true))
 		ret = -1;