* [PATCH] perf bench: Fix trap divide error of perf bench internals inject-build-id
@ 2024-05-07 6:50 He Zhe
2024-05-07 15:41 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 2+ messages in thread
From: He Zhe @ 2024-05-07 6:50 UTC (permalink / raw)
To: namhyung, mark.rutland, alexander.shishkin, jolsa, irogers,
adrian.hunter
Cc: zhe.he, linux-perf-users, linux-kernel
perf bench internals inject-build-id suffers from the following error when
only one DSO is collected.
perf bench internals inject-build-id -v
Collected 1 DSOs
traps: internals-injec[2305] trap divide error
ip:557566ba6394 sp:7ffd4de97fe0 error:0 in perf[557566b2a000+23d000]
Build-id injection benchmark
Iteration #1
Floating point exception
This patch removes the unnecessary minus one from the divisor which also
corrects the randomization range.
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
tools/perf/bench/inject-buildid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/bench/inject-buildid.c b/tools/perf/bench/inject-buildid.c
index 49331743c743..a759eb2328be 100644
--- a/tools/perf/bench/inject-buildid.c
+++ b/tools/perf/bench/inject-buildid.c
@@ -362,7 +362,7 @@ static int inject_build_id(struct bench_data *data, u64 *max_rss)
return -1;
for (i = 0; i < nr_mmaps; i++) {
- int idx = rand() % (nr_dsos - 1);
+ int idx = rand() % nr_dsos;
struct bench_dso *dso = &dsos[idx];
u64 timestamp = rand() % 1000000;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] perf bench: Fix trap divide error of perf bench internals inject-build-id
2024-05-07 6:50 [PATCH] perf bench: Fix trap divide error of perf bench internals inject-build-id He Zhe
@ 2024-05-07 15:41 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-05-07 15:41 UTC (permalink / raw)
To: He Zhe
Cc: namhyung, mark.rutland, alexander.shishkin, jolsa, irogers,
adrian.hunter, linux-perf-users, linux-kernel
On Tue, May 07, 2024 at 02:50:26PM +0800, He Zhe wrote:
> perf bench internals inject-build-id suffers from the following error when
> only one DSO is collected.
>
> perf bench internals inject-build-id -v
> Collected 1 DSOs
> traps: internals-injec[2305] trap divide error
> ip:557566ba6394 sp:7ffd4de97fe0 error:0 in perf[557566b2a000+23d000]
> Build-id injection benchmark
> Iteration #1
> Floating point exception
>
> This patch removes the unnecessary minus one from the divisor which also
> corrects the randomization range.
Thanks, applied to perf-tools-next, and added:
Fixes: 0bf02a0d80427f26 ("perf bench: Add build-id injection benchmark")
To make sure this ends up being picked by the stable guys and
backporters.
- Arnaldo
> Signed-off-by: He Zhe <zhe.he@windriver.com>
> ---
> tools/perf/bench/inject-buildid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/bench/inject-buildid.c b/tools/perf/bench/inject-buildid.c
> index 49331743c743..a759eb2328be 100644
> --- a/tools/perf/bench/inject-buildid.c
> +++ b/tools/perf/bench/inject-buildid.c
> @@ -362,7 +362,7 @@ static int inject_build_id(struct bench_data *data, u64 *max_rss)
> return -1;
>
> for (i = 0; i < nr_mmaps; i++) {
> - int idx = rand() % (nr_dsos - 1);
> + int idx = rand() % nr_dsos;
> struct bench_dso *dso = &dsos[idx];
> u64 timestamp = rand() % 1000000;
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-07 15:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-07 6:50 [PATCH] perf bench: Fix trap divide error of perf bench internals inject-build-id He Zhe
2024-05-07 15:41 ` Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).