# Use debugging tools

This page explains tools that you can use to debug
Container-Optimized OS.

## Run the `perf` tool on Container-Optimized OS

By default, [`perf`](https://perf.wiki.kernel.org/index.php/Main_Page)
is installed on Container-Optimized OS. You can run `perf` on your `cos`
instance from your shell command line.

If you have limited privilege, you might need to enable the use of the
performance events system using the following command:

    echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid

For information on how to use perf, refer to the
[`perf` manual](http://man7.org/linux/man-pages/man1/perf.1.html)
and the kernel
[sysctl](https://www.kernel.org/doc/Documentation/sysctl/kernel.txt) settings.

## Enable kernel crash dump collection

In the rare event of a kernel panic, enabling kernel crash dump collection can
help you and Cloud Customer Care determine the root cause. To enable crash dumps,
see
[User Guide: Kernel Crash Dump Collection for COS](https://cos.googlesource.com/cos/overlays/board-overlays/+/refs/heads/master/project-lakitu/docs/kdump.md)
in the open source documentation. This user guide explains how to collect kernel
crash dumps on GKE nodes with Container-Optimized OS or
Container-Optimized OS instances created from Compute Engine.