# Performance Profiling

**URL:** https://discourse.cmake.org/t/performance-profiling/4913
**Category:** Usage
**Created:** [January 27, 2022, 6:38am UTC](https://discourse.cmake.org/t/performance-profiling/4913 "2022-01-27T06:38:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Giorgi\_Didberidze](https://discourse.cmake.org/user_avatar/discourse.cmake.org/giorgi_didberidze/32/1935_2.png) [@Giorgi\_Didberidze](https://discourse.cmake.org/u/Giorgi_Didberidze)
#### Post date: [January 27, 2022, 6:38am UTC](https://discourse.cmake.org/t/performance-profiling/4913/1 "2022-01-27T06:38:03Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Giorgi\_Didberidze](https://discourse.cmake.org/user_avatar/discourse.cmake.org/giorgi_didberidze/32/1935_2.png) [@Giorgi\_Didberidze](https://discourse.cmake.org/u/Giorgi_Didberidze)
#### Post date: [February 11, 2022, 11:22am UTC](https://discourse.cmake.org/t/performance-profiling/4913/2 "2022-02-11T11:22:21Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 14, 2022, 2:06pm UTC](https://discourse.cmake.org/t/performance-profiling/4913/3 "2022-02-14T14:06:19Z")

</div>

> [@Giorgi\_Didberidze](#):
>
> Is it possible to get the cpu/mem usage info of the whole project?

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.

> [@Giorgi\_Didberidze](#):
>
> As the build is generate by CMake which profiler should I use for functional performance analysis?

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

> [@Giorgi\_Didberidze](#):
>
> I would like to link google perf tools to Cmake project. Could you please help me with that?

It looks like there’s a `.pc` file for `gperftools`. I would recommend using [`FindPkgConfig`](https://cmake.org/cmake/help/latest/module/FindPkgConfig.html) to find and use it.
