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:	Tue, 25 Jun 2013 11:07:36 -0600
From:	David Ahern <dsahern@...il.com>
To:	Jiri Olsa <jolsa@...hat.com>
CC:	linux-kernel@...r.kernel.org,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	Namhyung Kim <namhyung@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Andi Kleen <ak@...ux.intel.com>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 5/5] perf tools: Fix perf_session__delete removal for
 report command

On 6/25/13 5:54 AM, Jiri Olsa wrote:
> There's no point of having out_delete label with perf_session__delete
> call within __cmd_report function, because it's called at the
> end of the cmd_report function.

Is convenient to have a single return point for a function. Perhaps 
change the label to just out and remove the comment?

David

>
> The speed up due to commenting out the perf_session__delete
> at the end does not seem relevant anymore. Measured speedup
> for ~1GB data file with 222466 FORKS events is around 0.5%.
>
>    $ perf report -i perf.data.delete -P perf_session__delete -s parent
>
>    +  99.51%  [other]
>    +   0.49%  perf_session__delete
>
> Signed-off-by: Jiri Olsa <jolsa@...hat.com>
> Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Ingo Molnar <mingo@...e.hu>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Cc: Paul Mackerras <paulus@...ba.org>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Andi Kleen <ak@...ux.intel.com>
> Cc: David Ahern <dsahern@...il.com>
> Cc: Stephane Eranian <eranian@...gle.com>
> ---
>   tools/perf/builtin-report.c | 23 +++++------------------
>   1 file changed, 5 insertions(+), 18 deletions(-)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 8c2c7ce..36de70d 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -497,7 +497,7 @@ static int __cmd_report(struct perf_report *rep)
>   		ret = perf_session__cpu_bitmap(session, rep->cpu_list,
>   					       rep->cpu_bitmap);
>   		if (ret)
> -			goto out_delete;
> +			return ret;
>   	}
>
>   	if (use_browser <= 0)
> @@ -508,11 +508,11 @@ static int __cmd_report(struct perf_report *rep)
>
>   	ret = perf_report__setup_sample_type(rep);
>   	if (ret)
> -		goto out_delete;
> +		return ret;
>
>   	ret = perf_session__process_events(session, &rep->tool);
>   	if (ret)
> -		goto out_delete;
> +		return ret;
>
>   	kernel_map = session->machines.host.vmlinux_maps[MAP__FUNCTION];
>   	kernel_kmap = map__kmap(kernel_map);
> @@ -547,7 +547,7 @@ static int __cmd_report(struct perf_report *rep)
>
>   	if (dump_trace) {
>   		perf_session__fprintf_nr_events(session, stdout);
> -		goto out_delete;
> +		return 0;
>   	}
>
>   	nr_samples = 0;
> @@ -572,7 +572,7 @@ static int __cmd_report(struct perf_report *rep)
>
>   	if (nr_samples == 0) {
>   		ui__error("The %s file has no samples!\n", session->filename);
> -		goto out_delete;
> +		return 0;
>   	}
>
>   	list_for_each_entry(pos, &session->evlist->entries, node)
> @@ -598,19 +598,6 @@ static int __cmd_report(struct perf_report *rep)
>   	} else
>   		perf_evlist__tty_browse_hists(session->evlist, rep, help);
>
> -out_delete:
> -	/*
> -	 * Speed up the exit process, for large files this can
> -	 * take quite a while.
> -	 *
> -	 * XXX Enable this when using valgrind or if we ever
> -	 * librarize this command.
> -	 *
> -	 * Also experiment with obstacks to see how much speed
> -	 * up we'll get here.
> -	 *
> - 	 * perf_session__delete(session);
> - 	 */
>   	return ret;
>   }
>
>

--
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