This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH 3/3] Add new case for stress test
- From: David Smith <dsmith at redhat dot com>
- To: Zhou, Wenjian/åæå <zhouwj-fnst at cn dot fujitsu dot com>, "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: systemtap at sourceware dot org
- Date: Wed, 23 Dec 2015 11:46:20 -0600
- Subject: Re: [PATCH 3/3] Add new case for stress test
- Authentication-results: sourceware.org; auth=none
- References: <1450164104-1508-1-git-send-email-zhouwj-fnst at cn dot fujitsu dot com> <1450164104-1508-3-git-send-email-zhouwj-fnst at cn dot fujitsu dot com> <y0mk2oflw9h dot fsf at fche dot csb> <5670FC2F dot 8020609 at cn dot fujitsu dot com>
On 12/15/2015 11:52 PM, "Zhou, Wenjian/åæå" wrote:
> On 12/15/2015 08:41 PM, Frank Ch. Eigler wrote:
>>
>> zhouwj-fnst wrote:
>>
>>> [...]
>>> +proc gen_load {} {
>>> + # if 'genload' from the ltp exists, use it to create a real load
>>> + set genload {/usr/local/ltp/testcases/bin/genload}
>>> + if [file executable $genload] {
>>> [...]
>>
>> How about using the same logic used in lib/stap_run.exp looking for
>> /usr/bin/stress? Or $PATH searching? That /usr/local/ltp path is
>> just not a good fit for general installations.
>>
>
> Hello Frank,
>
> +proc gen_load {} {
> + # if 'genload' from the ltp exists, use it to create a real load
> + set genload {/usr/local/ltp/testcases/bin/genload}
> + if [file executable $genload] {
> + exec $genload -c 10 -i 10 -m 10 -t 10
> + # ^^^^^ run for 10 seconds
> + # ^^^^^ 10 procs spinning on malloc
> + # ^^^^^ 10 procs spinning on sync
> + # ^^^^^ 10 procs spinning on sqrt
> + } else {
> + # sleep for a bit
> + wait_n_secs 10
>
> "wait_n_secs" is the function in stap_run.exp.
> If /usr/local/ltp/testcases/bin/genload is not exist, it will look for
> /usr/bin/stress.
I think Frank means we should search the path for 'genload', instead of
just looking for it in /usr/local/ltp/testcases/bin. The easiest way to
do that would be to look at the output of 'which genload'. If that was
empty, you could then look in /usr/local/ltp/testcases/bin.
> I just use the same logic of the other tests in stress.
> Do you mean "set genload" should be removed ?
It looks like testsuite/systemtap.stress/all_kernel_functions.exp and
testsuite/systemtap.stress/current.exp also have a genload function.
Perhaps we should move/combine them all the genload functions into a new
file in testsuite/lib that the 2 existing tests and your new test use.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)