Linux TCP congestion control internals

Linux has a pluggable TCP congestion control architecture: the IPv4 and IPv6 implementations both call a set of functions that implement congestion control. The congestion-control algorithm can be changed system-wide for new connections, or set for individual sockets using setsockopt (more info here). Here, we look at how the TCP implementation interacts with the congestion […]

Preparing a private git repository for public release

A git project that is open-sourced could require some manipulation before it is ready for release such as changing the directory structure and cleaning out irrelevant files. When the repository contains a single sub-directory with content to release (and only such content), there are methods to split a git repository. This post covers techniques for […]

Recovering Eclipse workspaces from CDT errors

I use unison to synchronize work environments between different workstations (more convenient than rsync IMO), and include the eclipse workspace in the synchronized directory. The problem is sometimes, if the remote eclipse is running, sync will corrupt some workspace state that prevents Eclipse from running. This happens to me every 2-3 months. Eclipse displays an […]

Creating an LTTng tracepoint file

LTTng is a framework to collect kernel tracepoint logs with low overhead (see 5.5 in Desnoyers’ thesis for eval). Instrumenting the kernel is done in two parts: adding a kernel tracepoint, and writing the LTTng adaptation layer. The process is documented in a section of the LTTng docs, however there are a few points that […]

Linux kernel 3.x call-graphs with ncc-2.8

ncc  is a compiler, built specifically to extracts call-graph information from source code. One strong feature is analysis of function pointers. Call graphs can help explore and learn large code bases, which makes it especially useful for the Linux kernel. ncc comes with documentation on extracting call-graphs from 2.6 kernels, apparently tested circa 2008. We […]

Creating call-graphs to explore the Linux kernel with CodeViz

This article uses CodeViz, which downloads gcc 4.6.2 to compile the kernel while extracting code information. Other posts explore other techniques. Making codeviz and gcc The makefile calls the script “compilers/install_gcc-4.6.2.sh” to compile the patched gcc. There might be a few changes to that script in order to get everything working. Thanks to Stephan Friedl’s […]

Splitting a git repository into two repos

A git project frequently arrives to a point where it is beneficial to split it into two repositories. You may have developed a library and an application and want to release them separately, or perhaps some of the documentation grows to become a book, to be maintained by a different set of individuals. How does […]

Creating presentations programatically

One can convey quite complex ideas in presentations using the right diagrams, however composing diagrams using software like PowerPoint of OpenOffice Impress can be time consuming since elements are created and manipulated individually. This becomes even more problematic when showing an evolution of an idea through several slides: changing some aspect (e.g., color) in the […]

Debugging the Linux kernel with Qemu and Eclipse

First, it is useful to have Eclipse index all kernel symbols, and an excellent tutorial can be found here. Older tutorials on setting up kernel debugging with QEMU and Eclipse were extremely useful in getting the setup working, however more recent changes to QEMU requires some effort to bypass limitations in gdb, and Eclipse dialogs […]

Increasing thread priority in Linux

It is sometimes useful to get semi-realtime behavior from some of an application’s thread. This is common when I/O latency needs to be kept low, a good example being Software Defined Radio. The software component of the radio would like to read and write samples from the radio as soon as possible, keeping buffers small […]