LKML Archive on
 help / color / Atom feed
From: Jiri Olsa <>
To: Arnaldo Carvalho de Melo <>,
	Peter Zijlstra <>
Cc: lkml <>,
	Ingo Molnar <>,
	Namhyung Kim <>,
	David Ahern <>, Andi Kleen <>,
	Alexander Shishkin <>
Subject: [PATCH] perf tools: Fix copyfile_offset update of output offset
Date: Tue,  9 Jan 2018 14:39:23 +0100
Message-ID: <> (raw)

We need to increase output offset in each iteration,
not decrease it as we currently do.

I guess we were lucky to finish in most cases in first
iteration, so the bug never showed. However it shows a
lot when working with big (~4GB) size data.

Signed-off-by: Jiri Olsa <>
 tools/perf/util/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index a789f952b3e9..443892dabedb 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -210,7 +210,7 @@ static int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64
 		size -= ret;
 		off_in += ret;
-		off_out -= ret;
+		off_out += ret;
 	munmap(ptr, off_in + size);

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 13:39 Jiri Olsa [this message]
2018-01-12 19:46 ` Arnaldo Carvalho de Melo
2018-01-17 16:26 ` [tip:perf/core] " tip-bot for Jiri Olsa

Reply instructions:

You may reply publically 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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox