-1

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?

4

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/getdelays displays 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_listener is a simple cgroup event listener;
  • firewire/nosy-dump interacts with the snoop mode driver for TI PCILynx 1394 (Firewire) controllers;
  • gpio contains a few tools related to GPIO (general-purpose I/O pins, typically on single-board computers such as the Raspberry Pi), including lsgpio which lists the available GPIO chips and lines;
  • hv contains a number of tools useful in Hyper-V guests;
  • iio contains industrial I/O-related tools;
  • kvm/kvm_stat/kvm_stat prints counts of KVM kernel module trace events, i.e. a view of KVM guest activity from the host side;
  • laptop/dslm/dslm is a simple disk sleep monitor;
  • laptop/freefall/freefall appears 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/uledmon is mostly a userspace LED demonstration program;
  • lguest contains a minimal 32-bit x86 hypervisor;
  • net contains a few BPF debugging tools (you’ll need libbfd to build bpf_jit_disasm);
  • nfsd contains a script to inject NFS daemon faults;
  • objtool contains an ELF object analysis tool;
  • pcmcia/crc32hash is a user-space implementation of the kernel’s CRC32 algorithm;
  • perf contains the perf tool you already know;
  • power/acpi contains a number of ACPI-related tools;
  • power/cpupower contains the cpupower tool, library etc., for monitoring and controlling the CPU power management;
  • power/x86/turbostat/turbostat reports processor topology, frequency, idle power statistics, temperature and power on x86 CPUs;
  • power/x86/x86_energy_perf_policy/x86_energy_perf_policy displays and sets the x86 energy performance policy;
  • spi/spidev_test is a SPI testing tool;
  • testing contains a number of kernel testing tools;
  • thermal/tmon contains a comprehensive thermal monitoring tool (useful in particular to determine the relationships between cooling devices and thermal behaviour);
  • time/udelay_test.sh is a udelay() test script;
  • usb contains 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;
  • virtio contains a vhost test module;
  • vm/page-types displays 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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.