summaryrefslogtreecommitdiffstats
path: root/tapset/timestamp.stp
diff options
context:
space:
mode:
authorfche <fche>2005-09-02 15:54:18 +0000
committerfche <fche>2005-09-02 15:54:18 +0000
commita5a5398e240d39cedb7d944edb833d8449da3e11 (patch)
treef5f615fafadc093c70a6823da2852a698061ef1d /tapset/timestamp.stp
parent86333c5231e7f07ae56443a72155a59aa8dd1ddb (diff)
downloadsystemtap-steved-a5a5398e240d39cedb7d944edb833d8449da3e11.tar.gz
systemtap-steved-a5a5398e240d39cedb7d944edb833d8449da3e11.tar.xz
systemtap-steved-a5a5398e240d39cedb7d944edb833d8449da3e11.zip
2005-09-02 Frank Ch. Eigler <fche@elastic.org>
* tapset/*.stp: Renamed several files to simplify names.
Diffstat (limited to 'tapset/timestamp.stp')
-rw-r--r--tapset/timestamp.stp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp
new file mode 100644
index 00000000..f8e1ea4e
--- /dev/null
+++ b/tapset/timestamp.stp
@@ -0,0 +1,19 @@
+%{
+#include <linux/time.h>
+%}
+
+// return in milliseconds since epoch
+function gettimeofday_ms () %{
+ struct timeval tm;
+ do_gettimeofday (& tm);
+ THIS->__retvalue = (tm.tv_sec * 1000) + (tm.tv_usec / 1000);
+%}
+
+// return in seconds since epoch
+function gettimeofday_s () %{
+ struct timeval tm;
+ do_gettimeofday (& tm);
+ THIS->__retvalue = tm.tv_sec;
+%}
+
+// likewise jiffies, monotonic_clock ...