Book description
"This welcome addition to the Linux bookshelf provides real insight into the black-art of debugging. All too often debugging books concentrate solely on the tools but this book avoids that pitfall by concentrating on examples. The authors dissect and discuss each example in detail; in so doing they give invaluable insight into the Linux environment."
—Richard J Moore, IBM Advanced Linux Response Team-Linux Technology Centre
"A plethora of Linux books exist but this guide offers a definitive overview of practical hints and tips for Linux users. Written by experts in the field, it will be extremely useful for system administrators and Linux enthusiasts."
—Markus Rex, VP and General Manager, SUSE LINUX
The indispensable troubleshooting resource for every Linux administrator, developer, support professional, and power user!
Systematically resolve errors, crashes, hangs, performance slowdowns, unexpected behavior, and unexpected outputs
Master essential Linux troubleshooting tools, including strace, gdb, kdb, SysRq, /proc, and more
The indispensable start-to-finish troubleshooting guide for every Linux professional
Now, there's a systematic, practical guide to Linux troubleshooting for every power user, administrator, and developer. In Self-Service Linux®, two of IBM's leading Linux experts introduce a four-step methodology for identifying and resolving every type of Linux-related system or application problem: errors, crashes, hangs, performance slowdowns, unexpected behavior, and unexpected outputs. You'll learn exactly how to use Linux's key troubleshooting tools to solve problems on your own—and how to make effective use of the Linux community's knowledge.
If you use Linux professionally, this book can dramatically increase your efficiency, productivity, and marketability. If you're involved with deploying or managing Linux in the enterprise, it can help you significantly reduce operation costs, enhance availability, and improve ROI.
Discover proven best practices for diagnosing problems in Linux environments
Leverage troubleshooting skills you've developed with other platforms
Learn to identify problems with strace—the most frequently used Linux troubleshooting tool
Use /proc to uncover crucial information about hardware, kernels, and processes
Recompile open source applications with debug information
Debug applications with gdb, including C++ and threaded applications
Debug kernel crashes and hangs, one step at a time
Understand the Executable and Linking Format (ELF), and use that knowledge for more effective debugging
Includes a production-ready data collection script that can save you hours or days in debugging mission-critical Linux systems!
Series Editor Bruce Perens' is an open source evangelist, developer, and consultant whose software is a major component of most commercial embedded Linux offerings. He founded or cofounded Linux Standard Base, Open Source Initiative, and Software in the Public Interest. As Debian GNU/Linux Project Leader, he was instrumental in getting the system on two U.S. space shuttle flights.
© Copyright Pearson Education. All rights reserved.
Table of contents
- Copyright
- Bruce Perens’ Open Source Series
- About Prentice Hall Professional Technical Reference
- About the Authors
- Preface
-
1. Best Practices and Initial Investigation
- 1.1. Introduction
- 1.2. Getting Your System(s) Ready for Effective Problem Determination
-
1.3. The Four Phases of Investigation
- 1.3.1. Phase #1: Initial Investigation Using Your Own Skills
- 1.3.2. Phase #2: Searching the Internet Effectively
- 1.3.3. Phase #3: Begin Deeper Investigation (Good Problem Investigation Practices)
- 1.3.4. Phase #4: Getting Help or New Ideas
- 1.4. Technical Investigation
- 1.5. Troubleshooting Commercial Products
- 1.6. Conclusion
- 2. strace and System Call Tracing Explained
-
3. The /proc Filesystem
- 3.1. Introduction
- 3.2. Process Information
-
3.3. Kernel Information and Manipulation
- 3.3.1. /proc/cmdline
- 3.3.2. /proc/config.gz or /proc/sys/config.gz
- 3.3.3. /proc/cpufreq
- 3.3.4. /proc/cpuinfo
- 3.3.5. /proc/devices
- 3.3.6. /proc/kcore
- 3.3.7. /proc/locks
- 3.3.8. /proc/meminfo
- 3.3.9. /proc/mm
- 3.3.10. /proc/modules
- 3.3.11. /proc/net
- 3.3.12. /proc/partitions
- 3.3.13. /proc/pci
- 3.3.14. /proc/slabinfo
- 3.4. System Information and Manipulation
- 3.5. Conclusion
-
4. Compiling
- 4.1. Introduction
- 4.2. The GNU Compiler Collection
- 4.3. Other Compilers
- 4.4. Compiling the Linux Kernel
- 4.5. Assembly Listings
- 4.6. Compiler Optimizations
- 4.7. Conclusion
- 5. The Stack
-
6. The GNU Debugger (GDB)
- 6.1. Introduction
- 6.2. When To Use a Debugger
- 6.3. Command Line Editing
- 6.4. Controlling a Process with GDB
- 6.5. Examining Data, Memory, and Registers
- 6.6. Execution
- 6.7. Source Code
- 6.8. Assembly Language
- 6.9. Tips and Tricks
- 6.10. Working with C++
- 6.11. Threads
- 6.12. Data Display Debugger (DDD)
- 6.13. Conclusion
-
7. Linux System Crashes and Hangs
- 7.1. Introduction
-
7.2. Gathering Information
- 7.2.1. Syslog Explained
- 7.2.2. Setting up a Serial Console
- 7.2.3. Connecting the Serial Null-Modem Cable
- 7.2.4. Enabling the Serial Console at Startup
- 7.2.5. Using SysRq Kernel Magic
- 7.2.6. Oops Reports
- 7.2.7. Adding a Manual Kernel Trap
- 7.2.8. Examining an Oops Report
- 7.2.9. Determining the Failing Line of Code
- 7.2.10. Kernel Oopses and Hardware
- 7.2.11. Setting up cscope to Index Kernel Sources
- 7.3. Conclusion
- 8. Kernel Debugging with KDB
-
9. ELF: Executable and Linking Format
- 9.1. Introduction
- 9.2. Concepts and Definitions
- 9.3. ELF Header
- 9.4. Overview of Segments and Sections
- 9.5. Segments and the Program Header Table
-
9.6. Sections and the Section Header Table
- 9.6.1. String Table Format
- 9.6.2. Symbol Table Format
-
9.6.3. Section Names and Types
- 9.6.3.1. .bss
- 9.6.3.2. .data
- 9.6.3.3. .dynamic
- 9.6.3.4. .dynsym (symbol table)
- 9.6.3.5. .dynstr (string table)
- 9.6.3.6. .fini
- 9.6.3.7. .got (Global Offset Table)
- 9.6.3.8. .hash
- 9.6.3.9. .init
- 9.6.3.10. .interp
- 9.6.3.11. .plt (Procedure Linkage Table)
- 9.6.3.12. .rodata
- 9.6.3.13. .shstrtab
- 9.6.3.14. .strtab (string table)
- 9.6.3.15. .symtab (symbol table)
- 9.6.3.16. .text
- 9.6.3.17. .rel
- 9.7. Relocation and Position Independent Code (PIC)
- 9.8. Stripping an ELF Object
- 9.9. Program Interpreter
- 9.10. Symbol Resolution
- 9.11. Use of Weak Symbols for Problem Investigations
- 9.12. Advanced Interception Using Global Offset Table
- 9.13. Source Files
- 9.14. ELF APIs
- 9.15. Other Information
- 9.16. Conclusion
- A. The Toolbox
- B. Data Collection Script
Product information
- Title: Self-Service Linux®: Mastering the Art of Problem Determination
- Author(s):
- Release date: September 2005
- Publisher(s): Pearson
- ISBN: 013147751X
You might also like
book
Improving Business Process Performance
The managerial practices that successfully drove industry for decades have become insufficient to support the rapidly changing …
book
HBR's 10 Must Reads for New Managers Collection
Learn to lead others, while managing yourself. Becoming a manager for the first time means mastering …
book
Managing For Dummies®, 3rd Edition
The fast and easy way to learn how to manage people, projects, and teams Being a …
book
Uncommon Accountability
Own your choices and discover the true meaning of accountability The implementation of true, organization-wide accountability …