* Re: [LTP] [PATCH 3/6] hugemmap01.c
[not found] ` <4E4A2359.2040602@cn.fujitsu.com>
@ 2011-09-02 12:43 ` Cyril Hrubis
2011-09-02 12:47 ` Cyril Hrubis
0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2011-09-02 12:43 UTC (permalink / raw)
To: tangchen; +Cc: ltp-list@lists.sourceforge.net
Hi!
> #include "test.h"
> #include "usctest.h"
> #include "system_specific_hugepages_info.h"
> +#include "libmnt.h"
>
> #define BUFFER_SIZE 256
>
> -char* TEMPFILE="mmapfile";
> +char TEMPFILE[MAXPATHLEN];
>
> char *TCID="hugemmap01"; /* Test program identifier. */
> int TST_TOTAL=1; /* Total number of test cases. */
> long *addr; /* addr of memory mapped region */
> int fildes; /* file descriptor for tempfile */
> -char *Hopt; /* location of hugetlbfs */
> +int hugepagesmapped=0; /* Amount of huge pages mapped after testing */
> int beforetest=0; /* Amount of free huge pages before testing */
> int aftertest=0; /* Amount of free huge pages after testing */
> -int hugepagesmapped=0; /* Amount of huge pages mapped after testing */
> +char *mount_point=NULL;
>
> -void setup(); /* Main setup function of test */
> -void cleanup(); /* cleanup function for the test */
> -
> -void help()
> -{
> - printf(" -H /.. Location of hugetlbfs, i.e. -H /var/hugetlbfs \n");
> -}
> +void setup(void); /* Main setup function of test */
> +void cleanup(void); /* cleanup function for the test */
>
> int
> main(int ac, char **av)
> {
> int lc; /* loop counter */
> - char *msg; /* message returned from parse_opts */
> - int Hflag=0; /* binary flag: opt or not */
> int page_sz=0;
>
> - option_t options[] = {
> - { "H:", &Hflag, &Hopt }, /* Required for location of hugetlbfs */
> - { NULL, NULL, NULL } /* NULL required to end array */
> - };
> -
> - /* Parse standard options given to run the test. */
> - msg = parse_opts(ac, av, options, &help);
> - if (msg != (char *) NULL) {
> - tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s, use -help", msg);
> - tst_exit();
> - }
The parse_opts() should stay here but with NULL parameters there are
some default options and it makes the test bail out on invalid options
passed.
> - if (Hflag == 0) {
> - tst_brkm(TBROK, NULL, "-H option is REQUIRED for this test, use -h for options help");
> - tst_exit();
> - }
> -
> setup();
>
> for (lc = 0; TEST_LOOPING(lc); lc++) {
> @@ -189,18 +166,22 @@ main(int ac, char **av)
> * Write some known data into file and get the size of the file.
> */
> void
> -setup()
> +setup(void)
> {
> - char mypid[40];
> -
> - sprintf(mypid,"/%d",getpid());
> - TEMPFILE=strcat(mypid,TEMPFILE);
> - TEMPFILE=strcat(Hopt,TEMPFILE);
> + tst_require_root(NULL);
>
> tst_sig(FORK, DEF_HANDLER, cleanup);
>
> TEST_PAUSE;
>
> + tst_tmpdir();
> + mount_point = get_tst_tmpdir();
> +
> + mount_hugetlbfs(mount_point);
> + hugepage_alloc(1024);
> +
> + snprintf(TEMPFILE, sizeof(TEMPFILE), "%s/mmapfile%d",
> + mount_point, getpid());
> }
>
> /*
> @@ -209,7 +190,7 @@ setup()
> * Remove the temporary directory created.
> */
> void
> -cleanup()
> +cleanup(void)
> {
> /*
> * print timing stats if that option was specified.
> @@ -218,4 +199,6 @@ cleanup()
>
> unlink(TEMPFILE);
>
> + umount_hugetlbfs(mount_point);
> + tst_rmdir();
> }
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH 3/6] hugemmap01.c
2011-09-02 12:43 ` [LTP] [PATCH 3/6] hugemmap01.c Cyril Hrubis
@ 2011-09-02 12:47 ` Cyril Hrubis
[not found] ` <4E66D3C5.80001@cn.fujitsu.com>
0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2011-09-02 12:47 UTC (permalink / raw)
To: tangchen; +Cc: ltp-list@lists.sourceforge.net
Hi!
> The parse_opts() should stay here but with NULL parameters there are
> some default options and it makes the test bail out on invalid options
> passed.
The same goes for the rest of the tests, without this the test looping
wouldn't work. The rest seems to be good.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH 3/6] hugemmap01.c
[not found] ` <4E66D492.1030907@cn.fujitsu.com>
@ 2011-09-08 11:59 ` Cyril Hrubis
0 siblings, 0 replies; 5+ messages in thread
From: Cyril Hrubis @ 2011-09-08 11:59 UTC (permalink / raw)
To: tangchen; +Cc: ltp-list@lists.sourceforge.net
Hi!
> /* Parse standard options given to run the test. */
> - msg = parse_opts(ac, av, options, &help);
> + msg = parse_opts(ac, av, NULL, NULL);
> if (msg != (char *) NULL) {
> tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s, use -help", msg);
> tst_exit();
The cast to (char *) is useless, please remove it, and also the
tst_exit() don't need to be there as tst_brkm() calls the tst_exit()
itself now.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH 0/6] Automatically mount hugetlbfs for hugemmap tests.
[not found] <4E377560.7060600@cn.fujitsu.com>
[not found] ` <4E4A2359.2040602@cn.fujitsu.com>
@ 2011-11-22 9:39 ` tangchen
2011-11-22 10:11 ` Garrett Cooper
1 sibling, 1 reply; 5+ messages in thread
From: tangchen @ 2011-11-22 9:39 UTC (permalink / raw)
To: ltp-list
hi,
I have been waiting such a long time for the feedback of this patch set.
Does anybody have any time to give some comments?
Thanks:)
On 08/02/2011 11:56 AM, tangchen wrote:
> hi,
>
> I am sorry for replying your comments so late.
> Here, I seperate all the code into 6 patches.
>
> The purpose of this patch set is to automatically
> mount hugetlbfs for hugemmap tests, so that users
> don't need to mount hugetlbfs themselves before
> testing.
>
> I made a new library, including some common
> functions, mounting hugetlbfs and allocating
> hugepages for test programs. And testcase
> hugemmap01 ~ hugemmap04 used these functions to
> mount hugetlbfs before testing.
>
> Please comment! Thanks:)
>
--
Best Regards,
Tang chen
--------------------------------------------------
Tang Chen
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
No.6 Wenzhu Road, Nanjing, 210012, China
TEL: +86+25-86630566-8527
FUJITSU INTERNAL: 7998-8527
FAX: +86+25-83317685
EMail: tangchen@cn.fujitsu.com
--------------------------------------------------
This communication is for use by the intended recipient(s) only and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not an intended recipient of this communication, you are hereby notified that any dissemination, distribution or copying hereof is strictly prohibited. If you have received this communication in error, please notify me by reply e-mail, permanently delete this communication from your system, and destroy any hard copies you may have printed
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH 0/6] Automatically mount hugetlbfs for hugemmap tests.
2011-11-22 9:39 ` [LTP] [PATCH 0/6] Automatically mount hugetlbfs for hugemmap tests tangchen
@ 2011-11-22 10:11 ` Garrett Cooper
0 siblings, 0 replies; 5+ messages in thread
From: Garrett Cooper @ 2011-11-22 10:11 UTC (permalink / raw)
To: tangchen; +Cc: ltp-list
On Tue, 22 Nov 2011, tangchen wrote:
> hi,
>
> I have been waiting such a long time for the feedback of this patch set.
> Does anybody have any time to give some comments?
> Thanks:)
>
> On 08/02/2011 11:56 AM, tangchen wrote:
>> hi,
>>
>> I am sorry for replying your comments so late.
>> Here, I seperate all the code into 6 patches.
>>
>> The purpose of this patch set is to automatically
>> mount hugetlbfs for hugemmap tests, so that users
>> don't need to mount hugetlbfs themselves before
>> testing.
>>
>> I made a new library, including some common
>> functions, mounting hugetlbfs and allocating
>> hugepages for test programs. And testcase
>> hugemmap01 ~ hugemmap04 used these functions to
>> mount hugetlbfs before testing.
Tang-Chen,
You didn't reply to all of my comments based on my looking back at
my gmail mailbox. Granted, I could have preened the messages by accident,
but I don't see replies. If you can dig up links and/or [re]submit updated
patches to the list, I'll review it today and commit them if the comments
have been addressed.
Thanks!
-Garrett
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-11-22 10:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4E377560.7060600@cn.fujitsu.com>
[not found] ` <4E4A2359.2040602@cn.fujitsu.com>
2011-09-02 12:43 ` [LTP] [PATCH 3/6] hugemmap01.c Cyril Hrubis
2011-09-02 12:47 ` Cyril Hrubis
[not found] ` <4E66D3C5.80001@cn.fujitsu.com>
[not found] ` <4E66D492.1030907@cn.fujitsu.com>
2011-09-08 11:59 ` Cyril Hrubis
2011-11-22 9:39 ` [LTP] [PATCH 0/6] Automatically mount hugetlbfs for hugemmap tests tangchen
2011-11-22 10:11 ` Garrett Cooper
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.