Posts with topic: Software+Tools

SELinux basics

I recently came in touch with SELinux when I had to write/extend a policy for a commercial app. This post is some kind of notepad/cheatsheet I created while learning the topic. The aim is to document the concepts and commands which are necessary in order to be able to understand the basics and modify/adjust an existing SELinux policy.
→ Read More

distcc reduced compilation times to less than a half!

distcc is a program to distribute compilation of C, C++, Objective C or Objective C++ code across several machines on a network. Just evaluated distcc for building a ~1,4 Mio lines of code C++ code base on Linux with GCC. My local machine is already quite powerful. I usually build on 8 cores simultaneously (ninja -j8) with some quad-core Intel i7 and a quite fast SSD. A full build takes ~26 minutes.
→ Read More

gprof, Valgrind and gperftools - an evaluation of some tools for application level CPU profiling on Linux

In this post I give an overview of my evaluation of three different CPU profiling tools: gperftools, Valgrind and gprof. I evaluated the three tools on usage, functionality, accuracy and runtime overhead. The usage of the different profilers is demonstrated with the small demo program cpuload, available via my github repository gklingler/cpuProfilingDemo. The intent of cpuload.cpp is just to generate some CPU load - it does nothing useful. The bash scripts in the same repo (which are also listed below) show how to compile/link the cpuload.
→ Read More

How docker replaced my virtual machines and chroots

In one of my earlier posts I showed you why and how I use chroots for software development. In situations were the isolation of a chroot is not enough, I sometimes also used virtual machines. Both solutions have its pros and cons: A chroot is quite easy to setup and access with no virtualization overhead and you get native host performance. Virtualization offers very good isolation and some nice features e.
→ Read More

Playing around with libclang -> reverse engineering UML class diagrams

libclang is a stable, high level C interface to Clang - a compiler for C/C++ family programming languages based on LLVM. I recently played around with the python bindings to libclang and created a small tool called CodeDependencyVisualizer. This tool is intended for reverse engineering UML class diagrams out of existing C++ code. It can generate class diagrams with inheritances and associations. If class X is derived from class Y, a closed arrow is drawn from X to Y (inheritance).
→ Read More

Open source tools to examine and adjust include dependencies

In my previous post I wrote about include dependencies in general - why they matter and how to keep them at a minimum. In this article I’ll give a quick overview about the tools I evaluated and used to examine and adjust include dependencies of a large C++ project. I’ll cover some useful gcc compiler options, doxygen, cinclude2dot and the powerful include-what-you-use. GCC compiler options GCC provides some helpful options to determine/analyze include dependencies.
→ Read More

Howto get hardware accelerated OpenGL support in Docker

I recently played around with Docker and tried to get OpenGL with hardware acceleration/direct rendering (DRI) to work. This was no big deal, but there are some things that must be considered and I want to share with you: The graphics driver in the docker container must be the same as on the host system. The X server on the host must permit connections from the docker container (this is what xhost + in run.
→ Read More

How to use a chroot-jail for software development

In this tutorial I show you how you can easily setup and use a chroot-jail on Linux, and explain why this can be especially useful for software development. My main operating system is Arch Linux - I really like it because of it’s simplicity, flexibility and always up to date packages because of it’s rolling release style. A disadvantage of a rolling release style (for software development) is that the system is quite “volatile”: Major packet update can happen every time you update your system or just certain packages.
→ Read More