Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.


Alex Samorukov

atop FreeBSD port


This page is about my port of the atop tool to FreeBSD platform.

Porting is done and atop could be installed using FreeBSD ports using 'cd /usr/ports/sysutils/atop && make install clean' command.

If you want to run latest development version (or submit your patches) use SVN version:

svn checkout https://svn.code.sf.net/p/atopfreebsd/svn/trunk atop-freebsd
cd atop-freebsd
make -f Makefile.fbsd

and run ./atop from the compilation directory. Alternatively you can download sources from the files section.

Implemented features

  • Compilation issues are fixed (defines, linux headers, etc.). New makefile created for the FreeBSD. All required components to compile and run atop are in the base system.
  • Per process information is gathered correctly via kvm_* API. Some per-process data available in Linux is missing in FreeBSD.
  • Accounting support works fine. FreeBSD using different format then Linux (keeping old format identifier, btw.). All available data correctly exported to atop.
  • System CPU information gathered using sysctl API. CPU scaling is supported if cpufreq() driver is in use. Also FreeBSD itself do not support per-cpu scaling, so it will always be the same value for the all CPU`s.
  • Swap information is gathered via kvm_* and sysctl calls. It is not so complete as in Linux.
  • Per disk statistic. I am using devstat (as iotop do) as data provider. Data looks a little different in the FreeBSD then in Linux, I tried to make it consistent with iotop tool.
  • Per interface network statistic, including detection of link speed and duplex type.
  • Protocol network statistic for IP, ICMP, TCP, UDP, IPv6 and ICMPv6 protocols.
  • Recording mode is working fine. atopsar utility works fine as well
  • Tested on FreeBSD 8.2 and 7.3 with i386 and amd64 kernels

FreeBSD specific features and notes

  • By default all kernel processes are filtered. To show or record them use -U switch. System processes will be displayed in {name} format, like in BSD top.
  • In per-process disk report ("d" key) disk activity is shown in blocks, like in bsd "top -mio".
  • FreeBSD kernel provides 5 memory related counters: Wired, Active, Inactive, Cache and Free. They are implemented in the FreeBSD atop instead of Linux counters (slabmem, cachedirty, etc.).
  • There is no separate statistic for UDP on IPv6 as in Linux, everything is in the global protocol statistic. Also tcp rst send count is not very accurate because there is no dedicated counter for it.
  • Added JID keyword to the per-process statistic to show Jail ID.
  • In the FreeBSD port init script is provided. To use atop in daemon mode do:
    • Add atop_enable="YES" to the /etc/rc.conf file and start the service (/usr/local/etc/rc.d/atop start).
    • Add daily log rotating to the root`s crontab:
      0 0 * * * /usr/local/etc/rc.d/atop rotate >/dev/null
    • To change default logging interval (10 seconds) use atop_inteval varable, e.g.
    • To change number of days to keep logfiles (default - 30) use atop_keepdays varable, e.g.

Bugs, problems

  • Disk per process counters are exported in "blocks". Need to investigate if they are convertible to bytes or not.
  • It is not possible to read BSD logs on Linux platform. Probably not possible to fix without linux version source changes.

If you found any other issues do not hesitate to contact me using email (samm at os2.kiev.ua) or via tickets.


Screenshot thumbnail
Aggregated report
Screenshot thumbnail
atop in big terminal