All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de MElo <arnaldo.melo@gmail.com>
To: "Rantala, Tommi T. (Nokia - FI/Espoo)" <tommi.t.rantala@nokia.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Davidlohr Bueso <dave@stgolabs.net>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 4/5] perf bench: Share some global variables to fix build with gcc 10
Date: Thu, 5 Mar 2020 12:16:09 -0300	[thread overview]
Message-ID: <20200305151609.GE7895@kernel.org> (raw)
In-Reply-To: <bb1a3048a0f75d1fdf497c67d16a022cdd15c437.camel@nokia.com>

Em Thu, Mar 05, 2020 at 08:43:32AM +0000, Rantala, Tommi T. (Nokia - FI/Espoo) escreveu:
> On Tue, 2020-03-03 at 16:48 -0300, Arnaldo Carvalho de Melo wrote:
> > From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> BTW there's also some div-by-zero bugs here if runtime is zero:
> 
> $ perf bench epoll wait --runtime=0
> # Running 'epoll/wait' benchmark:
> Run summary [PID 30859]: 7 threads monitoring on 64 file-descriptors for 0
> secs.
> 
> Floating point exception (core dumped)

Can you please submit a patch for that? 

I've applied the other 3 fixes you submitted, thanks for that!

- Arnaldo
 
> > diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-
> > wait.c
> > index 7af694437f4e..d1c5cb526b9f 100644
> > --- a/tools/perf/bench/epoll-wait.c
> > +++ b/tools/perf/bench/epoll-wait.c
> > 
> > @@ -519,7 +518,7 @@ int bench_epoll_wait(int argc, const char **argv)
> >  		qsort(worker, nthreads, sizeof(struct worker), cmpworker);
> >  
> >  	for (i = 0; i < nthreads; i++) {
> > -		unsigned long t = worker[i].ops/runtime.tv_sec;
> > +		unsigned long t = worker[i].ops / bench__runtime.tv_sec;
> >  
> >  		update_stats(&throughput_stats, t);
> >  
> > diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-
> > hash.c
> > index 8ba0c3330a9a..21776862e940 100644
> > --- a/tools/perf/bench/futex-hash.c
> > +++ b/tools/perf/bench/futex-hash.c
> > 
> > @@ -204,7 +204,7 @@ int bench_futex_hash(int argc, const char **argv)
> >  	pthread_mutex_destroy(&thread_lock);
> >  
> >  	for (i = 0; i < nthreads; i++) {
> > -		unsigned long t = worker[i].ops/runtime.tv_sec;
> > +		unsigned long t = worker[i].ops / bench__runtime.tv_sec;
> >  		update_stats(&throughput_stats, t);
> >  		if (!silent) {
> >  			if (nfutexes == 1)
> > diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-
> > lock-pi.c
> > index d0cae8125423..30d97121dc4f 100644
> > --- a/tools/perf/bench/futex-lock-pi.c
> > +++ b/tools/perf/bench/futex-lock-pi.c
> > 
> > @@ -211,7 +210,7 @@ int bench_futex_lock_pi(int argc, const char **argv)
> >  	pthread_mutex_destroy(&thread_lock);
> >  
> >  	for (i = 0; i < nthreads; i++) {
> > -		unsigned long t = worker[i].ops/runtime.tv_sec;
> > +		unsigned long t = worker[i].ops / bench__runtime.tv_sec;
> >  
> >  		update_stats(&throughput_stats, t);
> >  		if (!silent)
> 

-- 

- Arnaldo

  reply	other threads:[~2020-03-05 15:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 19:48 [GIT PULL] perf/urgent fixes Arnaldo Carvalho de Melo
2020-03-03 19:48 ` [PATCH 1/5] perf tests bp_account: Make global variable static Arnaldo Carvalho de Melo
2020-03-03 19:48 ` [PATCH 2/5] perf env: Do not return pointers to local variables Arnaldo Carvalho de Melo
2020-03-03 19:48 ` [PATCH 3/5] perf parse-events: Use asprintf() instead of strncpy() to read tracepoint files Arnaldo Carvalho de Melo
2020-03-03 19:48 ` [PATCH 4/5] perf bench: Share some global variables to fix build with gcc 10 Arnaldo Carvalho de Melo
2020-03-05  8:43   ` Rantala, Tommi T. (Nokia - FI/Espoo)
2020-03-05 15:16     ` Arnaldo Carvalho de MElo [this message]
2020-03-03 19:48 ` [PATCH 5/5] perf symbols: Don't try to find a vmlinux file when looking for kernel modules Arnaldo Carvalho de Melo
2020-03-04 10:54 ` [GIT PULL] perf/urgent fixes Ingo Molnar
2020-03-06 19:11 Arnaldo Carvalho de Melo
2020-03-06 19:11 ` [PATCH 4/5] perf bench: Share some global variables to fix build with gcc 10 Arnaldo Carvalho de Melo

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=20200305151609.GE7895@kernel.org \
    --to=arnaldo.melo@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=dave@stgolabs.net \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tommi.t.rantala@nokia.com \
    --cc=williams@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.