[PATCH 3/3] Add new case for stress test

"Zhou, Wenjian/周文剑" zhouwj-fnst@cn.fujitsu.com
Wed Dec 16 05:54:00 GMT 2015


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 just use the same logic of the other tests in stress.
Do you mean "set genload" should be removed ?

+    }
+    return 0
+}

-- 
Thanks
Zhou




More information about the Systemtap mailing list