A tool based on eBPF to find out scalability bottlenecks in kernel.
You have to install bcc to run the script.
sudo apt-get install bpfcc-tools linux-headers-$(uname -r)
refer How to install bcc if needed.
Then you can run the script using
sudo python lockstat.py --time 10
The above command traces locks for 10 seconds and generates an HTML report in the end. If you want to add or remove locks that are being monitored, edit the list "locks" in the script.
Refer the blog post Building usefull tools with eBPF: Part2 Tracing the Locks in Linux Kernel to read more about the script.