public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: ltp-list@lists.sourceforge.net,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Eugene Teo <eugene@redhat.com>, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [LTP] [PATCH] Add ftrace-stress-test to LTP
Date: Thu, 02 Sep 2010 09:08:13 +0800	[thread overview]
Message-ID: <4C7EF8FD.6070005@cn.fujitsu.com> (raw)
In-Reply-To: <AANLkTi=Dky57c3S+NS_adO9Z-Tytp0d0hcyxPJA_DqrM@mail.gmail.com>

>> --- /dev/null
>> +++ b/testcases/kernel/tracing/ftrace_stress_test/ftrace_kvercmp.c
>> @@ -0,0 +1,37 @@
>> +#include <unistd.h>
>> +#include <stdlib.h>
>> +#include <stdio.h>
>> +#include <string.h>
>> +#include <sys/utsname.h>
>> +
>> +int main(int argc, char **argv)
>> +{
>> +       struct utsname uval;
>> +       int k1, k2, k3;
>> +       int a1, a2, a3;
>> +       unsigned long r1, r2;
>> +
>> +       if (argc != 4) {
>> +               fprintf(stderr, "Wrong arguments!\n");
>> +               return -1;
>> +       }
>> +
>> +       a1 = strtol(argv[1], NULL, 10);
>> +       a2 = strtol(argv[2], NULL, 10);
>> +       a3 = strtol(argv[3], NULL, 10);
>> +
>> +       uname(&uval);
>> +
>> +       sscanf(uval.release, "%d.%d.%d", &k1, &k2, &k3);
>> +
>> +       r1 = (a1 << 16) + (a2 << 8) + a3;
>> +       r2 = (k1 << 16) + (k2 << 8) + k3;
>> +
>> +       if (r1 > r2)
>> +               return 0;
>> +       else if (r1 == r2)
>> +               return 1;
>> +       else
>> +               return 2;
>> +}
> 
> This application could be replaced with tst_kvercmp out of the box;
> there's no reason why another program needs to be created for this.
> 

This stress test was not written for LTP originally, so I had to write
this ftrace_kvercmp.

But I do have a reason to keep this. That is, using tst_kvercmp will
make it harder to run this test without LTP.

Anyway I'll remove it.

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      reply	other threads:[~2010-09-02  1:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24  4:06 [LTP] [PATCH] Add ftrace-stress-test to LTP Li Zefan
2010-08-24 11:02 ` Subrata Modak
2010-08-25  1:25   ` Li Zefan
2010-08-25  2:41     ` Garrett Cooper
2010-08-25  2:59       ` Li Zefan
2010-09-06 16:16       ` Subrata Modak
2010-09-06 18:52         ` Garrett Cooper
2010-08-25  5:31 ` Garrett Cooper
2010-09-02  1:08   ` Li Zefan [this message]

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=4C7EF8FD.6070005@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=eugene@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=yanegomi@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox