From: tip-bot for Russ Anderson <rja@sgi.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org,
eranian@google.com, hpa@zytor.com, mingo@redhat.com,
peterz@infradead.org, rja@sgi.com, tglx@linutronix.de,
mingo@elte.hu
Subject: [tip:perf/core] perf record: remove unneeded gettimeofday() call
Date: Fri, 21 May 2010 08:52:43 GMT [thread overview]
Message-ID: <tip-ef365cefbc53d8674a18520a1d4c2e5590127299@git.kernel.org> (raw)
In-Reply-To: <20100518225240.GC25589@sgi.com>
Commit-ID: ef365cefbc53d8674a18520a1d4c2e5590127299
Gitweb: http://git.kernel.org/tip/ef365cefbc53d8674a18520a1d4c2e5590127299
Author: Russ Anderson <rja@sgi.com>
AuthorDate: Tue, 18 May 2010 17:52:40 -0500
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 20 May 2010 21:53:58 -0300
perf record: remove unneeded gettimeofday() call
Perf record repeatedly calls gettimeofday() which adds noise to the performance
measurements. Since gettimeofday() is only used for the error printf, delete
it.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <20100518225240.GC25589@sgi.com>
Signed-off-by: Russ Anderson <rja@sgi.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-record.c | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 66b8ecd..e672269 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -65,9 +65,6 @@ static bool multiplex = false;
static int multiplex_fd = -1;
static long samples = 0;
-static struct timeval last_read;
-static struct timeval this_read;
-
static u64 bytes_written = 0;
static struct pollfd *event_array;
@@ -147,8 +144,6 @@ static void mmap_read(struct mmap_data *md)
void *buf;
int diff;
- gettimeofday(&this_read, NULL);
-
/*
* If we're further behind than half the buffer, there's a chance
* the writer will bite our tail and mess up the samples under us.
@@ -159,23 +154,13 @@ static void mmap_read(struct mmap_data *md)
*/
diff = head - old;
if (diff < 0) {
- struct timeval iv;
- unsigned long msecs;
-
- timersub(&this_read, &last_read, &iv);
- msecs = iv.tv_sec*1000 + iv.tv_usec/1000;
-
- fprintf(stderr, "WARNING: failed to keep up with mmap data."
- " Last read %lu msecs ago.\n", msecs);
-
+ fprintf(stderr, "WARNING: failed to keep up with mmap data\n");
/*
* head points to a known good entry, start there.
*/
old = head;
}
- last_read = this_read;
-
if (old != head)
samples++;
prev parent reply other threads:[~2010-05-21 8:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-18 22:52 [BUGFIX] " Russ Anderson
2010-05-21 8:52 ` tip-bot for Russ Anderson [this message]
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=tip-ef365cefbc53d8674a18520a1d4c2e5590127299@git.kernel.org \
--to=rja@sgi.com \
--cc=acme@redhat.com \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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