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?
-
Already answered here : https://unix.stackexchange.com/questions/92957/how-can-i-compile-install-and-run-the-tools-inside-kernel-tools . – schaiba Jul 10 '17 at 07:48
-
@schaiba, no, that just explains how to build them. – Stephen Kitt Jul 10 '17 at 07:49
2 Answers
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), includinglsgpiowhich 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 needlibbfdto buildbpf_jit_disasm);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;perfcontains theperftool you already know;power/acpicontains a number of ACPI-related tools;power/cpupowercontains thecpupowertool, 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);time/udelay_test.shis audelay()test script;usbcontains a number of USB testing tools, along withusb/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.
- 411,918
- 54
- 1,065
- 1,164
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 ipfw.
It's worth a look if that is useful to you. See:
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/nanobsd/index.html
for more details.
- 3,520
- 2
- 14
- 29