Performance Profiling

Hello. I would like to know what profiling tools I should use in order to get the performance analysis of CMake project. The project is written in several languages, as a result there are several control files to inspect. Is it possible to get the cpu/mem usage info of the whole project?
The second part is to profile the functions used in specific unit/feature test .c files. As the build is generate by CMake which profiler should I use for functional performance analysis?

Update: I would like to link google perf tools to Cmake project. Could you please help me with that?

There are various tools which can do this, but they are platform-specific. Instruments on macOS and valgrind on Linux would be places to start looking.

Again, this is linked to the platform (or compiler). gperf is fine with GCC or Clang AFAIK.

It looks like there’s a .pc file for gperftools. I would recommend using FindPkgConfig to find and use it.