Skip to content

Commit

Permalink
Fix the CPU timer and clock comparator output for the "bt -a" command
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Dave Anderson committed Sep 12, 2014
1 parent 1aeeb2a commit df8d23f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions s390x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit df8d23f

Please sign in to comment.