lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 Sep 2012 10:04:43 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Arnaldo Carvalho de Melo <acme@...radead.org>
Cc:	Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Jiri Olsa <jolsa@...hat.com>, Mike Galbraith <efault@....de>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 15/18] perf sched: Use perf_tool as ancestor

On Tue, 11 Sep 2012 20:53:07 -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@...hat.com>
>
> So that we can remove all the globals.
>
> Before:
>
>    text	   data	    bss	    dec	    hex	filename
> 1586833	 110368	1438600	3135801	 2fd939	/tmp/oldperf
>
> After:
>
>    text	   data	    bss	    dec	    hex	filename
> 1629329	  93568	 848328	2571225	 273bd9	/root/bin/perf
>

Just a nitpick below.

[snip]
> -static void print_bad_events(void)
> +static void print_bad_events(struct perf_sched *sched)
>  {
> -	if (nr_unordered_timestamps && nr_timestamps) {
> +	if (sched->nr_unordered_timestamps && sched->nr_timestamps) {
>  		printf("  INFO: %.3f%% unordered timestamps (%ld out of %ld)\n",
> -			(double)nr_unordered_timestamps/(double)nr_timestamps*100.0,
> -			nr_unordered_timestamps, nr_timestamps);
> +			(double)sched->nr_unordered_timestamps/(double)sched->nr_timestamps*100.0,

Isn't it sufficient to use this?

			100.0 * sched->nr_unordered_timestamps / sched->nr_timestamps;

Ditto for belows.

Thanks,
Namhyung


> +			sched->nr_unordered_timestamps, sched->nr_timestamps);
>  	}
> -	if (nr_lost_events && nr_events) {
> +	if (sched->nr_lost_events && sched->nr_events) {
>  		printf("  INFO: %.3f%% lost events (%ld out of %ld, in %ld chunks)\n",
> -			(double)nr_lost_events/(double)nr_events*100.0,
> -			nr_lost_events, nr_events, nr_lost_chunks);
> +			(double)sched->nr_lost_events/(double)sched->nr_events * 100.0,
> +			sched->nr_lost_events, sched->nr_events, sched->nr_lost_chunks);
>  	}
> -	if (nr_state_machine_bugs && nr_timestamps) {
> +	if (sched->nr_state_machine_bugs && sched->nr_timestamps) {
>  		printf("  INFO: %.3f%% state machine bugs (%ld out of %ld)",
> -			(double)nr_state_machine_bugs/(double)nr_timestamps*100.0,
> -			nr_state_machine_bugs, nr_timestamps);
> -		if (nr_lost_events)
> +			(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 (nr_context_switch_bugs && nr_timestamps) {
> +	if (sched->nr_context_switch_bugs && sched->nr_timestamps) {
>  		printf("  INFO: %.3f%% context switch bugs (%ld out of %ld)",
> -			(double)nr_context_switch_bugs/(double)nr_timestamps*100.0,
> -			nr_context_switch_bugs, nr_timestamps);
> -		if (nr_lost_events)
> +			(double)sched->nr_context_switch_bugs/(double)sched->nr_timestamps*100.0,
> +			sched->nr_context_switch_bugs, sched->nr_timestamps);
> +		if (sched->nr_lost_events)
>  			printf(" (due to lost events?)");
>  		printf("\n");
>  	}
>  }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ