where's all the code?
I already had a pretty good idea where all the code in the OpenBSD kernel was hiding but for the sake of comparison I wanted precise numbers. This would be easy enough to get using some scripts and builtin tools like wc and du, but I wanted a tool that would give me something like this.
. 6.93M lines 383.41M bytes
├──dev 5.69M lines 348.84M bytes
│ ├──pci 4.46M lines 308.00M bytes
│ │ ├──drm 3.99M lines 293.86M bytes
│ │ │ ├──amd 3.33M lines 273.93M bytes (6)
│ │ │ ├──i915 326.03k lines 9.21M bytes (5)
│ │ │ ├──radeon 201.19k lines 6.71M bytes (1)
│ │ │ ├──include 48.94k lines 1.56M bytes (9)
│ │ │ ├──ttm 5.46k lines 142.03k bytes
│ │ │ └──scheduler 1.86k lines 51.73k bytes
│ │ └──bktr 8.53k lines 265.29k bytes
│ ├──usb 187.58k lines 5.09M bytes (1)
│ └──(other) 1.02M lines 35.11M bytes (33)
├──arch 729.42k lines 20.46M bytes
│ ├──amd64 133.43k lines 3.98M bytes (7)
│ └──(other) 595.99k lines 16.48M bytes (20)
├──kern 83.80k lines 2.05M bytes
├──uvm 29.39k lines 816.41k bytes
└──(other) 395.30k lines 11.23M bytes (19)
Easy to see everything, without too much clutter. Importantly, let me group things my way, and toss the less interesting parts off to the side. There’s 100 du but better tools on github, but it would take as long to find one that does exactly this as it did to just write one.
And thus watc.
Posted 04 May 2022 17:57 by tedu Updated: 23 May 2022 21:47
Tagged: software
Tagged: software