Wanlong Gao | 10 Feb 04:35
Favicon

[PATCH] libmem: use SAFE_STRTOL instead

change to use SAFE_STRTOL instead in libmem.

Signed-off-by: Wanlong Gao <gaowanlong@...>
---
 testcases/kernel/mem/lib/mem.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index e25b5be..cce7751 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -13,6 +13,7 @@
 #include "usctest.h"
 #include "../include/mem.h"
 #include "config.h"
+#include "safe_macros.h"
 #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \
 	&& HAVE_MPOL_CONSTANTS
 #include <numaif.h>
@@ -769,8 +770,7 @@ void set_sys_tune(char *sys_file, long tune, int check)
 long get_sys_tune(char *sys_file)
 {
 	int fd;
-	long tune;
-	char buf[BUFSIZ], path[BUFSIZ], *endptr;
+	char buf[BUFSIZ], path[BUFSIZ];

 	snprintf(path, BUFSIZ, "%s%s", PATH_SYSVM, sys_file);
 	fd = open(path, O_RDONLY);
@@ -780,11 +780,5 @@ long get_sys_tune(char *sys_file)
(Continue reading)

Wanlong Gao | 10 Feb 02:08
Favicon

[PATCH 1/2] safe_macro: add the missed header

Add the missed header errno.h.

Signed-off-by: Wanlong Gao <gaowanlong@...>
---
 lib/safe_macros.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/safe_macros.c b/lib/safe_macros.c
index 4c8cbb7..5e388f1 100644
--- a/lib/safe_macros.c
+++ b/lib/safe_macros.c
@@ -9,6 +9,7 @@
 #include <stdarg.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <errno.h>
 #include "test.h"
 #include "safe_macros.h"

--

-- 
1.7.9

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Vinson Lee | 10 Feb 00:05
Favicon
Gravatar

[PATCH] safe_macros: Include errno.h.

Fix build regression introduced by commit
d6a1f25137b0ac8704bd08cc4bc8af01cceaca0e.

This patch fixes this build error on Ubuntu 11.10.
safe_macros.c: In function ‘safe_strtol’:
safe_macros.c:349:2: error: ‘errno’ undeclared (first use in this
function)
safe_macros.c:349:2: note: each undeclared identifier is reported only
once for each function it appears in
safe_macros.c:351:16: error: ‘ERANGE’ undeclared (first use in this
function)

Signed-off-by: Vinson Lee <vlee <at> twitter.com>
---
 lib/safe_macros.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/safe_macros.c b/lib/safe_macros.c
index 4c8cbb7..31df0fd 100644
--- a/lib/safe_macros.c
+++ b/lib/safe_macros.c
@@ -2,6 +2,7 @@
 #include <sys/mman.h>
 #include <sys/resource.h>
 #include <sys/stat.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <libgen.h>
 #include <limits.h>
--

-- 
(Continue reading)

Caspar Zhang | 9 Feb 09:13
Gravatar

[PATCH] safe_macros: add SAFE_STRTOL


usage: SAFE_STRTOL(cleanup_fn, string, min, max);
when no specific range required, min could be LONG_MIN and max could be
LONG_MAX;

return: converted long int type value.

Signed-off-by: Caspar Zhang <caspar@...>
---
 include/safe_macros.h |    5 +++++
 lib/safe_macros.c     |   23 ++++++++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/include/safe_macros.h b/include/safe_macros.h
index 12f03ef..fbfe6cd 100644
--- a/include/safe_macros.h
+++ b/include/safe_macros.h
@@ -146,5 +146,10 @@ int safe_truncate(const char *file, const int lineno,
 #define SAFE_TRUNCATE(cleanup_fn, fd, length) \
 	safe_truncate(__FILE__, __LINE__, cleanup_fn, (path), (length))

+long safe_strtol(const char *file, const int lineno,
+	    void (cleanup_fn)(void), char *str, long min, long max);
+#define SAFE_STRTOL(cleanup_fn, str, min, max) \
+	safe_strtol(__FILE__, __LINE__, cleanup_fn, (str), (min), (max))
+
 #endif
 #endif
(Continue reading)

Peng Haitao | 9 Feb 02:45
Favicon

[PATCH] aio02: runfstests.sh should be deleted


runfstests.sh is creating temporary directory, which could be easily done
withing the test itself by using tst_tmpdir(), So runfstests.sh should be
deleted.

Signed-off-by: Peng Haitao <penght@...>
---
 runtest/io                                   |    2 +-
 testcases/kernel/io/aio/aio02/Makefile       |    2 -
 testcases/kernel/io/aio/aio02/README         |    2 +-
 testcases/kernel/io/aio/aio02/aio_tio.c      |   20 ++++----
 testcases/kernel/io/aio/aio02/cases/common.h |   30 -------------
 testcases/kernel/io/aio/aio02/main.c         |    8 ++-
 testcases/kernel/io/aio/aio02/runfstests.sh  |   58 --------------------------
 7 files changed, 17 insertions(+), 105 deletions(-)
 delete mode 100644 testcases/kernel/io/aio/aio02/cases/common.h
 delete mode 100755 testcases/kernel/io/aio/aio02/runfstests.sh

diff --git a/runtest/io b/runtest/io
index a52d053..00032ff 100644
--- a/runtest/io
+++ b/runtest/io
@@ -1,3 +1,3 @@
 #AIO01 & AIO02 tests to be run
 aio01 aio01
-aio02 runfstests.sh -a aio_tio
+aio02 aio_tio
diff --git a/testcases/kernel/io/aio/aio02/Makefile b/testcases/kernel/io/aio/aio02/Makefile
index e897d84..7d71634 100644
--- a/testcases/kernel/io/aio/aio02/Makefile
(Continue reading)

Xu, Anhua | 8 Feb 10:49
Picon
Favicon
Gravatar

[PATCH] performance_counter02: update syscall and perf data structures

Hi Cyril

This is the perf updte for test case: performance_counter02
Please review and give feedback. 

Thanks
Eric

commit 173054bd6fe8438979c79eaf50059e5f36a26504
Author: Xu,Anhua <anhua.xu@...>
Date:   Wed Feb 8 17:03:36 2012 +0800

    performance_counter02: update syscall and perf data structures

    Performance counters currently named performance events. The original
    data structures are deprecated. Update syscall and associated data
    structure

diff --git a/testcases/kernel/performance_counters/performance_counter02.c b/testcases/kernel/performance_counters/performance_counter02.c
index cc8773e..d0ea9c2 100644
--- a/testcases/kernel/performance_counters/performance_counter02.c
+++ b/testcases/kernel/performance_counters/performance_counter02.c
@@ -65,6 +65,7 @@ it print out the values of each counter.
 #include <sys/prctl.h>
 #include <sys/types.h>
 #include <linux/types.h>
+#include <linux/perf_event.h>

 /* Harness Specific Include Files. */
 #include "test.h"
(Continue reading)

Xu, Anhua | 8 Feb 10:47
Picon
Favicon
Gravatar

[PATCH] performance_counter01: update syscall and fix endless loop

Hi, Cyril

This is the updated patch for performance_counter01. Yes you are right we do not need a 
Specific perf.h head file. 

Please review
Thanks
Eric

commit 1cff5e3c6d177638506ca953d3d757aca6bd51fd
Author: Xu,Anhua <anhua.xu@...>
Date:   Wed Feb 8 16:52:33 2012 +0800

    performance_counter01: update syscall and fix endless loop

    performance counter currently are named performance events. The
    original perf data structure were deprecated. Add checking for
    returned value from read and complete the reading loop for at
    most 100 times if no error occurs

diff --git a/testcases/kernel/performance_counters/performance_counter01.c b/testcases/kernel/performance_counters/performance_counter01.c
index af89f48..b96d22a 100644
--- a/testcases/kernel/performance_counters/performance_counter01.c
+++ b/testcases/kernel/performance_counters/performance_counter01.c
@@ -37,6 +37,8 @@
 #include <stdio.h>
 #include <fcntl.h>

+#include <linux/perf_event.h>
+
(Continue reading)

Wanlong Gao | 8 Feb 10:13
Favicon

[PATCH v4 0/4] hugemmap: auto mount fix


Hi:
This is the v4.
v3->v4: restore of the origin hugepages, suggested by Caspar.

Thanks
-Wanlong Gao

Wanlong Gao (4):
  hugemmap01: auto mount the temporary dir for testing
  hugemmap02: auto mount the temporary dir for testing
  hugemmap03: auto mount the temporary dir for testing
  hugemmap04: auto mount the temporary dir for testing

 runtest/hugetlb                                    |    8 ++--
 testcases/kernel/mem/hugetlb/hugemmap/Makefile     |   11 ++++
 testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c |   55 +++++++++++++-------
 testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c |   50 ++++++++++++------
 testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c |   55 +++++++++++++-------
 testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c |   53 ++++++++++++-------
 6 files changed, 155 insertions(+), 77 deletions(-)

--

-- 
1.7.9

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
(Continue reading)

Shang Yanfeng | 8 Feb 09:44
Favicon

[PATCH 1/2] logrotate_test.sh coding style cleanups

cleanup the coding style

Signed-off-by: Shang Yanfeng <YanFeng.Shang@...>
---
 testcases/commands/logrotate/logrotate_tests.sh |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/testcases/commands/logrotate/logrotate_tests.sh b/testcases/commands/logrotate/logrotate_tests.sh
index 827dd5f..ac73bac 100755
--- a/testcases/commands/logrotate/logrotate_tests.sh
+++ b/testcases/commands/logrotate/logrotate_tests.sh
@@ -28,11 +28,11 @@
 #                logfile is set for rotation every week. Execute the command
 #                logrotate -f <file.conf>, check to see if it forced rotation.
 #                Test #2: Check if logrotate running as a cronjob will rotate a
-#                logfile when it exceeds a specific size. Create two cronjobs 
+#                logfile when it exceeds a specific size. Create two cronjobs
 #                1. runs a command to log a string to a logfile. 2. runs
 #                logrotate <file.conf> every minute. The conf file specifies
 #                that the rotation happen only if the log file exceeds 2k file
-#                size. 
+#                size.
 #
 # Author:        Manoj Iyer, manjo@...
 #
@@ -47,7 +47,7 @@
 #
 # Input:        - $1 - calling test case.
 #               - $2 - command that needs to be checked.
-# 
(Continue reading)

Wanlong Gao | 8 Feb 09:21
Favicon

[PATCH v3 0/4] hugemmap: auto mount fix


Hi Caspar, Cyril:

Thanks for Caspar's hard review.
I'd like to be commited on this version. ;-P

this version also remove the -c option in runtest, because
---
The -c option is broken by desing. See:

http://www.mail-archive.com/ltp-list-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f <at> public.gmane.org/msg13418.html

In short don't use it in runtest files as the option will be removed.
---

Below is the test result after patched now.
------------------
<<<test_start>>>
tag=hugemmap01 stime=1328688879
cmdline="hugemmap01"
contacts=""
analysis=exit
<<<test_output>>>
hugemmap01    0  TINFO  :  set nr_hugepages to 1024
hugemmap01    1  TPASS  :  call succeeded
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no
cutime=0 cstime=1
<<<test_end>>>
(Continue reading)

Shang Yanfeng | 8 Feb 09:13
Favicon

[PATCH 1/2] updated mmap2.c for low memory target

many low memory boards don't have 1G memory,so add get_free_mem
function for low memory target, limit 3000M for 64bit kernel with
n32 file system.

Signed-off-by: Shang Yanfeng <YanFeng.Shang@...>
---
 testcases/kernel/mem/mtest06/mmap2.c |   50 ++++++++++++++++++++++++++-------
 1 files changed, 39 insertions(+), 11 deletions(-)

diff --git a/testcases/kernel/mem/mtest06/mmap2.c b/testcases/kernel/mem/mtest06/mmap2.c
index 6d56a54..18c2b07 100644
--- a/testcases/kernel/mem/mtest06/mmap2.c
+++ b/testcases/kernel/mem/mtest06/mmap2.c
@@ -68,13 +68,14 @@
 #include <signal.h>
 #include <sys/time.h>
 #include <sys/wait.h>
+#include <sys/sysinfo.h>
 #include <signal.h>
 #include <string.h>
 #include <getopt.h>
 #include "test.h"
 #include "usctest.h"

-#define GB 1000000000
+#define MB 1048576
 #ifndef TRUE
 #define TRUE 1
 #endif
@@ -100,7 +101,7 @@ static int mkfile(int size)
(Continue reading)


Gmane