While out for a run this afternoon, I hear the swoop of wings. Very, very close. Looking up, I see a large bird climbing back up from the pass, circling back around, and diving in for another overhead pass. Two, three, four, five feet miss, max. I think that happened five or six times. Second last time, I involuntarily ducked, it was that close. That bird had no fear. I felt I could have reached up and plucked the bird from the air!.
Saturday, May 29. 2021
Dive Bombed by an Aerial Rodent Hunter
linux diskstats
More TODO looking:
$ cat /proc/diskstats 259 0 nvme0n1 63840307 12937870 2293335051 33430251 96127804 61305555 15099846424 191811657 0 96413608 239045439 0 0 0 0 3690911 13803530 259 1 nvme0n1p1 393 1000 29745 67 2 0 2 13 0 404 81 0 0 0 0 0 0 259 2 nvme0n1p2 416 506 23256 48 98 1 214 252 0 356 301 0 0 0 0 0 0 259 3 nvme0n1p3 279609 8152 46434210 58163 765192 382955 254395816 7307992 0 3161560 7366155 0 0 0 0 0 0 259 4 nvme0n1p4 5696585 40470 560165192 6789555 256010 14505 38464520 203018 0 2718956 6992574 0 0 0 0 0 0 259 5 nvme0n1p5 5997688 132712 465611808 3669012 19168871 263191 2499497624 45842492 0 18926656 49511505 0 0 0 0 0 0 259 6 nvme0n1p6 12243830 121349 803005424 12340941 59298520 1387653 11690638024 89369664 0 53198444 101710606 0 0 0 0 0 0 259 7 nvme0n1p7 39621442 12633681 418051776 10572440 13066758 59257250 616850224 35479804 0 15527632 46052244 0 0 0 0 0 0 179 0 mmcblk0 704 1577 43388 8432 142 96 11206 16617 0 4792 25049 0 0 0 0 0 0 179 1 mmcblk0p1 14 0 112 68 0 0 0 0 0 76 68 0 0 0 0 0 0 179 2 mmcblk0p2 31 0 2104 288 0 0 0 0 0 192 288 0 0 0 0 0 0 179 3 mmcblk0p3 116 224 4960 1977 9 6 30 1627 0 2440 3605 0 0 0 0 0 0 179 4 mmcblk0p4 197 1314 16138 1046 81 67 1184 10153 0 2904 11199 0 0 0 0 0 0 179 5 mmcblk0p5 78 0 5056 1666 7 5 1040 1024 0 2164 2690 0 0 0 0 0 0 179 6 mmcblk0p6 72 38 4746 1185 8 1 72 1210 0 2232 2396 0 0 0 0 0 0 179 7 mmcblk0p7 138 1 8056 2103 37 17 8880 2601 0 2980 4704 0 0 0 0 0 0
linux hwmon
TODO: look at what is covered and what is missing:
$ ls -al /sys/class/hwmon total 0 drwxr-xr-x 2 root root 0 May 29 11:02 . drwxr-xr-x 62 root root 0 May 28 15:09 .. lrwxrwxrwx 1 root root 0 May 29 11:02 hwmon0 -> ../../devices/virtual/thermal/thermal_zone0/hwmon0 lrwxrwxrwx 1 root root 0 May 29 11:02 hwmon1 -> ../../devices/pci0000:00/0000:00:1d.0/0000:72:00.0/hwmon/hwmon1 lrwxrwxrwx 1 root root 0 May 29 11:02 hwmon2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon2 lrwxrwxrwx 1 root root 0 May 29 11:02 hwmon3 -> ../../devices/platform/coretemp.0/hwmon/hwmon3 lrwxrwxrwx 1 root root 0 May 29 11:02 hwmon4 -> ../../devices/virtual/thermal/thermal_zone2/hwmon4 lrwxrwxrwx 1 root root 0 May 29 11:02 hwmon5 -> ../../devices/virtual/thermal/thermal_zone4/hwmon5 rpb@nuc8i7hvk01:~/data/passwords$ sensors pch_skylake-virtual-0 Adapter: Virtual device temp1: +55.5°C amdgpu-pci-0100 Adapter: PCI adapter vddgfx: 800.00 mV edge: +55.0°C (crit = +89.0°C, hyst = -273.1°C) power1: 9.04 W (cap = 75.00 W) acpitz-acpi-0 Adapter: ACPI interface temp1: +27.8°C (crit = +119.0°C) temp2: +29.8°C (crit = +119.0°C) iwlwifi_1-virtual-0 Adapter: Virtual device temp1: +46.0°C coretemp-isa-0000 Adapter: ISA adapter Package id 0: +64.0°C (high = +100.0°C, crit = +100.0°C) Core 0: +60.0°C (high = +100.0°C, crit = +100.0°C) Core 1: +61.0°C (high = +100.0°C, crit = +100.0°C) Core 2: +60.0°C (high = +100.0°C, crit = +100.0°C) Core 3: +64.0°C (high = +100.0°C, crit = +100.0°C) nvme-pci-7200 Adapter: PCI adapter Composite: +42.9°C (low = -273.1°C, high = +80.8°C) (crit = +80.8°C) Sensor 1: +42.9°C (low = -273.1°C, high = +65261.8°C) Sensor 2: +42.9°C (low = -273.1°C, high = +65261.8°C)
Re: [PATCH bpf-next] xsk: support AF_PACKET (XDP)
> In xsk mode, users cannot use AF_PACKET(tcpdump) to observe the current > rx/tx data packets. This feature is very important in many cases. So > this patch allows AF_PACKET to obtain xsk packages.
You can use xdpdump to dump the packets from the XDP program before it gets redirected into the XSK: https://github.com/xdp-project/xdp-tools/tree/master/xdp-dump
Doens't currently work on egress, but if/when we get a proper TX hook that should be doable as well.
Wiring up XSK to AF_PACKET sounds a bit nonsensical: XSK is already a transport to userspace, why would you need a second one?
Yes, it is rather cool (credit to Eelco). Notice the extra info you can capture from 'exit', like XDP return codes, if_index, rx_queue. The tool uses the perf ring-buffer to send/copy data to userspace. This is actually surprisingly fast, but I still think AF_XDP will be faster (but it usually 'steals' the packet).
Another (crazy?) idea is to extend this (and xdpdump), is to leverage Hangbin's recent XDP_REDIRECT extension e624d4ed4aa8 ("xdp: Extend xdp_redirect_map with broadcast support"). We now have a xdp_redirect_map flag BPF_F_BROADCAST, what if we create a BPF_F_CLONE_PASS flag?
The semantic meaning of BPF_F_CLONE_PASS flag is to copy/clone the packet for the specified map target index (e.g AF_XDP map), but afterwards it does like veth/cpumap and creates an SKB from the xdp_frame (see __xdp_build_skb_from_frame()) and send to netstack. (Feel free to kick me if this doesn't make any sense)
> This would be a smooth way to implement clone support for AF_XDP. If > we had this and someone added AF_XDP support to libpcap, we could both > capture AF_XDP traffic with tcpdump (using this clone functionality in > the XDP program) and speed up tcpdump for dumping traffic destined for > regular sockets. Would that solve your use case Xuan? Note that I have > not looked into the BPF_F_CLONE_PASS code, so do not know at this > point what it would take to support this for XSKMAPs.
Recently also ended up with something similar for our XDP LB to record pcaps [0] My question is.. tcpdump doesn't really care where the packet data comes from, so why not extending libpcap's Linux-related internals to either capture from perf RB or BPF ringbuf rather than AF_PACKET sockets? Cloning is slow, and if you need to end up creating an skb which is then cloned once again inside AF_PACKET it's even worse. Just relying and reading out, say, perf RB you don't need any clones at all.
Anyway, xdpdump does have a "pipe pcap to stdout" feature so you can do `xdpdump | tcpdump` and get the interactive output; and it will also save pcap information to disk, of course (using pcap-ng so it can also save metadata like XDP program name and return code).