From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24999 invoked by alias); 18 Feb 2016 18:48:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 24985 invoked by uid 89); 18 Feb 2016 18:48:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=1000000, Second, disappeared, 1530 X-HELO: mail.mimuw.edu.pl Received: from mail.mimuw.edu.pl (HELO mail.mimuw.edu.pl) (193.0.96.6) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Feb 2016 18:48:55 +0000 Received: from localhost (localhost [127.0.0.1] ident=amavis) by duch.mimuw.edu.pl (Postfix) with ESMTP id D4C421EC; Thu, 18 Feb 2016 19:48:52 +0100 (CET) Received: from duch.mimuw.edu.pl ([127.0.0.1]) by localhost (mail.mimuw.edu.pl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4O1oOK2JFAdI; Thu, 18 Feb 2016 19:48:51 +0100 (CET) Received: from [192.168.43.80] (public-gprs363788.centertel.pl [37.47.52.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by duch.mimuw.edu.pl (Postfix) with ESMTPSA; Thu, 18 Feb 2016 19:48:50 +0100 (CET) Subject: Re: [PATCH 2/2] Determine the iteration count based on wallclock instead of user+system time. To: Wei-cheng Wang , uweigand@de.ibm.com, gdb-patches@sourceware.org References: <1440091938-42453-1-git-send-email-cole945@gmail.com> <1440091938-42453-2-git-send-email-cole945@gmail.com> From: =?UTF-8?Q?Marcin_Ko=c5=9bcielnicki?= Message-ID: <56C61211.1000708@mimuw.edu.pl> Date: Thu, 18 Feb 2016 18:48:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1440091938-42453-2-git-send-email-cole945@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-02/txt/msg00569.txt.bz2 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 > > * 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); >