Discussion:
Intel Ivy Bridge "mem" events not working?
(too old to reply)
Panagiotis Mousouliotis
2016-04-06 15:46:18 UTC
Permalink
Raw Message
Hello,

I installed today oprofile cloning it from the git repository.

When I give the command:

$ ocount -e mem_uops_retired ./convNaive2 0.5 5

I get:

perf_event_open failed with Invalid argument
Caught runtime error while setting up counters
Internal Error. Perf event setup failed.
Error running ocount

I get the same output for all the events starting with "mem".

When I use events that do not start with "mem", it works:
$ ocount -e l2_lines_out ./convNaive2 0.5 5
0.5,5,0.092632

Events were actively counted for 227235819 nanoseconds.
Event counts (actual) for
/home/pmousoul/Desktop/Program_Execution_Performance_Measurement_Tools/code/convNaive2:
Event Count % time counted
l2_lines_out 255,436 100.00

I'm I doing something wrong and I'm just not able to notice it?

My system is:
processor: i5-3337U
kernel version: 3.16.0-67-generic x86_64 GNU/Linux

I tried the oprofile-1.1.0 (tar.gz) version but I got the same results.

Now I'm thinking to test an older kernel on the same machine..

Any thoughts?


Thanks for your time,
Panos
Panagiotis Mousouliotis
2016-04-06 16:06:41 UTC
Permalink
Raw Message
I also get this error when I test with the operf:

$ operf -e mem_uops_retired:2000000 ./convNaive2 0.5 5
Kernel profiling is not possible with current system config.
Set /proc/sys/kernel/kptr_restrict to 0 to collect kernel samples.
perf_event_open failed with Invalid argument
Caught runtime_error: Internal Error. Perf event setup failed.
Error running profiler


-Panos
Post by Panagiotis Mousouliotis
Hello,
I installed today oprofile cloning it from the git repository.
$ ocount -e mem_uops_retired ./convNaive2 0.5 5
perf_event_open failed with Invalid argument
Caught runtime error while setting up counters
Internal Error. Perf event setup failed.
Error running ocount
I get the same output for all the events starting with "mem".
$ ocount -e l2_lines_out ./convNaive2 0.5 5
0.5,5,0.092632
Events were actively counted for 227235819 nanoseconds.
Event counts (actual) for
Event Count % time counted
l2_lines_out 255,436 100.00
I'm I doing something wrong and I'm just not able to notice it?
processor: i5-3337U
kernel version: 3.16.0-67-generic x86_64 GNU/Linux
I tried the oprofile-1.1.0 (tar.gz) version but I got the same results.
Now I'm thinking to test an older kernel on the same machine..
Any thoughts?
Thanks for your time,
Panos
William Cohen
2016-04-06 16:19:43 UTC
Permalink
Raw Message
Post by Panagiotis Mousouliotis
Hello,
I installed today oprofile cloning it from the git repository.
$ ocount -e mem_uops_retired ./convNaive2 0.5 5
perf_event_open failed with Invalid argument
Caught runtime error while setting up counters
Internal Error. Perf event setup failed.
Error running ocount
I get the same output for all the events starting with "mem".
$ ocount -e l2_lines_out ./convNaive2 0.5 5
0.5,5,0.092632
Events were actively counted for 227235819 nanoseconds.
Event Count % time counted
l2_lines_out 255,436 100.00
I'm I doing something wrong and I'm just not able to notice it?
processor: i5-3337U
kernel version: 3.16.0-67-generic x86_64 GNU/Linux
I tried the oprofile-1.1.0 (tar.gz) version but I got the same results.
Now I'm thinking to test an older kernel on the same machine..
Any thoughts?
Hi Panos,

The error message looks like the kernel is rejecting the event number (event 0xd0, default unit mask 0x81). There are certainly cases where the kernel checks the event number and reject it for certain processor family and model numbers. Could you include the family and model information from /proc/cpuinfo?

It looks like these particular events are disabled for Intel Ivybridge:

http://lxr.free-electrons.com/source/arch/x86/kernel/cpu/perf_event_intel.c?v=3.16#L135

134 /*
135 * Errata BV98 -- MEM_*_RETIRED events can leak between counters of SMT
136 * siblings; disable these events because they can corrupt unrelated
137 * counters.
138 */

-Will
Post by Panagiotis Mousouliotis
Thanks for your time,
Panos
------------------------------------------------------------------------------
_______________________________________________
oprofile-list mailing list
https://lists.sourceforge.net/lists/listinfo/oprofile-list
------------------------------------------------------------------------------
Panagiotis Mousouliotis
2016-04-06 16:37:11 UTC
Permalink
Raw Message
Hi William,

thank you very much for your quick answer.

The family and model information for the machine I use are:
cpu family : 6
model : 58

but in any case I attach the output of the "cat /proc/cpuinfo" command.

So, my next move is to try my program on a different machine.

Thanks again,
-Panos
Post by William Cohen
Post by Panagiotis Mousouliotis
Hello,
I installed today oprofile cloning it from the git repository.
$ ocount -e mem_uops_retired ./convNaive2 0.5 5
perf_event_open failed with Invalid argument
Caught runtime error while setting up counters
Internal Error. Perf event setup failed.
Error running ocount
I get the same output for all the events starting with "mem".
$ ocount -e l2_lines_out ./convNaive2 0.5 5
0.5,5,0.092632
Events were actively counted for 227235819 nanoseconds.
Event counts (actual) for
Event Count % time counted
l2_lines_out 255,436 100.00
I'm I doing something wrong and I'm just not able to notice it?
processor: i5-3337U
kernel version: 3.16.0-67-generic x86_64 GNU/Linux
I tried the oprofile-1.1.0 (tar.gz) version but I got the same results.
Now I'm thinking to test an older kernel on the same machine..
Any thoughts?
Hi Panos,
The error message looks like the kernel is rejecting the event number
(event 0xd0, default unit mask 0x81). There are certainly cases where the
kernel checks the event number and reject it for certain processor family
and model numbers. Could you include the family and model information from
/proc/cpuinfo?
http://lxr.free-electrons.com/source/arch/x86/kernel/cpu/perf_event_intel.c?v=3.16#L135
134 /*
135 * Errata BV98 -- MEM_*_RETIRED events can leak between counters of SMT
136 * siblings; disable these events because they can corrupt unrelated
137 * counters.
138 */
-Will
Post by Panagiotis Mousouliotis
Thanks for your time,
Panos
------------------------------------------------------------------------------
Post by Panagiotis Mousouliotis
_______________________________________________
oprofile-list mailing list
https://lists.sourceforge.net/lists/listinfo/oprofile-list
Andi Kleen
2016-04-06 16:08:43 UTC
Permalink
Raw Message
Post by Panagiotis Mousouliotis
Now I'm thinking to test an older kernel on the same machine..
Any thoughts?
These events were disabled between 3.9 and 4.1 in perf due to
a somewhat misguided bug workaround.

It would work with 4.1 or later.

-Andi
--
***@linux.intel.com -- Speaking for myself only

------------------------------------------------------------------------------
Panagiotis Mousouliotis
2016-04-06 16:40:33 UTC
Permalink
Raw Message
Hi Andi,

Thank you very much for your answer!


-Panos
Post by Andi Kleen
Post by Panagiotis Mousouliotis
Now I'm thinking to test an older kernel on the same machine..
Any thoughts?
These events were disabled between 3.9 and 4.1 in perf due to
a somewhat misguided bug workaround.
It would work with 4.1 or later.
-Andi
--
Loading...