Skip to main content
7 events
when toggle format what by license comment
2 days ago comment added ilnurKh yes, some other actions can explain constant diff, but not the multiplication
Apr 28 at 5:54 comment added singhatulks There is lot more that happened in the process than just the loop in your code. First ld had to load your binary and the shared libraries. Then you are also calling shared lib functions. So it makes sense that it's much higher than the number of iterations in your code. P.S. As an answer in related question suggested by SO says, use perf_event_open.
Apr 26 at 15:13 history edited RKou CC BY-SA 4.0
edited body
Apr 25 at 18:48 comment added o11c I've found perf to be one of the buggiest parts of the kernel - it's extremely hardware-dependent, and I suspect something about it's not getting saved/restored properly when rescheduling happens (which is pretty frequent). It's quite possible that the recorded stats are actually a mix of your process and some other process (including the idle process) or kernel interrupts or ...
Apr 25 at 17:14 comment added Barmar I suspect this has something to do with hardware branch prediction.
S Apr 25 at 13:04 review First questions
Apr 25 at 15:06
S Apr 25 at 13:04 history asked ilnurKh CC BY-SA 4.0