From 0d155048397c88db09a25989450568e25af8f44c Mon Sep 17 00:00:00 2001 From: fche Date: Thu, 11 Aug 2005 16:53:45 +0000 Subject: 2005-08-11 Frank Ch. Eigler * translate.cxx (emit_function): Add an extra { } around the function body visitation. * tapset/timestamp_functions.stp: New file. * tapset/builtin_conversions.stp: Aggregated from [hex]string. * tapset/builtin_logging.stp: Aggregated from log/warn/printk. --- tapset/timestamp_functions.stp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tapset/timestamp_functions.stp (limited to 'tapset/timestamp_functions.stp') diff --git a/tapset/timestamp_functions.stp b/tapset/timestamp_functions.stp new file mode 100644 index 00000000..f8e1ea4e --- /dev/null +++ b/tapset/timestamp_functions.stp @@ -0,0 +1,19 @@ +%{ +#include +%} + +// 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 ... -- cgit