Linux Commands For Shared Library Management & Debugging Problem

Posted on in Categories Linux last updated January 6, 2011

If you are a developer, you will re-use code provided by others. Usually /lib, /lib64, /usr/local/lib, and other directories stores various shared libraries. You can write your own program using these shared libraries. As a sys admin you need to manage and install these shared libraries. Use the following commands for shared libraries management, security, and debugging problems.

Linux Configure Netconsole To Log Messages Over UDP Network

Posted on in Categories CentOS, Debian Linux, File system, FreeBSD, Gentoo Linux, GNU/Open source, Hardware, kernel, Linux, Linux distribution, Linux Log Management, Security, Sys admin, Tips, Troubleshooting, Ubuntu Linux last updated July 2, 2008

Linux netconsole kernel module allows dmesg output to be transmitted via the syslogd network. It is kernel-level network logging over udp allowing debugging of problem where disk logging fails and serial consoles are impractical. This is a step-by-step mini howto about netconsole configuration under Red Hat, CentOS, Fedora and Debian Linux.

valgrind – Linux Tools For Debugging And Profiling Programs ( bug reporting tool )

Posted on in Categories Hardware, Howto, Linux, Sys admin, Troubleshooting last updated April 15, 2008

Few days back I wrote about strace tool for reporting and finding bug in program. Today I’m going to talk about another interesting tool called valgrind.

Valgrind is a flexible program for debugging and profiling Linux executables. It consists of a core, which provides a synthetic CPU in software, and a series of “tools”, each of which is a debugging or profiling tool. The architecture is modular, so that new tools can be created easily and without disturbing the existing structure. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build new tools.

The Valgrind distribution currently includes five production-quality tools:

  • a memory error detector
  • a thread error detector
  • a cache and branch-prediction profiler
  • a call-graph generating cache profiler
  • a heap profiler

It also includes two experimental tools:

  • a data race detector
  • an instant memory leak detector.

It runs on the following platforms:

  • X86/Linux
  • AMD64/Linux
  • PPC32/Linux
  • PPC64/Linux

How do I use valgrind?

Valgrind is typically run as follows:
$ valgrind command-name arg1 arg2 argN
$ valgrind program args
$ valgrind ./myapp -d /tmp -f 120

You can select tool using the –tool=TOOLName option. For example use memcheck which is a fine-grained memory checker. To generate trace back for command called myapp, enter:
$ valgrind --tool=memcheck -v --log-file=myapp.dbg --num-callers=8 ./myapp -d /tmp -f 120
Where,

  • –tool=memcheck : Run the Valgrind tool called memcheck
  • -v : Verbose output
  • –log-file=myapp.dbg : Specifies that Valgrind should send all of its messages to the specified file.
  • –num-callers=8 : By default, Valgrind shows twelve levels of function call names to help you identify program locations. You can change that number with this option. This can help in determining the program’s location in deeply-nested call chains.

The –leak-check option turns on the detailed memory leak detector:
$ valgrind --tool=memcheck -v --log-file=myapp.dbg --num-callers=8 --leak-check=yes ./myapp -d /tmp -f 120

Further readings:

Find and Fix Linux Latency Problem with LatencyTOP Software

Posted on in Categories GNU/Open source, Howto, Linux, Linux desktop, Monitoring, Troubleshooting, Tuning last updated January 19, 2008

A TOP-like tool for monitoring system latency and its causes for Linux system.

The Intel Open Source Technology Center is pleased to announce the release of version 0.1 of LatencyTOP, a tool for developers to visualize system latencies. Skipping audio, slower servers, everyone knows the symptoms of latency. But to know what’s going on in the system, what’s causing the latency, how to fix it… that’s a hard question without good answers right now.

LatencyTOP is a Linux tool for software developers (both kernel and userspace), aimed at identifying where in the system latency is happening, and what kind of operation/action is causing the latency to happen so that the code can be changed to avoid the worst latency hiccups.
Linux Latency Problem with LatencyTOP Software
(Fig. 01: LatencyTOP in Action [ Image Credit: Intel Corp. ])

Download LatencyTOP

=> Visit official project site to download LatencyTOP software. Please note that you also need to patch Linux kernel.

Tips for Emacs Power Users

Posted on in Categories Links, Linux, Tips, UNIX last updated December 18, 2007

This is great post by Stevey Drunken about mastering Emacs text editor which is quite quite popular among UNIX hackers, computer programmers and power users:

Emacs is the world’s best text editor. It’s not just the best for editing program source; it’s the best for any kind of text-editing. Mastering Emacs will make you more effective at writing and editing email, documentation drafts, blogs, HTML pages, XML files, and virtually everything else that requires any typing.

The tips in this little document are geared towards Emacs power-users. You should be familiar with the basics of launching and editing with Emacs, and you should already know the essentials of copying stuff into your .emacs file, and debugging things (or finding a friendly Emacs Wizard) when something goes wrong.

=> 10 Specific Ways to Improve Your Productivity With Emacs