Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Embedded Linux Projects Using Yocto Project Cookbook

You're reading from  Embedded Linux Projects Using Yocto Project Cookbook

Product type Book
Published in Mar 2015
Publisher
ISBN-13 9781784395186
Pages 324 pages
Edition 1st Edition
Languages
Author (1):
Alex Gonzalez Alex Gonzalez
Profile icon Alex Gonzalez

Table of Contents (13) Chapters

Embedded Linux Projects Using Yocto Project Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
The Build System The BSP Layer The Software Layer Application Development Debugging, Tracing, and Profiling Index

Using strace for application debugging


Debugging does not always involve working with source code. Sometimes it is a change in an external factor that is causing the problem.

Strace is a tool that is useful for scenarios where we are looking for problems outside of the binary itself; for example configuration files, input data, and kernel interfaces. This recipe will explain how to use it.

Getting ready

To include strace in your system, add the following to your conf/local.conf file:

IMAGE_INSTALL_append = " strace"

Strace is also part of the tools-debug image feature, so you can also add it with:

EXTRA_IMAGE_FEATURES += "tools-debug"

Strace is also included in the -sdk images.

Before starting, we will also include pgrep, a process utility that will make our debugging easier by looking up process IDs by name. To do so, add the following to your conf/local.conf configuration file:

IMAGE_INSTALL_append = " procps"

How to do it...

When printing a system call, strace prints the values passed to the kernel...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}