summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/ctime.stp
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-05-21 13:37:07 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-05-21 13:37:07 -0400
commite3339150b3c04f50b0abdc4a6d132a6b75b22cb6 (patch)
treec80892afd79625f95ff0a2543728804464c2961a /testsuite/systemtap.base/ctime.stp
parent332ddc9f7354fe51c32c504087575b3ea2b70990 (diff)
parentaa8a3b1797da54a14d04cd57758a65064056376e (diff)
downloadsystemtap-steved-e3339150b3c04f50b0abdc4a6d132a6b75b22cb6.tar.gz
systemtap-steved-e3339150b3c04f50b0abdc4a6d132a6b75b22cb6.tar.xz
systemtap-steved-e3339150b3c04f50b0abdc4a6d132a6b75b22cb6.zip
Merge commit 'origin/master' into pr6429-comp-unwindsyms
* commit 'origin/master': Fix assignment optimization expected results. PR6538: more testsuite tweaks for read-only warnings PR6538: more tapset fixes PR6538: explain why absentstats.stp logs will contain warnings PR6538: fix treatment of initialized globals Use pointer_arg to fetch arguments for syscall.utime and compat_utime. Optimize compound and binary expression assignments. Check new (sub) functions of _struct_utimbuf_* and _struct_compat_utimbuf_*. PR6538: tapset changes PR6538: testsuite changes PR5001: fix test suite collateral damage PR6538: warn about read-only variables Add some scripts and descriptions to the systemtap.examples. PR5001: Remove _stp_ctime and always use ctime. Use tr1/unordered_map instead of the deprecated ext/hash_map. PR6524: ctime() on bad values hangs system. Optimize away assignments in other contexts. Optimize away assignments in other contexts. dummy commit for testing systemtap-cvs notification Remove sa_restorer initialization.
Diffstat (limited to 'testsuite/systemtap.base/ctime.stp')
-rw-r--r--testsuite/systemtap.base/ctime.stp55
1 files changed, 55 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/ctime.stp b/testsuite/systemtap.base/ctime.stp
new file mode 100644
index 00000000..680baff7
--- /dev/null
+++ b/testsuite/systemtap.base/ctime.stp
@@ -0,0 +1,55 @@
+probe begin
+{
+ // epoch
+ println(ctime(0))
+
+ // epoch - 1
+ println(ctime(-1))
+
+ // epoch + 1
+ println(ctime(1))
+
+ // Some funny numbers
+ println(ctime(100000000))
+ println(ctime(1234567890))
+ println(ctime(1073741824))
+ println(ctime(0x50000000))
+
+ // some time really long ago
+ secspermin = 60
+ minsperhour = 60
+ hoursperday = 24
+ secsperhour = secspermin * minsperhour
+ secsperday = secsperhour * hoursperday
+ epoch_year = 1970
+ time = -1 * (epoch_year - 1000) * 365 * secsperday
+ println(ctime(time))
+
+ // some time in the far future
+ time = (9999 - epoch_year) * 365 * secsperday
+ println(ctime(time))
+
+ // min 32 bit
+ time = -2147483648
+ println(ctime(time))
+
+ // over the edge, a long, long time ago...
+ time--
+ println(ctime(time))
+
+ // max 32 bit
+ time = 2147483647
+ println(ctime(time))
+
+ // over the edge, far far in the future...
+ time++
+ println(ctime(time))
+
+ // min 64 bit
+ println(ctime(-9223372036854775808))
+
+ // max 64 bit
+ println(ctime(9223372036854775807))
+
+ exit()
+}