Nhiều công cụ profiling tốt cho C++ trên Linux. Phổ biến nhất là Valgrind. Công cụ debug bộ nhớ, phát hiện rò rỉ, profiling. Dùng valgrind truyền binary và set tool=callgrind.
$ g++ -o hello hello.cpp $ valgrind --tool=callgrind ./hello
Sinh file callgrind.out.x. Đọc bằng kcachegrind.
Nếu dùng GCC, có công cụ built-in gprof. Dùng khi biên dịch:
$ g++ -o hello hello.cpp -g -pg