[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-wgfu1h1pnw8lc919o2tan58y@git.kernel.org>
Date: Wed, 24 Aug 2016 02:15:25 -0700
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: rostedt@...dmis.org, namhyung@...nel.org, mingo@...nel.org,
tglx@...utronix.de, acme@...hat.com, wangnan0@...wei.com,
adrian.hunter@...el.com, jolsa@...nel.org,
linux-kernel@...r.kernel.org, dsahern@...il.com, hpa@...or.com
Subject: [tip:perf/core] perf bench sched-pipe: Use linux/time64.h,
USEC_PER_SEC
Commit-ID: 16633ccff091dacb2138b95e8911a1892983c6fd
Gitweb: http://git.kernel.org/tip/16633ccff091dacb2138b95e8911a1892983c6fd
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Mon, 8 Aug 2016 14:51:30 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 23 Aug 2016 15:37:33 -0300
perf bench sched-pipe: Use linux/time64.h, USEC_PER_SEC
Following kernel practices.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-wgfu1h1pnw8lc919o2tan58y@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/bench/sched-pipe.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c
index 1dc2d13..2243f01 100644
--- a/tools/perf/bench/sched-pipe.c
+++ b/tools/perf/bench/sched-pipe.c
@@ -25,6 +25,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/syscall.h>
+#include <linux/time64.h>
#include <pthread.h>
@@ -153,24 +154,24 @@ int bench_sched_pipe(int argc, const char **argv, const char *prefix __maybe_unu
printf("# Executed %d pipe operations between two %s\n\n",
loops, threaded ? "threads" : "processes");
- result_usec = diff.tv_sec * 1000000;
+ result_usec = diff.tv_sec * USEC_PER_SEC;
result_usec += diff.tv_usec;
printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
diff.tv_sec,
- (unsigned long) (diff.tv_usec/1000));
+ (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
printf(" %14lf usecs/op\n",
(double)result_usec / (double)loops);
printf(" %14d ops/sec\n",
(int)((double)loops /
- ((double)result_usec / (double)1000000)));
+ ((double)result_usec / (double)USEC_PER_SEC)));
break;
case BENCH_FORMAT_SIMPLE:
printf("%lu.%03lu\n",
diff.tv_sec,
- (unsigned long) (diff.tv_usec / 1000));
+ (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
break;
default:
Powered by blists - more mailing lists