- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to use hardware performance counter to track which branch firefox is taking during execution. The event I am using is TAKEN sub-event in BR_INST_RETIRED. And the tool I am using is Linux perf.
In firefox, there is a piece of code like
if(flag){
..
}else{
..
}
After compiling, the related binary codes looks like:
cmp 0x0, flag
je <========================here
jmp
By loading a special web-page, only if branch is executed. But from the perf report, I find the "je" also causes
BR_INST_RETIRED TAKEN event. I have add some fprintf into both if and
else branch, and I am pretty sure that only if branch is executed.
So this problem is caused by "skid"? or some other reasons causing this problem? I can get which instruction causedBR_INST_RETIRED TAKEN from hardware performance counter, right?
Thanks a lot!
I am trying to use hardware performance counter to track which branch firefox is taking during execution. The event I am using is TAKEN sub-event in BR_INST_RETIRED. And the tool I am using is Linux perf.
In firefox, there is a piece of code like
if(flag){
..
}else{
..
}
After compiling, the related binary codes looks like:
cmp 0x0, flag
je
jmp
By loading a special web-page, only if branch is executed. But from the perf report, I find the "je
So this problem is caused by "skid"? or some other reasons causing this problem? I can get which instruction causedBR_INST_RETIRED TAKEN from hardware performance counter, right?
Thanks a lot!
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you see any counts (e.g. INST_RETIRED) inside either/both sections of the if block?
If the entry into one of the sections is infrequent (e.g. once) you might not catch a count.
Jim Dempsey
If the entry into one of the sections is infrequent (e.g. once) you might not catch a count.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jim,
I can seeINST_RETIRED in the if branch, and noINST_RETIRED in the else branch. This is reasonable, since only if branch is executed.
But in my experiment, I can see "je " instruction cause TAKEN BRAN_INST_RETIRED. Does this show that the else branch will be executed? Actually else branch is not executed.
Thanks a lot!
Linhai
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page