diff options
-rw-r--r-- | arch/s390/include/asm/timex.h | 8 | ||||
-rw-r--r-- | arch/s390/kernel/debug.c | 8 | ||||
-rw-r--r-- | arch/s390/kernel/time.c | 1 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.c | 19 |
4 files changed, 13 insertions, 23 deletions
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h index cc21e3e20fd7..a07e699bb65c 100644 --- a/arch/s390/include/asm/timex.h +++ b/arch/s390/include/asm/timex.h | |||
@@ -88,6 +88,14 @@ int get_sync_clock(unsigned long long *clock); | |||
88 | void init_cpu_timer(void); | 88 | void init_cpu_timer(void); |
89 | unsigned long long monotonic_clock(void); | 89 | unsigned long long monotonic_clock(void); |
90 | 90 | ||
91 | void tod_to_timeval(__u64, struct timespec *); | ||
92 | |||
93 | static inline | ||
94 | void stck_to_timespec(unsigned long long stck, struct timespec *ts) | ||
95 | { | ||
96 | tod_to_timeval(stck - TOD_UNIX_EPOCH, ts); | ||
97 | } | ||
98 | |||
91 | extern u64 sched_clock_base_cc; | 99 | extern u64 sched_clock_base_cc; |
92 | 100 | ||
93 | #endif | 101 | #endif |
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index be8bceaf37d9..4c512561687d 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
@@ -63,8 +63,6 @@ typedef struct | |||
63 | } debug_sprintf_entry_t; | 63 | } debug_sprintf_entry_t; |
64 | 64 | ||
65 | 65 | ||
66 | extern void tod_to_timeval(uint64_t todval, struct timespec *xtime); | ||
67 | |||
68 | /* internal function prototyes */ | 66 | /* internal function prototyes */ |
69 | 67 | ||
70 | static int debug_init(void); | 68 | static int debug_init(void); |
@@ -1450,17 +1448,13 @@ debug_dflt_header_fn(debug_info_t * id, struct debug_view *view, | |||
1450 | int area, debug_entry_t * entry, char *out_buf) | 1448 | int area, debug_entry_t * entry, char *out_buf) |
1451 | { | 1449 | { |
1452 | struct timespec time_spec; | 1450 | struct timespec time_spec; |
1453 | unsigned long long time; | ||
1454 | char *except_str; | 1451 | char *except_str; |
1455 | unsigned long caller; | 1452 | unsigned long caller; |
1456 | int rc = 0; | 1453 | int rc = 0; |
1457 | unsigned int level; | 1454 | unsigned int level; |
1458 | 1455 | ||
1459 | level = entry->id.fields.level; | 1456 | level = entry->id.fields.level; |
1460 | time = entry->id.stck; | 1457 | stck_to_timespec(entry->id.stck, &time_spec); |
1461 | /* adjust todclock to 1970 */ | ||
1462 | time -= 0x8126d60e46000000LL - (0x3c26700LL * 1000000 * 4096); | ||
1463 | tod_to_timeval(time, &time_spec); | ||
1464 | 1458 | ||
1465 | if (entry->id.fields.exception) | 1459 | if (entry->id.fields.exception) |
1466 | except_str = "*"; | 1460 | except_str = "*"; |
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index d4c8e9c47c81..9693d98d4d4a 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c | |||
@@ -90,6 +90,7 @@ void tod_to_timeval(__u64 todval, struct timespec *xtime) | |||
90 | todval -= (sec * 1000000) << 12; | 90 | todval -= (sec * 1000000) << 12; |
91 | xtime->tv_nsec = ((todval * 1000) >> 12); | 91 | xtime->tv_nsec = ((todval * 1000) >> 12); |
92 | } | 92 | } |
93 | EXPORT_SYMBOL(tod_to_timeval); | ||
93 | 94 | ||
94 | void clock_comparator_work(void) | 95 | void clock_comparator_work(void) |
95 | { | 96 | { |
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index c066428b2878..215b70749e95 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c | |||
@@ -38,19 +38,6 @@ static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len, | |||
38 | } | 38 | } |
39 | } | 39 | } |
40 | 40 | ||
41 | /* FIXME: this duplicate this code in s390 debug feature */ | ||
42 | static void zfcp_dbf_timestamp(unsigned long long stck, struct timespec *time) | ||
43 | { | ||
44 | unsigned long long sec; | ||
45 | |||
46 | stck -= 0x8126d60e46000000LL - (0x3c26700LL * 1000000 * 4096); | ||
47 | sec = stck >> 12; | ||
48 | do_div(sec, 1000000); | ||
49 | time->tv_sec = sec; | ||
50 | stck -= (sec * 1000000) << 12; | ||
51 | time->tv_nsec = ((stck * 1000) >> 12); | ||
52 | } | ||
53 | |||
54 | static void zfcp_dbf_tag(char **p, const char *label, const char *tag) | 41 | static void zfcp_dbf_tag(char **p, const char *label, const char *tag) |
55 | { | 42 | { |
56 | int i; | 43 | int i; |
@@ -107,7 +94,7 @@ static int zfcp_dbf_view_header(debug_info_t *id, struct debug_view *view, | |||
107 | char *p = out_buf; | 94 | char *p = out_buf; |
108 | 95 | ||
109 | if (strncmp(dump->tag, "dump", ZFCP_DBF_TAG_SIZE) != 0) { | 96 | if (strncmp(dump->tag, "dump", ZFCP_DBF_TAG_SIZE) != 0) { |
110 | zfcp_dbf_timestamp(entry->id.stck, &t); | 97 | stck_to_timespec(entry->id.stck, &t); |
111 | zfcp_dbf_out(&p, "timestamp", "%011lu:%06lu", | 98 | zfcp_dbf_out(&p, "timestamp", "%011lu:%06lu", |
112 | t.tv_sec, t.tv_nsec); | 99 | t.tv_sec, t.tv_nsec); |
113 | zfcp_dbf_out(&p, "cpu", "%02i", entry->id.fields.cpuid); | 100 | zfcp_dbf_out(&p, "cpu", "%02i", entry->id.fields.cpuid); |
@@ -320,7 +307,7 @@ static void zfcp_dbf_hba_view_response(char **p, | |||
320 | zfcp_dbf_out(p, "fsf_command", "0x%08x", r->fsf_command); | 307 | zfcp_dbf_out(p, "fsf_command", "0x%08x", r->fsf_command); |
321 | zfcp_dbf_out(p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); | 308 | zfcp_dbf_out(p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); |
322 | zfcp_dbf_out(p, "fsf_seqno", "0x%08x", r->fsf_seqno); | 309 | zfcp_dbf_out(p, "fsf_seqno", "0x%08x", r->fsf_seqno); |
323 | zfcp_dbf_timestamp(r->fsf_issued, &t); | 310 | stck_to_timespec(r->fsf_issued, &t); |
324 | zfcp_dbf_out(p, "fsf_issued", "%011lu:%06lu", t.tv_sec, t.tv_nsec); | 311 | zfcp_dbf_out(p, "fsf_issued", "%011lu:%06lu", t.tv_sec, t.tv_nsec); |
325 | zfcp_dbf_out(p, "fsf_prot_status", "0x%08x", r->fsf_prot_status); | 312 | zfcp_dbf_out(p, "fsf_prot_status", "0x%08x", r->fsf_prot_status); |
326 | zfcp_dbf_out(p, "fsf_status", "0x%08x", r->fsf_status); | 313 | zfcp_dbf_out(p, "fsf_status", "0x%08x", r->fsf_status); |
@@ -976,7 +963,7 @@ static int zfcp_dbf_scsi_view_format(debug_info_t *id, struct debug_view *view, | |||
976 | zfcp_dbf_out(&p, "old_fsf_reqid", "0x%0Lx", r->old_fsf_reqid); | 963 | zfcp_dbf_out(&p, "old_fsf_reqid", "0x%0Lx", r->old_fsf_reqid); |
977 | zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); | 964 | zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); |
978 | zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno); | 965 | zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno); |
979 | zfcp_dbf_timestamp(r->fsf_issued, &t); | 966 | stck_to_timespec(r->fsf_issued, &t); |
980 | zfcp_dbf_out(&p, "fsf_issued", "%011lu:%06lu", t.tv_sec, t.tv_nsec); | 967 | zfcp_dbf_out(&p, "fsf_issued", "%011lu:%06lu", t.tv_sec, t.tv_nsec); |
981 | 968 | ||
982 | if (strncmp(r->tag, "rslt", ZFCP_DBF_TAG_SIZE) == 0) { | 969 | if (strncmp(r->tag, "rslt", ZFCP_DBF_TAG_SIZE) == 0) { |