Skip to Main Content
Hands-On System Programming with Linux
book

Hands-On System Programming with Linux

by Kaiwan N. Billimoria, Tigran Aivazian
October 2018
Beginner content levelBeginner
794 pages
19h 23m
English
Packt Publishing
Content preview from Hands-On System Programming with Linux

Using Valgrind's Memcheck tool

Memcheck is Valgrind's default tool; you do not need to pass it explicitly, but can do so with the valgrind --tool=memcheck <program-to-execute with params> syntax.

As a trivial example, let's run Valgrind on the df(1) utility (on an Ubuntu box):

$ lsb_release -aNo LSB modules are available.Distributor ID:    UbuntuDescription:    Ubuntu 17.10Release:    17.10Codename:    artful$ df --version |head -n1df (GNU coreutils) 8.26$ valgrind df==1577== Memcheck, a memory error detector==1577== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.==1577== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info==1577== Command: df==1577== Filesystem     1K-blocks    Used Available Use% Mounted onudev 479724 0 479724 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux System Programming Techniques

Linux System Programming Techniques

Jack-Benny Persson
Linux Device Drivers, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini

Publisher Resources

ISBN: 9781788998475Supplemental Content