mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Cc: peterz@infradead.org, acme@infradead.org, jolsa@kernel.org,
	rostedt@goodmis.org, mingo@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf_tools/sched: Remove nr_state_machine_bugs in perf latency.
Date: Mon, 19 May 2014 13:59:57 +0200	[thread overview]
Message-ID: <20140519115957.GF5027@krava.brq.redhat.com> (raw)
In-Reply-To: <1399945101-21736-1-git-send-email-yangds.fnst@cn.fujitsu.com>

any ACKs?

thanks,
jirka

On Tue, May 13, 2014 at 10:38:21AM +0900, Dongsheng Yang wrote:
> 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.
> 
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
> ---
>  tools/perf/builtin-sched.c | 19 ++++++++-----------
>  1 file changed, 8 insertions(+), 11 deletions(-)
> 
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index d3fb0ed..5b2fc62 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -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,
> -- 
> 1.8.2.1
> 

  parent reply	other threads:[~2014-05-19 12:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 18:19 perf,tools: Remove usage of trace_sched_wakeup(.success) Peter Zijlstra
2014-05-13  1:38 ` [PATCH] perf_tools/sched: Remove nr_state_machine_bugs in perf latency Dongsheng Yang
2014-05-13  1:42   ` Dongsheng Yang
2014-05-13 11:56     ` Jiri Olsa
2014-05-19 11:59   ` Jiri Olsa [this message]
2014-05-21  9:25     ` Peter Zijlstra
2014-05-21  5:54   ` [tip:perf/core] perf sched: " tip-bot for Dongsheng Yang
2014-05-13  7:22 ` perf,tools: Remove usage of trace_sched_wakeup(.success) Ingo Molnar
2014-05-13  6:34   ` Dongsheng Yang
2014-05-13 10:03     ` Peter Zijlstra
2014-05-13 10:10       ` Dongsheng Yang
2014-05-13 11:26         ` Peter Zijlstra
2014-05-13 17:14       ` Ingo Molnar
2014-05-13 17:30         ` Peter Zijlstra
2014-05-13 18:15           ` Peter Zijlstra
2014-05-13 10:00   ` Peter Zijlstra
2014-05-21  5:54 ` [tip:perf/core] perf tools: Remove usage of trace_sched_wakeup( .success) tip-bot for Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140519115957.GF5027@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@infradead.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=yangds.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome