]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Provide test for AT_SUN_SYSSTAT_ADDR emulation.
authorIvo Raisr <ivosh@ivosh.net>
Fri, 25 Sep 2015 20:53:09 +0000 (20:53 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Fri, 25 Sep 2015 20:53:09 +0000 (20:53 +0000)
n-i-bz

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15683

README.solaris
memcheck/tests/solaris/Makefile.am
memcheck/tests/solaris/gethrusec.c [new file with mode: 0644]
memcheck/tests/solaris/gethrusec.stderr.exp [new file with mode: 0644]
memcheck/tests/solaris/gethrusec.stdout.exp [new file with mode: 0644]
memcheck/tests/solaris/gethrusec.vgtest [new file with mode: 0644]

index a4aaf6a22ba5f45dde29aafe6fc3854796a33280..924eb2fcaded26ad1f483583089a7d8b6b342f09 100644 (file)
@@ -130,7 +130,6 @@ TODO list
   to see this in effect. Would require awareness of syscall parameter semantics.
 - Correctly print arguments of DW_CFA_ORCL_arg_loc in show_CF_instruction() when
   it is implemented in libdwarf.
-- Provide tests for AT_SUN_SYSSTAT_ADDR and AT_SUN_SYSSTAT_ZONE_ADDR.
 
 
 Contacts
index 0adfa6a43f5ce320ee6aac44685078d9e72a348a..42397d012ee150c1ad6e501d2d8e33bb9c647373 100644 (file)
@@ -19,6 +19,7 @@ EXTRA_DIST = \
        execx.stderr.exp execx.stdout.exp execx.vgtest \
        getzoneoffset.stderr.exp getzoneoffset.vgtest \
        gethrtime.stderr.exp gethrtime.stdout.exp gethrtime.vgtest \
+       gethrusec.stderr.exp gethrusec.stdout.exp gethrusec.vgtest \
        ldynsym.stderr.exp ldynsym.stdout.exp ldynsym.vgtest \
        lsframe1.stderr.exp lsframe1.stdout.exp lsframe1.vgtest \
        lsframe2.stderr.exp lsframe2.stdout.exp lsframe2.vgtest \
@@ -78,6 +79,10 @@ if SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS
 check_PROGRAMS += execx
 endif
 
+if SOLARIS_RESERVE_SYSSTAT_ADDR
+check_PROGRAMS += gethrusec
+endif
+
 if SOLARIS_GETZONEOFFSET_FASTTRAP
 check_PROGRAMS += getzoneoffset
 endif
diff --git a/memcheck/tests/solaris/gethrusec.c b/memcheck/tests/solaris/gethrusec.c
new file mode 100644 (file)
index 0000000..221cff7
--- /dev/null
@@ -0,0 +1,24 @@
+/* Test for gethrusec which depends on the correct emulation of
+   AT_SUN_SYSSTAT_ADDR in the auxiliary vector. */
+
+#include <stdio.h>
+#include <strings.h>
+#include <sys/system_stats.h>
+
+int main(void)
+{
+   hrtime_t t = 0;
+   get_hrusec(&t);
+   printf("get_hrusec(): %s\n", (t == 0) ? "FAIL" : "PASS");
+
+   memtime_sec_t m = 0;
+   memset(&m, 0, sizeof(m));
+   get_sec_fromepoch(&m);
+   printf("get_sec_fromepoch(): %s\n", (m == 0) ? "FAIL" : "PASS");
+
+   t = 0;
+   get_nsec_fromepoch(&t);
+   printf("get_nsec_fromepoch(): %s\n", (t == 0) ? "FAIL" : "PASS");
+   return 0;
+}
+
diff --git a/memcheck/tests/solaris/gethrusec.stderr.exp b/memcheck/tests/solaris/gethrusec.stderr.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/memcheck/tests/solaris/gethrusec.stdout.exp b/memcheck/tests/solaris/gethrusec.stdout.exp
new file mode 100644 (file)
index 0000000..bac1b83
--- /dev/null
@@ -0,0 +1,3 @@
+get_hrusec(): PASS
+get_sec_fromepoch(): PASS
+get_nsec_fromepoch(): PASS
diff --git a/memcheck/tests/solaris/gethrusec.vgtest b/memcheck/tests/solaris/gethrusec.vgtest
new file mode 100644 (file)
index 0000000..8717ab4
--- /dev/null
@@ -0,0 +1,3 @@
+prereq: test -e gethrusec
+prog: gethrusec
+vgopts: -q