summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/util.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-04-19 16:12:39 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-04-20 13:22:44 -0300
commitc5e4027e056c3027f682f0d69fe9fd75083b65f8 (patch)
tree19c278858df6393728458f22cb4c8dc71a746788 /tools/perf/util/util.c
parent58db1d6e7d5d24afa2d32e916fd6f6b6d240ba93 (diff)
downloadop-kernel-dev-c5e4027e056c3027f682f0d69fe9fd75083b65f8.zip
op-kernel-dev-c5e4027e056c3027f682f0d69fe9fd75083b65f8.tar.gz
perf tools: Move timestamp routines from util.h to time-utils.h
We already have a header for time utilities, so use it. Link: http://lkml.kernel.org/n/tip-sijzpbvutlg0c3oxn49hy9ca@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util.c')
-rw-r--r--tools/perf/util/util.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 7741d5f..e86dba2 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -381,14 +381,6 @@ void sighandler_dump_stack(int sig)
raise(sig);
}
-int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz)
-{
- u64 sec = timestamp / NSEC_PER_SEC;
- u64 usec = (timestamp % NSEC_PER_SEC) / NSEC_PER_USEC;
-
- return scnprintf(buf, sz, "%"PRIu64".%06"PRIu64, sec, usec);
-}
-
unsigned long parse_tag_value(const char *str, struct parse_tag *tags)
{
struct parse_tag *i = tags;
@@ -692,20 +684,3 @@ out:
return tip;
}
-
-int fetch_current_timestamp(char *buf, size_t sz)
-{
- struct timeval tv;
- struct tm tm;
- char dt[32];
-
- if (gettimeofday(&tv, NULL) || !localtime_r(&tv.tv_sec, &tm))
- return -1;
-
- if (!strftime(dt, sizeof(dt), "%Y%m%d%H%M%S", &tm))
- return -1;
-
- scnprintf(buf, sz, "%s%02u", dt, (unsigned)tv.tv_usec / 10000);
-
- return 0;
-}
OpenPOWER on IntegriCloud