Guest User

Untitled

a guest
Jun 24th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. perf_ev_read_values(perf_ctr[0]);
  2. for (i = 0; i < 1000; ++i) {
  3. int j;
  4. uint64_t pattern = (random() << 32) | random();
  5. for (j = 0; j < sizeof(random_data) / sizeof(*random_data); ++j)
  6. random_data[j] += pattern;
  7. }
  8. perf_ev_read_values(perf_ctr[1]);
  9. perf_ev_dump(perf_ctr[1], perf_ctr[0]);
  10.  
  11. $ ./bts
  12. Counter 0 (PERF_COUNT_HW_CPU_CYCLES) = 3346189600 with scale factor 0.750343
  13. Counter 1 (PERF_COUNT_HW_CACHE_REFERENCES) = 78374001 with scale factor 0.666576
  14. Counter 2 (PERF_COUNT_HW_CACHE_MISSES) = 23865535 with scale factor 0.749301
  15. Counter 3 (PERF_COUNT_HW_CACHE_L1D:WRITE:MISS) = 131175956 with scale factor 0.749562
  16. Counter 4 (PERF_COUNT_HW_CACHE_L1D:READ:MISS) = 133660840 with scale factor 0.749873
  17. Counter 5 (PERF_COUNT_HW_CACHE_L1D:WRITE:ACCESS) = 639065235 with scale factor 0.750234
  18. Counter 6 (PERF_COUNT_HW_CACHE_L1D:READ:ACCESS) = 240331315 with scale factor 0.750373
  19. Counter 7 (PERF_COUNT_HW_CACHE_L1I:READ:MISS) = 1233104 with scale factor 0.750501
  20. Counter 8 (PERF_COUNT_HW_BUS_CYCLES) = 78916929 with scale factor 0.750348
  21. Counter 9 (PERF_COUNT_HW_BRANCH_MISSES) = 23503 with scale factor 0.666875
  22. Counter 10 (PERF_COUNT_HW_BRANCH_INSTRUCTIONS) = 1060756421 with scale factor 0.666009
  23. Counter 11 (PERF_COUNT_HW_INSTRUCTIONS) = 4268286707 with scale factor 0.749214
Add Comment
Please, Sign In to add comment