Fix the CPU timer and clock comparator output for the "bt -a" command

on S390X machines.  The output of CPU timer and clock comparator has
always been incorrect because:
  - We added S390X_WORD_SIZE (8) instead of 4 to get the second word
  - We did not left shift the clock comparator by 8
The fix gets the complete 64 bit values and by shifting the clock
comparator correctly.
(holzheu@linux.vnet.ibm.com)
This commit is contained in:
Dave Anderson 2014-09-12 15:13:25 -04:00
parent 1aeeb2a5ae
commit df8d23ff21

14
s390x.c
View File

@ -1243,14 +1243,16 @@ s390x_print_lowcore(char* lc, struct bt_info *bt,int show_symbols)
fprintf(fp," -prefix : %#010lx\n", tmp[0]);
ptr = lc + MEMBER_OFFSET(lc_struct, "cpu_timer_save_area");
tmp[0]=UINT(ptr);
tmp[1]=UINT(ptr + S390X_WORD_SIZE);
fprintf(fp," -cpu timer: %#010lx %#010lx\n", tmp[0],tmp[1]);
tmp[0]=ULONG(ptr);
fprintf(fp," -cpu timer: %#018lx\n", tmp[0]);
ptr = lc + MEMBER_OFFSET(lc_struct, "clock_comp_save_area");
tmp[0]=UINT(ptr);
tmp[1]=UINT(ptr + S390X_WORD_SIZE);
fprintf(fp," -clock cmp: %#010lx %#010lx\n", tmp[0], tmp[1]);
/*
* Shift clock comparator by 8 because we got bit positions 0-55
* in byte 1 to 8. The first byte is always zero.
*/
tmp[0]=ULONG(ptr) << 8;
fprintf(fp," -clock cmp: %#018lx\n", tmp[0]);
fprintf(fp," -general registers:\n");
ptr = lc + MEMBER_OFFSET(lc_struct, "gpregs_save_area");