avatar

Life of a Programmer

`Simplicity is prerequisite for reliability.’ - EWD

A Taste of bpftrace

bpftrace真的挺好用。1 跟踪进程的执行 🔗通过跟踪 execve,可以得到系统中进程执行的情况。 $ bpftrace -e 'tracepoint:syscalls:sys_enter_execve { time("%H:%M:%S "); join(args->argv) }' Attaching 1 probe... 13:10:04 /usr/lib64/sa/sa1 1 1 13:10:04 /usr/lib64/sa/sadc -F -L -S

Klepetan and Malena

偶尔刷到一则视频,关于一对克罗地亚白鹳,阿克和玛莲娜。1 故事就不再复述了,挺感人。2意外的是在B站某个评论里看到了元好问的《摸鱼儿》。 “问世

What Is a PDU

以前在 Ceph 上跑虚拟机的时候,偶尔看到 libvirt 报错: qemu unexpectedly closed the monitor: sending req data... pdu length 134, total length 142 the received hdr shows the err 0, the pdu length 198 ... 当时不知道这个 pdu 是啥意思。搜了一圈 libvirt, Qemu, Ceph

Texas Sharpshooter Fallacy

Steven Pinker 在《理性》一书中讲到一则德克萨斯神枪手谬误: 有个德州人朝着自己的谷仓射了许多子弹,在弹孔最密集的地方画一个圈,然后自称是神枪手。1 “先射

Interpreting Kernel Call Trace

假设有 Call Trace 如下: [89580.077835] task:kworker/u195:0 state:D stack: 0 pid:9848 ppid: 2 flags:0x80004080 [89580.077840] Workqueue: events_unbound async_run_entry_fn [89580.077845] Call Trace: [89580.077847] __schedule+0x2d1/0x860 [89580.077852] ? scan_shadow_nodes+0x30/0x30 [89580.077856] schedule+0x35/0xa0 [89580.077857] io_schedule+0x12/0x40 [89580.077859] do_read_cache_page+0x4eb/0x740 上面这段日志是由 kernel/sched/core.c 中的 sched_show_task() 函数打印的。 任务信息 🔗task:kworker