I have the following code:
#include <iostream>
#include <random>
int main() {
std::mt19937_64 rng(std::random_device{}());
std::cout << std::uniform_int_distribution<>(0, 100)(rng) << '\n';
}
I try to profile it using valgrind
, but it says:
vex amd64->IR: unhandled instruction bytes: 0xF 0xC7 0xF0 0x89 0x6 0xF 0x42 0xC1
vex amd64->IR: REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR: VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F
vex amd64->IR: PFX.66=0 PFX.F2=0 PFX.F3=0
==2092== valgrind: Unrecognised instruction at address 0x4cdc1b5.
==2092== at 0x4CDC1B5:std::(anonymous namespace)::__x86_rdrand() (random.cc:69)
==2092== by 0x4CDC321: std::random_device::_M_getval() (random.cc:130)
==2092== by 0x4009D4: main (random.h:1619)
Preceded by multiple instances of:
--2092-- WARNING: Serious error when reading debug info
--2092-- When reading debug info from /lib/x86_64-linux-gnu/ld-2.22.so:
--2092-- Ignoring non-Dwarf2/3/4 block in .debug_info
I am on Debian using standard packages on an x86-64 platform compiling with gcc 5.3.1 using valgrind-3.11.0. The illegal instruction seems to be inside libstdc++6.
How do I get valgrind
to profile my code?