https://sourceware.org/bugzilla/show_bug.cgi?id=29631
Bug ID: 29631 Summary: [display text] Incorrect percentages shown in the source and disassembly output Product: binutils Version: 2.39 Status: NEW Severity: normal Priority: P2 Component: gprofng Assignee: vladimir.mezentsev at oracle dot com Reporter: ruud.vanderpas at oracle dot com Target Milestone: --- Created attachment 14366 --> https://sourceware.org/bugzilla/attachment.cgi?id=14366&action=edit The experiment directory used to produce the output given The source and disassembly output gives a value of 0. for the percentages of all the metrics. Attached is an experiment directory that was used to verify this issue. I also include the output below. The following command was used to generate this output: $ gprofng display text -source mxv_core -dis mxv_core test.1.er ========= Source file: /home/opc/00.dev/experiments/mxv/src/mxv.c Object file: mxv-pthreads.exe (found as test.1.er/archives/mxv-pthreads.exe__wAocSNXHc8) Load Object: mxv-pthreads.exe (found as test.1.er/archives/mxv-pthreads.exe__wAocSNXHc8) Excl. Total Incl. Total CPU CPU sec. % sec. % 1. #include "mydefs.h" 2. <Function: driver_mxv> 0. 0. 0. 0. 3. void *driver_mxv(void *thread_arguments) 0. 0. 0. 0. 4. { 0. 0. 0. 0. 5. thread_data *local_data; 6. 0. 0. 0. 0. 7. local_data = (thread_data *) thread_arguments; 8. 0. 0. 0. 0. 9. bool do_work = local_data->do_work; 0. 0. 0. 0. 10. int64_t repeat_count = local_data->repeat_count; 0. 0. 0. 0. 11. uint64_t row_index_start = local_data->row_index_start; 0. 0. 0. 0. 12. uint64_t row_index_end = local_data->row_index_end; 0. 0. 0. 0. 13. uint64_t m = local_data->m; 0. 0. 0. 0. 14. uint64_t n = local_data->n; 0. 0. 0. 0. 15. double *b = local_data->b; 0. 0. 0. 0. 16. double *c = local_data->c; 0. 0. 0. 0. 17. double **A = local_data->A; 18. 0. 0. 0. 0. 19. if (do_work) { 0. 0. 0. 0. 20. for (int64_t r=0; r<repeat_count; r++) { ## 0. 0. 11.548 0. 21. (void) mxv_core(row_index_start, row_index_end, m, n, A, b, c); 22. } 23. } 24. 0. 0. 0. 0. 25. return(0); 0. 0. 0. 0. 26. } 27. 28. /* 29. * Disable inlining to avoid the repeat count loop is removed by the compiler 30. */ 31. <Function: mxv_core> 0. 0. 0. 0. 32. void __attribute__ ((noinline)) mxv_core(uint64_t row_index_start, uint64_t row_index_end, uint64_t m, uint64_t n, double **restrict A, double *restrict b, double *restrict c) 0. 0. 0. 0. 33. { 0. 0. 0. 0. 34. for (uint64_t i=row_index_start; i<=row_index_end; i++) { 0. 0. 0. 0. 35. double row_sum = 0.0; ## 5.904 0. 5.904 0. 36. for (int64_t j=0; j<n; j++) ## 5.644 0. 5.644 0. 37. row_sum += A[i][j] * b[j]; 0. 0. 0. 0. 38. c[i] = row_sum; 39. } 0. 0. 0. 0. 40. } Source file: /home/opc/00.dev/experiments/mxv/src/mxv.c Object file: mxv-pthreads.exe (found as test.1.er/archives/mxv-pthreads.exe__wAocSNXHc8) Load Object: mxv-pthreads.exe (found as test.1.er/archives/mxv-pthreads.exe__wAocSNXHc8) Excl. Total Incl. Total CPU CPU sec. % sec. % 1. #include "mydefs.h" 2. 3. void *driver_mxv(void *thread_arguments) 4. { 5. thread_data *local_data; 6. 7. local_data = (thread_data *) thread_arguments; 8. 9. bool do_work = local_data->do_work; 10. int64_t repeat_count = local_data->repeat_count; 11. uint64_t row_index_start = local_data->row_index_start; 12. uint64_t row_index_end = local_data->row_index_end; 13. uint64_t m = local_data->m; 14. uint64_t n = local_data->n; 15. double *b = local_data->b; 16. double *c = local_data->c; 17. double **A = local_data->A; 18. 19. if (do_work) { 20. for (int64_t r=0; r<repeat_count; r++) { 21. (void) mxv_core(row_index_start, row_index_end, m, n, A, b, c); 22. } 23. } 24. 25. return(0); 26. } 27. 28. /* 29. * Disable inlining to avoid the repeat count loop is removed by the compiler 30. */ 31. 32. void __attribute__ ((noinline)) mxv_core(uint64_t row_index_start, uint64_t row_index_end, uint64_t m, uint64_t n, double **restrict A, double *restrict b, double *restrict c) 33. { <Function: mxv_core> 0. 0. 0. 0. [33] 4021ae: mov 0x8(%rsp),%r10 34. for (uint64_t i=row_index_start; i<=row_index_end; i++) { 0. 0. 0. 0. [34] 4021b3: cmp %rsi,%rdi 0. 0. 0. 0. [34] 4021b6: jbe 0x37 0. 0. 0. 0. [34] 4021b8: ret 35. double row_sum = 0.0; 36. for (int64_t j=0; j<n; j++) 37. row_sum += A[i][j] * b[j]; 0. 0. 0. 0. [37] 4021b9: mov (%r8,%rdi,8),%rdx 0. 0. 0. 0. [36] 4021bd: mov $0x0,%eax 0. 0. 0. 0. [35] 4021c2: pxor %xmm1,%xmm1 0.020 0. 0.020 0. [37] 4021c6: movsd (%rdx,%rax,8),%xmm0 2.832 0. 2.832 0. [37] 4021cb: mulsd (%r9,%rax,8),%xmm0 2.792 0. 2.792 0. [37] 4021d1: addsd %xmm0,%xmm1 ## 5.904 0. 5.904 0. [36] 4021d5: add $0x1,%rax 0. 0. 0. 0. [36] 4021d9: cmp %rax,%rcx 0. 0. 0. 0. [36] 4021dc: jne 0xffffffffffffffea 38. c[i] = row_sum; 0. 0. 0. 0. [38] 4021de: movsd %xmm1,(%r10,%rdi,8) 0. 0. 0. 0. [34] 4021e4: add $0x1,%rdi 0. 0. 0. 0. [34] 4021e8: cmp %rdi,%rsi 0. 0. 0. 0. [34] 4021eb: jb 0xd 0. 0. 0. 0. [35] 4021ed: pxor %xmm1,%xmm1 0. 0. 0. 0. [36] 4021f1: test %rcx,%rcx 0. 0. 0. 0. [36] 4021f4: jne 0xffffffffffffffc5 0. 0. 0. 0. [36] 4021f6: jmp 0xffffffffffffffe8 39. } 40. } 0. 0. 0. 0. [40] 4021f8: ret -- You are receiving this mail because: You are on the CC list for the bug.