How To Install golang-github-hodgesds-perf-utils-devel on Fedora 36

In this tutorial we learn how to install golang-github-hodgesds-perf-utils-devel in Fedora 36. golang-github-hodgesds-perf-utils-devel is Perf Utilities for Go

Introduction

In this tutorial we learn how to install golang-github-hodgesds-perf-utils-devel on Fedora 36.

What is golang-github-hodgesds-perf-utils-devel

This package is a go library for interacting with the perf subsystem in Linux. I had trouble finding a golang perf library so I decided to write this by using the linux’s perf as a reference. This library allows you to do things like see how many CPU instructions a function takes (roughly), profile a process for various hardware events, and other interesting things. Note that because the go scheduler can schedule a goroutine across many OS threads it becomes rather difficult to get an exact profile of an invididual goroutine. However, a few tricks can be used; first a call to runtime.LockOSThread to lock the current goroutine to an OS thread. Second a call to unix.SchedSetaffinity, with a CPU set mask set. Note that if the pid argument is set 0 the calling thread is used (the thread that was just locked). Before using this library you should probably read the perf_event_open man page which this library uses heavily. See this kernel guide for a tutorial how to use perf and some of the limitations. This package contains the source code needed for building packages that reference the following Go import paths – github.com/hodgesds/perf-utils

We can use yum or dnf to install golang-github-hodgesds-perf-utils-devel on Fedora 36. In this tutorial we discuss both methods but you only need to choose one of method to install golang-github-hodgesds-perf-utils-devel.

Install golang-github-hodgesds-perf-utils-devel on Fedora 36 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install golang-github-hodgesds-perf-utils-devel using dnf by running the following command:

sudo dnf -y install golang-github-hodgesds-perf-utils-devel

Install golang-github-hodgesds-perf-utils-devel on Fedora 36 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install golang-github-hodgesds-perf-utils-devel using yum by running the following command:

sudo yum -y install golang-github-hodgesds-perf-utils-devel

How To Uninstall golang-github-hodgesds-perf-utils-devel on Fedora 36

To uninstall only the golang-github-hodgesds-perf-utils-devel package we can use the following command:

sudo dnf remove golang-github-hodgesds-perf-utils-devel

golang-github-hodgesds-perf-utils-devel Package Contents on Fedora 36

/usr/share/doc/golang-github-hodgesds-perf-utils-devel
/usr/share/doc/golang-github-hodgesds-perf-utils-devel/README.md
/usr/share/gocode/src/github.com
/usr/share/gocode/src/github.com/hodgesds
/usr/share/gocode/src/github.com/hodgesds/perf-utils
/usr/share/gocode/src/github.com/hodgesds/perf-utils/.goipath
/usr/share/gocode/src/github.com/hodgesds/perf-utils/README.md
/usr/share/gocode/src/github.com/hodgesds/perf-utils/bpf.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/cache_profiler.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/cache_profiler_test.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/events.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/events_test.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/fs_utils.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/fs_utils_test.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/go.mod
/usr/share/gocode/src/github.com/hodgesds/perf-utils/group_profiler.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/group_profiler_test.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/hardware_profiler.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/hardware_profiler_test.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr/skylake
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr/skylake/skylake_msr.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr/skylake/skylake_msr_test.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr/zen
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr/zen/zen_msr.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr/zen2
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr/zen2/zen2_msr.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr/zen3
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr/zen3/zen3_msr.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/msr_test.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/pmu.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/pmu_test.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/process_profile.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/process_profile_test.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/software_profiler.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/software_profiler_test.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/utils.go
/usr/share/gocode/src/github.com/hodgesds/perf-utils/utils_test.go
/usr/share/licenses/golang-github-hodgesds-perf-utils-devel
/usr/share/licenses/golang-github-hodgesds-perf-utils-devel/LICENSE

References

Summary

In this tutorial we learn how to install golang-github-hodgesds-perf-utils-devel on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).