Hi Vince,

Firstly, thanks very much for your answers!

The following is adding ":u" output:

[root@dl380gen8snbjbb test]# perf stat -a -e "r81d0:u","r82d0:u" ./a

 Performance counter stats for './a':

        70,089,261 r81d0:u
         [100.00%]
        20,012,002 r82d0:u

       0.036274699 seconds time elapsed

Compared with the previous output, the numbers decrease drastically
(For load instruction: 89,261 vs 1,779,954; store instruction: 12,002
vs 6,601,675). This time, I think the more load/store instructions
(70,089,261 vs 70,000,000, 20,012,002 vs 20,000,000) are from bash
executing the whole command(perf stat -a -e "r81d0:u","r82d0:u"
./a):parse the command, fork process, etc.

 Is my thought right? Please help to give some comments, thanks very
much in advance!

Best Regards
Nan Xiao

On Tue, Mar 10, 2015 at 9:02 PM, Vince Weaver <[email protected]> wrote:
> On Tue, 10 Mar 2015, Nan Xiao wrote:
>
>> I can't understand why there are so many more load/store operations
>> from "perf stat" output. Could anyone can explain this? Thanks very
>> much in advance!
>
> there are a lot of reasons you might get overcount, but in this particular
> case it looks like you are probably counting kernel events too.  Do things
> get better if you put ":u" on your event names so that you only count user
> events?
>
> Vince



-- 
Best Regards
Nan Xiao
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to