# Which perf package?

**URL:** https://discourse.nixos.org/t/which-perf-package/22399
**Category:** Uncategorized
**Created:** [October 12, 2022, 10:07am UTC](https://discourse.nixos.org/t/which-perf-package/22399 "2022-10-12T10:07:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bikallem](https://discourse.nixos.org/user_avatar/discourse.nixos.org/bikallem/32/4051_2.png) [@bikallem](https://discourse.nixos.org/u/bikallem)
#### Post date: [October 12, 2022, 10:07am UTC](https://discourse.nixos.org/t/which-perf-package/22399/1 "2022-10-12T10:07:58Z")

</div>

I am on nixos 22.05 and need the `perf` cli tool installed. I did a search on [search.nixos.org](http://search.nixos.org) and I can see a few possible packages. Which one do I install? I have  
`boot.kernelPackages = pkgs.linuxPackages_latest` and want the `perf` cli tool to match it. Is there a meta package that install the correct `perf` tool which matches the kernel version?

---

<div class="post-metadata">

### Author: ![Solene](https://discourse.nixos.org/user_avatar/discourse.nixos.org/solene/32/5738_2.png) [@Solene](https://discourse.nixos.org/u/Solene)
#### Post date: [October 12, 2022, 10:35am UTC](https://discourse.nixos.org/t/which-perf-package/22399/2 "2022-10-12T10:35:27Z")

</div>

perf-tools [https://github.com/NixOS/nixpkgs/blob/e179d1e57ad07f1294dcc29ad5283b214a6ae21e/pkgs/os-specific/linux/perf-tools/default.nix#L41](https://github.com/NixOS/nixpkgs/blob/e179d1e57ad07f1294dcc29ad5283b214a6ae21e/pkgs/os-specific/linux/perf-tools/default.nix#L41) only depend on Perl, so you can use the perf-tools package on any kernel.

---

<div class="post-metadata">

### Author: ![bikallem](https://discourse.nixos.org/user_avatar/discourse.nixos.org/bikallem/32/4051_2.png) [@bikallem](https://discourse.nixos.org/u/bikallem)
#### Post date: [October 12, 2022, 10:55am UTC](https://discourse.nixos.org/t/which-perf-package/22399/3 "2022-10-12T10:55:40Z")

</div>

Thanks. Installed that. However, it `perf` binary wasn’t installed.

---

<div class="post-metadata">

### Author: ![patricksjackson](https://discourse.nixos.org/user_avatar/discourse.nixos.org/patricksjackson/32/35024_2.png) [@patricksjackson](https://discourse.nixos.org/u/patricksjackson)
#### Post date: [October 12, 2022, 4:49pm UTC](https://discourse.nixos.org/t/which-perf-package/22399/4 "2022-10-12T16:49:08Z")

</div>

`perf` is specified as part of the kernel package. I believe what you want is `pkgs.linuxPackages_latest.perf`.

You can get help with finding binaries in nixpkgs using [GitHub - nix-community/nix-index: Quickly locate nix packages with specific files [maintainers=@bennofs @figsoda @raitobezarius]](https://github.com/bennofs/nix-index), or [GitHub - nix-community/comma: Comma runs software without installing it. [maintainers=@Artturin,@burke,@DavHau]](https://github.com/nix-community/comma), or with the `command-not-found` tool in nixos (if on nixos, just enter `perf` at the cmd line).

---

<div class="post-metadata">

### Author: ![trofi](https://discourse.nixos.org/user_avatar/discourse.nixos.org/trofi/32/4814_2.png) [@trofi](https://discourse.nixos.org/u/trofi)
#### Post date: [October 12, 2022, 6:54pm UTC](https://discourse.nixos.org/t/which-perf-package/22399/5 "2022-10-12T18:54:25Z")

</div>

I think you should be able to use `boot.kernelPackages.perf` as is. Otherwise `perf` does not have to match kernel version you run. `linuxPackages_latest.perf` should be safe to use.
