Commit a5dec557 authored by Li Zefan's avatar Li Zefan Committed by Ingo Molnar

tracing: use macros to denote usec and nsec per second

Impact: cleanup

Use USEC_PER_SEC and NSEC_PER_SEC instead of 1000000 and 1000000000.
Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <49CC7870.9000309@cn.fujitsu.com>
Acked-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 86665c75
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/ftrace.h> #include <linux/ftrace.h>
#include <linux/kallsyms.h> #include <linux/kallsyms.h>
#include <linux/time.h>
#include "trace.h" #include "trace.h"
#include "trace_output.h" #include "trace_output.h"
...@@ -67,7 +68,7 @@ initcall_call_print_line(struct trace_iterator *iter) ...@@ -67,7 +68,7 @@ initcall_call_print_line(struct trace_iterator *iter)
trace_assign_type(field, entry); trace_assign_type(field, entry);
call = &field->boot_call; call = &field->boot_call;
ts = iter->ts; ts = iter->ts;
nsec_rem = do_div(ts, 1000000000); nsec_rem = do_div(ts, NSEC_PER_SEC);
ret = trace_seq_printf(s, "[%5ld.%09ld] calling %s @ %i\n", ret = trace_seq_printf(s, "[%5ld.%09ld] calling %s @ %i\n",
(unsigned long)ts, nsec_rem, call->func, call->caller); (unsigned long)ts, nsec_rem, call->func, call->caller);
...@@ -92,7 +93,7 @@ initcall_ret_print_line(struct trace_iterator *iter) ...@@ -92,7 +93,7 @@ initcall_ret_print_line(struct trace_iterator *iter)
trace_assign_type(field, entry); trace_assign_type(field, entry);
init_ret = &field->boot_ret; init_ret = &field->boot_ret;
ts = iter->ts; ts = iter->ts;
nsec_rem = do_div(ts, 1000000000); nsec_rem = do_div(ts, NSEC_PER_SEC);
ret = trace_seq_printf(s, "[%5ld.%09ld] initcall %s " ret = trace_seq_printf(s, "[%5ld.%09ld] initcall %s "
"returned %d after %llu msecs\n", "returned %d after %llu msecs\n",
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mmiotrace.h> #include <linux/mmiotrace.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/time.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include "trace.h" #include "trace.h"
...@@ -174,7 +176,7 @@ static enum print_line_t mmio_print_rw(struct trace_iterator *iter) ...@@ -174,7 +176,7 @@ static enum print_line_t mmio_print_rw(struct trace_iterator *iter)
struct mmiotrace_rw *rw; struct mmiotrace_rw *rw;
struct trace_seq *s = &iter->seq; struct trace_seq *s = &iter->seq;
unsigned long long t = ns2usecs(iter->ts); unsigned long long t = ns2usecs(iter->ts);
unsigned long usec_rem = do_div(t, 1000000ULL); unsigned long usec_rem = do_div(t, USEC_PER_SEC);
unsigned secs = (unsigned long)t; unsigned secs = (unsigned long)t;
int ret = 1; int ret = 1;
...@@ -221,7 +223,7 @@ static enum print_line_t mmio_print_map(struct trace_iterator *iter) ...@@ -221,7 +223,7 @@ static enum print_line_t mmio_print_map(struct trace_iterator *iter)
struct mmiotrace_map *m; struct mmiotrace_map *m;
struct trace_seq *s = &iter->seq; struct trace_seq *s = &iter->seq;
unsigned long long t = ns2usecs(iter->ts); unsigned long long t = ns2usecs(iter->ts);
unsigned long usec_rem = do_div(t, 1000000ULL); unsigned long usec_rem = do_div(t, USEC_PER_SEC);
unsigned secs = (unsigned long)t; unsigned secs = (unsigned long)t;
int ret; int ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment