bcc is a collection of tracing and monitoring tools on Linux written around eBPF (Extended Berkeley Packet Filter), an in-kernel VM. BPF is one of the latest mechanisms of its kind built into the kernel (at the time of writing) and finds its use in networking, tracing, in-kernel optimizations and hardware optimizations. bcc provides both kernel-level and user-level tracing options. Continue reading bcc: BPF based kernel analysis utilities
Tag: linux debugging
vmtouch: portable file cache analyzer
vmtouch is a useful utility to analyze and control the virtual memory used by the filesystem. It works on Unix-ish systems and BSD. It is a portable utility with minimal dependecies in the source code. In addition to understanding cache usage by files, you can also use vmtouch to preload files and speed up subsequent operations. Continue reading vmtouch: portable file cache analyzer
ftrace: trace kernel function calls
For those who have used strace for userspace development ftrace would be a familiar concept. ftrace is an internal tracing facility for the Linux kernel developed by Red Hat. It internally uses the kernel’s tracepoint mechanism and can track several characteristics of the running kernel. However, in this article we will concentrate on enabling it to trace the commonest one – function calls in the Linux kernel. Continue reading ftrace: trace kernel function calls
GDB dashboard: debug info at a glance
GDB dashboard is a useful python utility for programmers to show valuable information while debugging with gdb. It uses the gdb python interface of gdb and implements several modules in different categories to show debug information Continue reading GDB dashboard: debug info at a glance
dstat: live system information
$ dstat -a ----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system-- usr sys idl wai hiq siq| read writ| recv send| in out | int csw 11 3 85 1 0 0| 51k 58k| 0 0 | 0 0 | 172 864 1 0 99 0 0 0| 0 4096B| 0 0 | 0 0 | 81 224 0 0 100 0 0 0| 0 0 | 0 0 | 0 0 | 57 174 1 0 99 0 0 0| 0 0 | 14k 121B| 0 0 | 104 306 1 0 99 0 0 0| 0 0 | 97B 121B| 0 0 | 124 596 1 0 99 0 0 0| 0 0 | 218B 172B| 0 0 | 106 407 0 0 100 0 0 0| 0 0 | 229B 121B| 0 0 | 84 296 1 1 99 0 0 0| 0 0 | 785B 723B| 0 0 | 120 344 0 0 99 0 0 0| 0 0 | 163B 121B| 0 0 | 67 208 0 0 100 0 0 0| 0 0 | 54B 86B| 0 0 | 67 217 0 0 100 0 0 0| 0 0 | 0 0 | 0 0 | 52 161 0 0 100 0 0 0| 0 0 | 0 0 | 0 0 | 49 163 0 0 100 0 0 0| 0 0 | 0 0 | 0 0 | 56 206 0 0 100 0 0 0| 0 0 | 0 0 | 0 0 | 88 304 1 0 99 0 0 0| 0 0 | 0 0 | 0 0 | 107 461 1 0 99 0 0 0| 0 0 | 0 0 | 0 0 | 60 243 0 0 100 0 0 0| 0 0 | 0 0 | 0 0 | 50 148 0 0 100 0 0 0| 0 0 | 0 0 | 0 0 | 47 128 1 0 99 0 0 0| 0 0 | 0 0 | 0 0 | 90 431 1 0 99 0 0 0| 0 0 | 0 0 | 0 0 | 100 408
What if you could have the functionality of vmstat, iostat, mpstat, netstat and ifstat in a single tool? dstat is a top like utility to fetch all the information from a running system and show it in the terminal with regular updates. Continue reading dstat: live system information
csysdig: trace your system
The sysdig utility is a open source tool to trace, explore, capture system state and activity from a running Linux instance, then save, filter and analyze. It is a combination of tools like strace, tcpdump, htop, iftop and lsof. sysdig allows you to dig into system metrics including CPU, memory, disk I/O, network I/O, application activity and more. Continue reading csysdig: trace your system
Log the smart way
How do you log information or error when writing a program in C? If it’s a console based application the early stages frequently see a lot of printf() calls throughout the program. The number of printf()s in the program keep increasing with time. Continue reading Log the smart way
Dump, debug, resume process with criu
criu (previously crtools) is a userspace tool to dump the complete state of a process as a set of image files and resume it later from the same checkpoint. Another advantage of CRIU is you can convert it to a core dump to analyse in GDB. This is particularly useful to debug hung processes. Continue reading Dump, debug, resume process with criu
debug: fancy debug logs in C
Developers spend a lot of their time looking into debug logs to find problems in code. debug is a single C header file ready to be included in your project to add the support for meaningful and easy debug logs. debug uses the MIT license. Continue reading debug: fancy debug logs in C
Full automatic call tracing in GDB
Starting off working on an existing project can be tedious, specially when you are trying to implement a new feature. In case of many projects, the debug mode becomes handy. But what if the logs aren’t enough to get you to the point of execution? Continue reading Full automatic call tracing in GDB