Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Embedded Linux Development
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering Embedded Linux Development

Mastering Embedded Linux Development

By : Frank Vasquez, Mr. Chris Simmonds
close
close
Mastering Embedded Linux Development

Mastering Embedded Linux Development

By: Frank Vasquez, Mr. Chris Simmonds

Overview of this book

Mastering Embedded Linux Development' is designed to be both a learning resource and a reference for your embedded Linux projects. The book starts by breaking down the fundamental elements that underpin all embedded Linux projects: the toolchain, the bootloader, the kernel, and the root filesystem. First, you will download and install a pre-built toolchain. After that, you will cross-compile each of the remaining three elements from scratch and learn to automate the process using Buildroot and the Yocto Project. The book progresses with coverage of over-the-air software updates and rapid prototyping with add-on boards. Two new chapters tackle modern development practices including Python packaging and deploying containerized applications. These are followed by a chapter on writing multithreaded code and another on techniques to manage memory in an efficient way. The final chapters demonstrate how to debug your code, whether it resides in user space or in the Linux kernel itself. In addition to GDB, the book also covers the different tracers and profilers that are available for Linux so that you can quickly pinpoint any performance bottlenecks in your system. By the end of this book, you will be able to create efficient and secure embedded devices with Linux that will delight your users.
Table of Contents (28 chapters)
close
close
1
Part 1: Elements of Embedded Linux
7
Part 2: Building Embedded Linux Images
11
Part 3: System Architecture and Design Decisions
18
Part 4: Developing Applications
23
Part 5: Debugging and Optimizing Performance

Beginning to profile

When looking at the entire system, a good place to start is with a simple tool such as top, which gives you an overview very quickly. It shows you how much memory is being used, which processes are eating CPU cycles, and how this is spread across different cores and times.

If top shows that a single application is using up all the CPU cycles in user space, then you can profile that application using perf.

If two or more processes have a high CPU usage, there is probably something that is coupling them together, perhaps data communication. If a lot of cycles are spent on system calls or handling interrupts, then there may be an issue with the kernel configuration or with a device driver. In either case, you need to start by taking a profile of the whole system, again using perf.

If you want to find out more about the kernel and the sequencing of events there, use Ftrace, LTTng, or eBPF.

There could be other problems that top will not help you with...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY