From: "Marcin Kościelnicki" <m.koscielnicki@mimuw.edu.pl>
To: Wei-cheng Wang <cole945@gmail.com>,
uweigand@de.ibm.com, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Determine the iteration count based on wallclock instead of user+system time.
Date: Thu, 18 Feb 2016 18:48:00 -0000 [thread overview]
Message-ID: <56C61211.1000708@mimuw.edu.pl> (raw)
In-Reply-To: <1440091938-42453-2-git-send-email-cole945@gmail.com>
On 20/08/15 19:32, Wei-cheng Wang wrote:
> Hi Ulrich,
>
> This patch will combine with "Tracepoint for ppc64" into one patch.
> Is this ok?
>
> Thanks,
> Wei-cheng
>
This patch has been accepted half a year ago, and the author has
disappeared. It fixes the same underlying issue as my patch at
https://sourceware.org/ml/gdb-patches/2016-01/msg00716.html . Since
this patch seems to be a smarter fix, I'd like to abandon mine, and go
with that one instead. I've just checked it - works just fine and fixes
the problem on s390{,x}-ibm-linux-gnu, no regressions on
x86_64-unknown-linx-gnu.
OK to push?
> ---
>
> gdb/testsuite/ChangeLog
>
> 2015-08-23 Wei-cheng Wang <cole945@gmail.com>
>
> * gdb.trace/tspeed.c (myclock): Return wallclock instead of
> user+system time.
> (trace_speed_test): Determine the iteration count for a time
> between 15..30 seconds.
> ---
> gdb/testsuite/gdb.trace/tspeed.c | 16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.trace/tspeed.c b/gdb/testsuite/gdb.trace/tspeed.c
> index ca4c7bf..c9e212c 100644
> --- a/gdb/testsuite/gdb.trace/tspeed.c
> +++ b/gdb/testsuite/gdb.trace/tspeed.c
> @@ -56,13 +56,9 @@ int nspertp = 0;
> unsigned long long
> myclock ()
> {
> - struct timeval tm, tm2;
> - struct rusage ru;
> - getrusage (RUSAGE_SELF, &ru);
> - tm = ru.ru_utime;
> - tm2 = ru.ru_stime;
> - return (((unsigned long long) tm.tv_sec) * 1000000) + tm.tv_usec
> - + (((unsigned long long) tm2.tv_sec) * 1000000) + tm2.tv_usec;
> + struct timeval tm;
> + gettimeofday (&tm, NULL);
> + return (((unsigned long long) tm.tv_sec) * 1000000) + tm.tv_usec;
> }
>
> int
> @@ -162,9 +158,9 @@ trace_speed_test (void)
> return -1;
>
> if (idelta > mindelta
> - /* Total test time should be between 2 and 5 seconds. */
> - && (total1 + total2) > (2 * 1000000)
> - && (total1 + total2) < (5 * 1000000))
> + /* Total test time should be between 15 and 30 seconds. */
> + && (total1 + total2) > (15 * 1000000)
> + && (total1 + total2) < (30 * 1000000))
> {
> nsdelta = (((unsigned long long) idelta) * 1000) / iters;
> printf ("Second loop took %d ns longer per iter than first\n", nsdelta);
>
next prev parent reply other threads:[~2016-02-18 18:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-23 16:17 [PATCH 1/2] Re-check fastpoint after reloading symbols Wei-cheng Wang
2015-08-23 16:17 ` [PATCH 2/2] Determine the iteration count based on wallclock instead of user+system time Wei-cheng Wang
2015-08-27 18:14 ` Ulrich Weigand
2016-02-18 18:48 ` Marcin Kościelnicki [this message]
2016-02-18 18:56 ` Ulrich Weigand
2016-02-18 19:26 ` Marcin Kościelnicki
2015-08-27 18:13 ` [PATCH 1/2] Re-check fastpoint after reloading symbols Ulrich Weigand
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=56C61211.1000708@mimuw.edu.pl \
--to=m.koscielnicki@mimuw.edu.pl \
--cc=cole945@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/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