|
2 | 2 | /*
|
3 | 3 | * S/390 debug facility
|
4 | 4 | *
|
5 |
| - * Copyright IBM Corp. 1999, 2012 |
| 5 | + * Copyright IBM Corp. 1999, 2020 |
6 | 6 | *
|
7 | 7 | * Author(s): Michael Holzheu ([email protected]),
|
8 | 8 | * Holger Smolinski ([email protected])
|
@@ -433,7 +433,7 @@ static int debug_format_entry(file_private_info_t *p_info)
|
433 | 433 | act_entry = (debug_entry_t *) ((char *)id_snap->areas[p_info->act_area]
|
434 | 434 | [p_info->act_page] + p_info->act_entry);
|
435 | 435 |
|
436 |
| - if (act_entry->id.stck == 0LL) |
| 436 | + if (act_entry->clock == 0LL) |
437 | 437 | goto out; /* empty entry */
|
438 | 438 | if (view->header_proc)
|
439 | 439 | len += view->header_proc(id_snap, view, p_info->act_area,
|
@@ -829,12 +829,17 @@ static inline debug_entry_t *get_active_entry(debug_info_t *id)
|
829 | 829 | static inline void debug_finish_entry(debug_info_t *id, debug_entry_t *active,
|
830 | 830 | int level, int exception)
|
831 | 831 | {
|
832 |
| - active->id.stck = get_tod_clock_fast() - |
833 |
| - *(unsigned long long *) &tod_clock_base[1]; |
834 |
| - active->id.fields.cpuid = smp_processor_id(); |
| 832 | + unsigned char clk[STORE_CLOCK_EXT_SIZE]; |
| 833 | + unsigned long timestamp; |
| 834 | + |
| 835 | + get_tod_clock_ext(clk); |
| 836 | + timestamp = *(unsigned long *) &clk[0] >> 4; |
| 837 | + timestamp -= TOD_UNIX_EPOCH >> 12; |
| 838 | + active->clock = timestamp; |
| 839 | + active->cpu = smp_processor_id(); |
835 | 840 | active->caller = __builtin_return_address(0);
|
836 |
| - active->id.fields.exception = exception; |
837 |
| - active->id.fields.level = level; |
| 841 | + active->exception = exception; |
| 842 | + active->level = level; |
838 | 843 | proceed_active_entry(id);
|
839 | 844 | if (exception)
|
840 | 845 | proceed_active_area(id);
|
@@ -1398,25 +1403,24 @@ static int debug_hex_ascii_format_fn(debug_info_t *id, struct debug_view *view,
|
1398 | 1403 | int debug_dflt_header_fn(debug_info_t *id, struct debug_view *view,
|
1399 | 1404 | int area, debug_entry_t *entry, char *out_buf)
|
1400 | 1405 | {
|
1401 |
| - unsigned long base, sec, usec; |
| 1406 | + unsigned long sec, usec; |
1402 | 1407 | unsigned long caller;
|
1403 | 1408 | unsigned int level;
|
1404 | 1409 | char *except_str;
|
1405 | 1410 | int rc = 0;
|
1406 | 1411 |
|
1407 |
| - level = entry->id.fields.level; |
1408 |
| - base = (*(unsigned long *) &tod_clock_base[0]) >> 4; |
1409 |
| - sec = (entry->id.stck >> 12) + base - (TOD_UNIX_EPOCH >> 12); |
| 1412 | + level = entry->level; |
| 1413 | + sec = entry->clock; |
1410 | 1414 | usec = do_div(sec, USEC_PER_SEC);
|
1411 | 1415 |
|
1412 |
| - if (entry->id.fields.exception) |
| 1416 | + if (entry->exception) |
1413 | 1417 | except_str = "*";
|
1414 | 1418 | else
|
1415 | 1419 | except_str = "-";
|
1416 | 1420 | caller = (unsigned long) entry->caller;
|
1417 |
| - rc += sprintf(out_buf, "%02i %011ld:%06lu %1u %1s %02i %pK ", |
| 1421 | + rc += sprintf(out_buf, "%02i %011ld:%06lu %1u %1s %04u %pK ", |
1418 | 1422 | area, sec, usec, level, except_str,
|
1419 |
| - entry->id.fields.cpuid, (void *)caller); |
| 1423 | + entry->cpu, (void *)caller); |
1420 | 1424 | return rc;
|
1421 | 1425 | }
|
1422 | 1426 | EXPORT_SYMBOL(debug_dflt_header_fn);
|
|
0 commit comments