Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Embedded Linux Programming - Third Edition

You're reading from  Mastering Embedded Linux Programming - Third Edition

Product type Book
Published in May 2021
Publisher Packt
ISBN-13 9781789530384
Pages 758 pages
Edition 3rd Edition
Languages
Authors (2):
Frank Vasquez Frank Vasquez
Profile icon Frank Vasquez
Chris Simmonds Chris Simmonds
Profile icon Chris Simmonds
View More author details

Table of Contents (27) Chapters

Preface Section 1: Elements of Embedded Linux
Chapter 1: Starting Out Chapter 2: Learning about Toolchains Chapter 3: All about Bootloaders Chapter 4: Configuring and Building the Kernel Chapter 5: Building a Root Filesystem Chapter 6: Selecting a Build System Chapter 7: Developing with Yocto Chapter 8: Yocto Under the Hood Section 2: System Architecture and Design Decisions
Chapter 9: Creating a Storage Strategy Chapter 10: Updating Software in the Field Chapter 11: Interfacing with Device Drivers Chapter 12: Prototyping with Breakout Boards Chapter 13: Starting Up – The init Program Chapter 14: Starting with BusyBox runit Chapter 15: Managing Power Section 3: Writing Embedded Applications
Chapter 16: Packaging Python Chapter 17: Learning about Processes and Threads Chapter 18: Managing Memory Section 4: Debugging and Optimizing Performance
Chapter 19: Debugging with GDB Chapter 20: Profiling and Tracing Chapter 21: Real-Time Programming Other Books You May Enjoy

Profiling with top

The top program is a simple tool that doesn't require any special kernel options or symbol tables. There is a basic version in BusyBox and a more functional version in the procps package, which is available in the Yocto Project and Buildroot. You may also want to consider using htop, which has functionally similar to top but has a nicer user interface (some people think).

To begin with, focus on the summary line of top, which is the second line if you are using BusyBox and the third line if you are using top from procps. Here is an example, using BusyBox's top:

Mem: 57044K used, 446172K free, 40K shrd, 3352K buff, 34452K cached
CPU: 58% usr 4% sys 0% nic 0% idle 37% io 0% irq 0% sirq
Load average: 0.24 0.06 0.02 2/51 105
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
105 104 root R 27912 6% 61% ffmpeg -i track2.wav
[…]

The summary line shows the percentage of time spent running in various states, as shown in this table:

...
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}