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:	Fri, 5 Jun 2015 19:40:16 +0800
From:	He Kuang <hekuang@...wei.com>
To:	<acme@...nel.org>, <mingo@...hat.com>, <a.p.zijlstra@...llo.nl>,
	<namhyung@...nel.org>
CC:	<wangnan0@...wei.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf record: Fix perf.data size in no-buildid mode


ping..
On 2015/5/28 21:17, He Kuang wrote:
> The size of perf.data is missing update in no-buildid mode, which gives
> wrong output result.
>
> Before this patch:
>
>    $ perf.perf record -B -e syscalls:sys_enter_open uname
>    Linux
>    [ perf record: Woken up 1 times to  write data ]
>    [ perf record: Captured and wrote 0.000 MB perf.data ]
>
> After this patch:
>
>    $ perf.perf record -B -e syscalls:sys_enter_open uname
>    Linux
>    [ perf record: Woken up 1 times to write data ]
>    [ perf record: Captured and wrote 0.001 MB perf.data ]
>
> Signed-off-by: He Kuang <hekuang@...wei.com>
> ---
>   tools/perf/builtin-record.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 91aa2a3..d3731cc 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -345,12 +345,9 @@ static int process_buildids(struct record *rec)
>   	struct perf_data_file *file  = &rec->file;
>   	struct perf_session *session = rec->session;
>
> -	u64 size = lseek(perf_data_file__fd(file), 0, SEEK_CUR);
> -	if (size == 0)
> +	if (file->size == 0)
>   		return 0;
>
> -	file->size = size;
> -
>   	/*
>   	 * During this process, it'll load kernel map and replace the
>   	 * dso->long_name to a real pathname it found.  In this case
> @@ -719,6 +716,7 @@ out_child:
>
>   	if (!err && !file->is_pipe) {
>   		rec->session->header.data_size += rec->bytes_written;
> +		file->size = lseek(perf_data_file__fd(file), 0, SEEK_CUR);
>
>   		if (!rec->no_buildid) {
>   			process_buildids(rec);
>

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