In the kernel source tree /tools, there are many submodules. What are the tools available in this folder? I know perf tool. What else are they? How to build them? Are they, by default, integrated into the kernel? What are they used for?
make help in that directory gives a brief summary:
Possible targets: acpi - ACPI tools cgroup - cgroup tools cpupower - a tool for all things x86 CPU power firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer freefall - laptop accelerometer program for disk protection gpio - GPIO tools hv - tools used when in Hyper-V clients iio - IIO tools kvm_stat - top-like utility for displaying kvm statistics leds - LEDs tools lguest - a minimal 32-bit x86 hypervisor net - misc networking tools perf - Linux performance measurement and analysis tool selftests - various kernel selftests spi - spi tools objtool - an ELF object analysis tool tmon - thermal monitoring and tuning tool turbostat - Intel CPU idle stats and freq reporting tool usb - USB testing tools virtio - vhost test module vm - misc vm tools x86_energy_perf_policy - Intel energy policy tool
This doesn’t cover everything available though. In a little more detail:
accounting/getdelaysdisplays various pieces of information relating to task and process scheduling, including context switches (voluntary and involuntary), I/O accounting and delay accounting;
cgroup/cgroup_event_listeneris a simple cgroup event listener;
firewire/nosy-dumpinteracts with the snoop mode driver for TI PCILynx 1394 (Firewire) controllers;
gpiocontains a few tools related to GPIO (general-purpose I/O pins, typically on single-board computers such as the Raspberry Pi), including
lsgpiowhich lists the available GPIO chips and lines;
hvcontains a number of tools useful in Hyper-V guests;
iiocontains industrial I/O-related tools;
kvm/kvm_stat/kvm_statprints counts of KVM kernel module trace events, i.e. a view of KVM guest activity from the host side;
laptop/dslm/dslmis a simple disk sleep monitor;
laptop/freefall/freefallappears to implement disk protection on HP and Dell laptops (detecting when the laptop is falling, parking the heads, and unparking them when the alarm stops);
leds/uledmonis mostly a userspace LED demonstration program;
lguestcontains a minimal 32-bit x86 hypervisor;
netcontains a few BPF debugging tools (you’ll need
nfsdcontains a script to inject NFS daemon faults;
objtoolcontains an ELF object analysis tool;
pcmcia/crc32hashis a user-space implementation of the kernel’s CRC32 algorithm;
perftool you already know;
power/acpicontains a number of ACPI-related tools;
cpupowertool, library etc., for monitoring and controlling the CPU power management;
power/x86/turbostat/turbostatreports processor topology, frequency, idle power statistics, temperature and power on x86 CPUs;
power/x86/x86_energy_perf_policy/x86_energy_perf_policydisplays and sets the x86 energy performance policy;
spi/spidev_testis a SPI testing tool;
testingcontains a number of kernel testing tools;
thermal/tmoncontains a comprehensive thermal monitoring tool (useful in particular to determine the relationships between cooling devices and thermal behaviour);
usbcontains a number of USB testing tools, along with
usb/usbip, which is a nice client/server tool allowing USB devices to be exported from one host to another;
virtiocontains a vhost test module;
vm/page-typesdisplays detailed page information from the virtual memory subsystem.
These tools aren’t part of the kernel build by default, and need to be built explicitly using the appropriate target or directory, as indicated by
make help. Many of them have detailed documentation you can read to find out more.
I can answer for FreeBSD, and for one quite important one. In
/usr/src/tools/tools/nanobsd you will find the scripts and files for NanoBSD.
This is not a different system; it's a way of building stripped down complete systems that run from a read only system and one or more memory disks. There is a lot of stuff to help configuration, using different configurations from the host system.
I have built FreeBSD systems on read only CF cards, and read only USB sticks. I have used these to run a diskless firewall based on
It's worth a look if that is useful to you. See:
for more details.