Example 1
Add -pg
arm-linux-gnueabihf-g++ -Wall -g -pg hello.cpp -o hello -std=c++17
Test
[email protected]:~# gprof -b hello
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
100.00 3.45 3.45 1 3.45 3.45 hehe()
0.00 3.45 0.00 4 0.00 0.00 std::_Optional_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::_M_is_engaged() const
......
arm-linux-gnueabihf-g++ -Wall -g -pg hello.cpp -o hello -std=c++17
[email protected]:~# gprof -b hello
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
100.00 3.45 3.45 1 3.45 3.45 hehe()
0.00 3.45 0.00 4 0.00 0.00 std::_Optional_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::_M_is_engaged() const
......