From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] syscalls/perf_event_open{01, 02}: Add -n arg for size of idle loop
Date: Mon, 18 Jul 2016 18:14:45 +0200 [thread overview]
Message-ID: <20160718161445.GA23240@rei.lan> (raw)
In-Reply-To: <1468596953-3407-2-git-send-email-yuriy.kolerov@synopsys.com>
Hi!
> The value of this option is used in do_word() idle loop. By default
> do_work() iterates 1000000000 times. However such loop may take a
> long time to finish for all available performance counters on some
> boards. It would be useful to have an ability to choose the size of
> idle loop.
Ideally LTP testcases should run just fine without any specific tweaks.
Looking at the code for perf_event_open01.c we can simply change the
predefined value of loops. Since this is just a basic test that enables
the interface and reads the values but does not try do anything with
them. The test would run just fine even if we didn't do anything in
between ENABLE and DISABLE ioctls().
The perf_event_open02.c is a bit more complicated, it test grouping and
multiplexing. Looking at the test it runs for about 4 second on a cheap
notebook so I can imagine that it takes couple of minutes on slow
hardware. I guess that we can safely divide the nunber of default loops
by 10 and everything should continue just fine.
So would diving by 10 work for you?
If that is still too slow we can always change the test to setup an
timer that would send a signal which would set set a variable which
would stop the loop in do_work() so that the test runs defined amount of
time regardless of the machine speed.
Or we could measure how long reasonably small number of iterations takes
in order to callibrate the number of loops the do_work() function should
do.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2016-07-18 16:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 15:35 [LTP] [PATCH 1/2] syscalls/perf_event_open02: Fix indentation and typo in help Yuriy Kolerov
2016-07-15 15:35 ` [LTP] [PATCH 2/2] syscalls/perf_event_open{01, 02}: Add -n arg for size of idle loop Yuriy Kolerov
2016-07-18 16:14 ` Cyril Hrubis [this message]
2016-07-19 10:25 ` Yuriy Kolerov
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=20160718161445.GA23240@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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