Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7aa8c2e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'docs-4.10' of git://git.lwn.net/linux

Pull documentation update from Jonathan Corbet:
 "These are the documentation changes for 4.10.

  It's another busy cycle for the docs tree, as the sphinx conversion
  continues. Highlights include:

   - Further work on PDF output, which remains a bit of a pain but
     should be more solid now.

   - Five more DocBook template files converted to Sphinx. Only 27 to
     go... Lots of plain-text files have also been converted and
     integrated.

   - Images in binary formats have been replaced with more
     source-friendly versions.

   - Various bits of organizational work, including the renaming of
     various files discussed at the kernel summit.

   - New documentation for the device_link mechanism.

  ... and, of course, lots of typo fixes and small updates"

* tag 'docs-4.10' of git://git.lwn.net/linux: (193 commits)
  dma-buf: Extract dma-buf.rst
  Update Documentation/00-INDEX
  docs: 00-INDEX: document directories/files with no docs
  docs: 00-INDEX: remove non-existing entries
  docs: 00-INDEX: add missing entries for documentation files/dirs
  docs: 00-INDEX: consolidate process/ and admin-guide/ description
  scripts: add a script to check if Documentation/00-INDEX is sane
  Docs: change sh -> awk in REPORTING-BUGS
  Documentation/core-api/device_link: Add initial documentation
  core-api: remove an unexpected unident
  ppc/idle: Add documentation for powersave=off
  Doc: Correct typo, "Introdution" => "Introduction"
  Documentation/atomic_ops.txt: convert to ReST markup
  Documentation/local_ops.txt: convert to ReST markup
  Documentation/assoc_array.txt: convert to ReST markup
  docs-rst: parse-headers.pl: cleanup the documentation
  docs-rst: fix media cleandocs target
  docs-rst: media/Makefile: reorganize the rules
  docs-rst: media: build SVG from graphviz files
  docs-rst: replace bayer.png by a SVG image
  ...
parents e34bac72 868c97a8
Loading
Loading
Loading
Loading
+85 −119
Original line number Diff line number Diff line
@@ -14,13 +14,8 @@ Following translations are available on the WWW:
	- this file.
ABI/
	- info on kernel <-> userspace ABI and relative interface stability.

BUG-HUNTING
	- brute force method of doing binary search of patches to find bug.
Changes
	- list of changes that break older software packages.
CodingStyle
	- how the maintainers expect the C code in the kernel to look.
	- nothing here, just a pointer to process/coding-style.rst.
DMA-API.txt
	- DMA API, pci_ API & extensions for non-consistent memory machines.
DMA-API-HOWTO.txt
@@ -33,8 +28,6 @@ DocBook/
	- directory with DocBook templates etc. for kernel documentation.
EDID/
	- directory with info on customizing EDID for broken gfx/displays.
HOWTO
	- the process and procedures of how to do Linux kernel development.
IPMI.txt
	- info on Linux Intelligent Platform Management Interface (IPMI) Driver.
IRQ-affinity.txt
@@ -46,62 +39,43 @@ IRQ.txt
Intel-IOMMU.txt
	- basic info on the Intel IOMMU virtualization support.
Makefile
	- This file does nothing. Removing it breaks make htmldocs and
	  make distclean.
ManagementStyle
	- how to (attempt to) manage kernel hackers.
	- It's not of interest for those who aren't touching the build system.
Makefile.sphinx
	- It's not of interest for those who aren't touching the build system.
PCI/
	- info related to PCI drivers.
RCU/
	- directory with info on RCU (read-copy update).
SAK.txt
	- info on Secure Attention Keys.
SM501.txt
	- Silicon Motion SM501 multimedia companion chip
SecurityBugs
	- procedure for reporting security bugs found in the kernel.
SubmitChecklist
	- Linux kernel patch submission checklist.
SubmittingDrivers
	- procedure to get a new driver source included into the kernel tree.
SubmittingPatches
	- procedure to get a source patch included into the kernel tree.
VGA-softcursor.txt
	- how to change your VGA cursor from a blinking underscore.
	- nothing here, just a pointer to process/coding-style.rst.
accounting/
	- documentation on accounting and taskstats.
acpi/
	- info on ACPI-specific hooks in the kernel.
admin-guide/
	- info related to Linux users and system admins.
aoe/
	- description of AoE (ATA over Ethernet) along with config examples.
applying-patches.txt
	- description of various trees and how to apply their patches.
arm/
	- directory with info about Linux on the ARM architecture.
arm64/
	- directory with info about Linux on the 64 bit ARM architecture.
assoc_array.txt
	- generic associative array intro.
atomic_ops.txt
	- semantics and behavior of atomic and bitmask operations.
auxdisplay/
	- misc. LCD driver documentation (cfag12864b, ks0108).
backlight/
	- directory with info on controlling backlights in flat panel displays
bad_memory.txt
	- how to use kernel parameters to exclude bad RAM regions.
basic_profiling.txt
	- basic instructions for those who wants to profile Linux kernel.
bcache.txt
	- Block-layer cache on fast SSDs to improve slow (raid) I/O performance.
binfmt_misc.txt
	- info on the kernel support for extra binary formats.
blackfin/
	- directory with documentation for the Blackfin arch.
block/
	- info on the Block I/O (BIO) layer.
blockdev/
	- info on block devices & drivers
braille-console.txt
	- info on how to use serial devices for Braille support.
bt8xxgpio.txt
	- info on how to modify a bt8xx video card for GPIO usage.
btmrvl.txt
@@ -114,18 +88,24 @@ cachetlb.txt
	- describes the cache/TLB flushing interfaces Linux uses.
cdrom/
	- directory with information on the CD-ROM drivers that Linux has.
cgroups/
	- cgroups features, including cpusets and memory controller.
cgroup-v1/
	- cgroups v1 features, including cpusets and memory controller.
cgroup-v2.txt
	- cgroups v2 features, including cpusets and memory controller.
circular-buffers.txt
	- how to make use of the existing circular buffer infrastructure
clk.txt
	- info on the common clock framework
coccinelle.txt
	- info on how to get and use the Coccinelle code checking tool.
cma/
	- Continuous Memory Area (CMA) debugfs interface.
conf.py
	- It's not of interest for those who aren't touching the build system.
connector/
	- docs on the netlink based userspace<->kernel space communication mod.
console/
	- documentation on Linux console drivers.
core-api/
	- documentation on kernel core components.
cpu-freq/
	- info on CPU frequency and voltage scaling.
cpu-hotplug.txt
@@ -150,26 +130,26 @@ debugging-via-ohci1394.txt
	- how to use firewire like a hardware debugger memory reader.
dell_rbu.txt
	- document demonstrating the use of the Dell Remote BIOS Update driver.
development-process/
	- how to work with the mainline kernel development process.
dev-tools/
	- directory with info on development tools for the kernel.
device-mapper/
	- directory with info on Device Mapper.
devices.txt
	- plain ASCII listing of all the nodes in /dev/ with major minor #'s.
dmaengine/
	- the DMA engine and controller API guides.
devicetree/
	- directory with info on device tree files used by OF/PowerPC/ARM
digsig.txt
	-info on the Digital Signature Verification API
dma-buf-sharing.txt
	- the DMA Buffer Sharing API Guide
docutils.conf
	- nothing here. Just a configuration file for docutils.
dontdiff
	- file containing a list of files that should never be diff'ed.
driver-api/
	- the Linux driver implementer's API guide.
driver-model/
	- directory with info about Linux driver model.
dvb/
	- info on Linux Digital Video Broadcast (DVB) subsystem.
dynamic-debug-howto.txt
	- how to use the dynamic debug (dyndbg) feature.
early-userspace/
	- info about initramfs, klibc, and userspace early during boot.
edac.txt
@@ -178,14 +158,16 @@ efi-stub.txt
	- How to use the EFI boot stub to bypass GRUB or elilo on EFI systems.
eisa.txt
	- info on EISA bus support.
email-clients.txt
	- info on how to use e-mail to send un-mangled (git) patches.
extcon/
	- directory with porting guide for Android kernel switch driver.
isa.txt
	- info on EISA bus support.
fault-injection/
	- dir with docs about the fault injection capabilities infrastructure.
fb/
	- directory with info on the frame buffer graphics abstraction layer.
features/
	- status of feature implementation on different architectures.
filesystems/
	- info on the vfs and the various filesystems that Linux supports.
firmware_class/
@@ -194,20 +176,22 @@ flexible-arrays.txt
	- how to make use of flexible sized arrays in linux
fmc/
	- information about the FMC bus abstraction
fpga/
	- FPGA Manager Core.
frv/
	- Fujitsu FR-V Linux documentation.
futex-requeue-pi.txt
	- info on requeueing of tasks from a non-PI futex to a PI futex
gcov.txt
	- use of GCC's coverage testing tool "gcov" with the Linux kernel
gcc-plugins.txt
	- GCC plugin infrastructure.
gpio/
	- gpio related documentation
gpu/
	- directory with information on GPU driver developer's guide.
hid/
	- directory with information on human interface devices
highuid.txt
	- notes on the change from 16 bit to 32 bit user/group IDs.
hsi.txt
	- HSI subsystem overview.
hwspinlock.txt
	- hardware spinlock provides hardware assistance for synchronization
timers/
@@ -218,18 +202,18 @@ hwmon/
	- directory with docs on various hardware monitoring drivers.
i2c/
	- directory with info about the I2C bus/protocol (2 wire, kHz speed).
i2o/
	- directory with info about the Linux I2O subsystem.
x86/i386/
	- directory with info about Linux on Intel 32 bit architecture.
ia64/
	- directory with info about Linux on Intel 64 bit architecture.
ide/
	- Information regarding the Enhanced IDE drive.
iio/
	- info on industrial IIO configfs support.
index.rst
	- main index for the documentation at ReST format.
infiniband/
	- directory with documents concerning Linux InfiniBand support.
init.txt
	- what to do when the kernel can't find the 1st process to run.
initrd.txt
	- how to use the RAM disk as an initial/temporary root filesystem.
input/
	- info on Linux input device support.
intel_txt.txt
@@ -248,28 +232,16 @@ isapnp.txt
	- info on Linux ISA Plug & Play support.
isdn/
	- directory with info on the Linux ISDN support, and supported cards.
java.txt
	- info on the in-kernel binary support for Java(tm).
ja_JP/
	- directory with Japanese translations of various documents
kbuild/
	- directory with info about the kernel build process.
kernel-doc-nano-HOWTO.txt
	- outdated info about kernel-doc documentation.
kdump/
	- directory with mini HowTo on getting the crash dump code to work.
kernel-docs.txt
	- listing of various WWW + books that document kernel internals.
kernel-documentation.rst
doc-guide/
	- how to write and format reStructuredText kernel documentation
kernel-parameters.txt
	- summary listing of command line / boot prompt args for the kernel.
kernel-per-CPU-kthreads.txt
	- List of all per-CPU kthreads and how they introduce jitter.
kmemcheck.txt
	- info on dynamic checker that detects uses of uninitialized memory.
kmemleak.txt
	- info on how to make use of the kernel memory leak detection system
ko_KR/
	- directory with Korean translations of various documents
kobject.txt
	- info of the kobject infrastructure of the Linux kernel.
kprobes.txt
@@ -284,8 +256,8 @@ ldm.txt
	- a brief description of LDM (Windows Dynamic Disks).
leds/
	- directory with info about LED handling under Linux.
local_ops.txt
	- semantics and behavior of local atomic operations.
livepatch/
	- info on kernel live patching.
locking/
	- directory with info about kernel locking primitives
lockup-watchdogs.txt
@@ -298,22 +270,24 @@ lzo.txt
	- kernel LZO decompressor input formats
m68k/
	- directory with info about Linux on Motorola 68k architecture.
magic-number.txt
	- list of magic numbers used to mark/protect kernel data structures.
mailbox.txt
	- How to write drivers for the common mailbox framework (IPC).
md.txt
	- info on boot arguments for the multiple devices driver.
media-framework.txt
	- info on media framework, its data structures, functions and usage.
md-cluster.txt
	- info on shared-device RAID MD cluster.
media/
	- info on media drivers: uAPI, kAPI and driver documentation.
memory-barriers.txt
	- info on Linux kernel memory barriers.
memory-devices/
	- directory with info on parts like the Texas Instruments EMIF driver
memory-hotplug.txt
	- Hotpluggable memory support, how to use and current status.
men-chameleon-bus.txt
	- info on MEN chameleon bus.
metag/
	- directory with info about Linux on Meta architecture.
mic/
	- Intel Many Integrated Core (MIC) architecture device driver.
mips/
	- directory with info about Linux on MIPS architecture.
misc-devices/
@@ -322,12 +296,8 @@ mmc/
	- directory with info about the MMC subsystem
mn10300/
	- directory with info about the mn10300 architecture port
module-signing.txt
	- Kernel module signing for increased security when loading modules.
mtd/
	- directory with info about memory technology devices (flash)
mono.txt
	- how to execute Mono-based .NET binaries with the help of BINFMT_MISC.
namespaces/
	- directory with various information about namespaces
netlabel/
@@ -336,30 +306,42 @@ networking/
	- directory with info on various aspects of networking with Linux.
nfc/
	- directory relating info about Near Field Communications support.
nios2/
	- Linux on the Nios II architecture.
nommu-mmap.txt
	- documentation about no-mmu memory mapping support.
numastat.txt
	- info on how to read Numa policy hit/miss statistics in sysfs.
oops-tracing.txt
	- how to decode those nasty internal kernel error dump messages.
ntb.txt
	- info on Non-Transparent Bridge (NTB) drivers.
nvdimm/
	- info on non-volatile devices.
nvmem/
	- info on non volatile memory framework.
output/
	- default directory where html/LaTeX/pdf files will be written.
padata.txt
	- An introduction to the "padata" parallel execution API
parisc/
	- directory with info on using Linux on PA-RISC architecture.
parport.txt
	- how to use the parallel-port driver.
parport-lowlevel.txt
	- description and usage of the low level parallel port functions.
pcmcia/
	- info on the Linux PCMCIA driver.
percpu-rw-semaphore.txt
	- RCU based read-write semaphore optimized for locking for reading
perf/
	- info about the APM X-Gene SoC Performance Monitoring Unit (PMU).
phy/
	- ino on Samsung USB 2.0 PHY adaptation layer.
phy.txt
	- Description of the generic PHY framework.
pi-futex.txt
	- documentation on lightweight priority inheritance futexes.
pinctrl.txt
	- info on pinctrl subsystem and the PINMUX/PINCONF and drivers
platform/
	- List of supported hardware by compal and Dell laptop.
pnp.txt
	- Linux Plug and Play documentation.
power/
@@ -372,14 +354,16 @@ preempt-locking.txt
	- info on locking under a preemptive kernel.
printk-formats.txt
	- how to get printk format specifiers right
process/
	- how to work with the mainline kernel development process.
pps/
	- directory with information on the pulse-per-second support
pti/
	- directory with info on Intel MID PTI.
ptp/
	- directory with info on support for IEEE 1588 PTP clocks in Linux.
pwm.txt
	- info on the pulse width modulation driver subsystem
ramoops.txt
	- documentation of the ramoops oops/panic logging module.
rapidio/
	- directory with info on RapidIO packet-based fabric interconnect
rbtree.txt
@@ -406,8 +390,6 @@ security/
	- directory that contains security-related info
serial/
	- directory with info on the low level serial API.
serial-console.txt
	- how to set up Linux with a serial line console as the default.
sgi-ioc4.txt
	- description of the SGI IOC4 PCI (multi function) device.
sh/
@@ -416,24 +398,20 @@ smsc_ece1099.txt
	-info on the smsc Keyboard Scan Expansion/GPIO Expansion device.
sound/
	- directory with info on sound card support.
sparse.txt
	- info on how to obtain and use the sparse tool for typechecking.
spi/
	- overview of Linux kernel Serial Peripheral Interface (SPI) support.
stable_api_nonsense.txt
	- info on why the kernel does not have a stable in-kernel api or abi.
stable_kernel_rules.txt
	- rules and procedures for the -stable kernel releases.
sphinx/
	- no documentation here, just files required by Sphinx toolchain.
sphinx-static/
	- no documentation here, just files required by Sphinx toolchain.
static-keys.txt
	- info on how static keys allow debug code in hotpaths via patching
svga.txt
	- short guide on selecting video modes at boot via VGA BIOS.
sysfs-rules.txt
	- How not to use sysfs.
sync_file.txt
	- Sync file API guide.
sysctl/
	- directory with info on the /proc/sys/* files.
sysrq.txt
	- info on the magic SysRq key.
target/
	- directory with info on generating TCM v4 fabric .ko modules
this_cpu_ops.txt
@@ -442,39 +420,29 @@ thermal/
	- directory with information on managing thermal issues (CPU/temp)
trace/
	- directory with info on tracing technologies within linux
translations/
	- translations of this document from English to another language
unaligned-memory-access.txt
	- info on how to avoid arch breaking unaligned memory access in code.
unicode.txt
	- info on the Unicode character/font mapping used in Linux.
unshare.txt
	- description of the Linux unshare system call.
usb/
	- directory with info regarding the Universal Serial Bus.
vDSO/
	- directory with info regarding virtual dynamic shared objects
vfio.txt
	- info on Virtual Function I/O used in guest/hypervisor instances.
vgaarbiter.txt
	- info on enable/disable the legacy decoding on different VGA devices
video-output.txt
	- sysfs class driver interface to enable/disable a video output device.
video4linux/
	- directory with info regarding video/TV/radio cards and linux.
virtual/
	- directory with information on the various linux virtualizations.
vm/
	- directory with info on the Linux vm code.
vme_api.txt
	- file relating info on the VME bus API in linux
volatile-considered-harmful.txt
	- Why the "volatile" type class should not be used
w1/
	- directory with documents regarding the 1-wire (w1) subsystem.
watchdog/
	- how to auto-reboot Linux if it has "fallen and can't get up". ;-)
wimax/
	- directory with info about Intel Wireless Wimax Connections
workqueue.txt
core-api/workqueue.rst
	- information on the Concurrency Managed Workqueue implementation
x86/x86_64/
	- directory with info on Linux support for AMD x86-64 (Hammer) machines.
@@ -484,7 +452,5 @@ xtensa/
	- directory with documents relating to arch/xtensa port/implementation
xz.txt
	- how to make use of the XZ data compression within linux kernel
zh_CN/
	- directory with Chinese translations of various documents
zorro.txt
	- info on writing drivers for Zorro bus devices found on Amigas.
+1 −1
Original line number Diff line number Diff line
@@ -84,4 +84,4 @@ stable:

- Kernel-internal symbols.  Do not rely on the presence, absence, location, or
  type of any kernel symbol, either in System.map files or the kernel binary
  itself.  See Documentation/stable_api_nonsense.txt.
  itself.  See Documentation/process/stable-api-nonsense.rst.
+1 −1
Original line number Diff line number Diff line
@@ -347,7 +347,7 @@ Description:
		because of fragmentation, SLUB will retry with the minimum order
		possible depending on its characteristics.
		When debug_guardpage_minorder=N (N > 0) parameter is specified
		(see Documentation/kernel-parameters.txt), the minimum possible
		(see Documentation/admin-guide/kernel-parameters.rst), the minimum possible
		order is used and this sysfs entry can not be used to change
		the order at run time.

Documentation/BUG-HUNTING

deleted100644 → 0
+0 −246
Original line number Diff line number Diff line
Table of contents
=================

Last updated: 20 December 2005

Contents
========

- Introduction
- Devices not appearing
- Finding patch that caused a bug
-- Finding using git-bisect
-- Finding it the old way
- Fixing the bug

Introduction
============

Always try the latest kernel from kernel.org and build from source. If you are
not confident in doing that please report the bug to your distribution vendor
instead of to a kernel developer.

Finding bugs is not always easy. Have a go though. If you can't find it don't
give up. Report as much as you have found to the relevant maintainer. See
MAINTAINERS for who that is for the subsystem you have worked on.

Before you submit a bug report read REPORTING-BUGS.

Devices not appearing
=====================

Often this is caused by udev. Check that first before blaming it on the
kernel.

Finding patch that caused a bug
===============================



Finding using git-bisect
------------------------

Using the provided tools with git makes finding bugs easy provided the bug is
reproducible.

Steps to do it:
- start using git for the kernel source
- read the man page for git-bisect
- have fun

Finding it the old way
----------------------

[Sat Mar  2 10:32:33 PST 1996 KERNEL_BUG-HOWTO lm@sgi.com (Larry McVoy)]

This is how to track down a bug if you know nothing about kernel hacking.
It's a brute force approach but it works pretty well.

You need:

        . A reproducible bug - it has to happen predictably (sorry)
        . All the kernel tar files from a revision that worked to the
          revision that doesn't

You will then do:

        . Rebuild a revision that you believe works, install, and verify that.
        . Do a binary search over the kernels to figure out which one
          introduced the bug.  I.e., suppose 1.3.28 didn't have the bug, but
          you know that 1.3.69 does.  Pick a kernel in the middle and build
          that, like 1.3.50.  Build & test; if it works, pick the mid point
          between .50 and .69, else the mid point between .28 and .50.
        . You'll narrow it down to the kernel that introduced the bug.  You
          can probably do better than this but it gets tricky.

        . Narrow it down to a subdirectory

          - Copy kernel that works into "test".  Let's say that 3.62 works,
            but 3.63 doesn't.  So you diff -r those two kernels and come
            up with a list of directories that changed.  For each of those
            directories:

                Copy the non-working directory next to the working directory
                as "dir.63".
                One directory at time, try moving the working directory to
                "dir.62" and mv dir.63 dir"time, try

                        mv dir dir.62
                        mv dir.63 dir
                        find dir -name '*.[oa]' -print | xargs rm -f

                And then rebuild and retest.  Assuming that all related
                changes were contained in the sub directory, this should
                isolate the change to a directory.

                Problems: changes in header files may have occurred; I've
                found in my case that they were self explanatory - you may
                or may not want to give up when that happens.

        . Narrow it down to a file

          - You can apply the same technique to each file in the directory,
            hoping that the changes in that file are self contained.

        . Narrow it down to a routine

          - You can take the old file and the new file and manually create
            a merged file that has

                #ifdef VER62
                routine()
                {
                        ...
                }
                #else
                routine()
                {
                        ...
                }
                #endif

            And then walk through that file, one routine at a time and
            prefix it with

                #define VER62
                /* both routines here */
                #undef VER62

            Then recompile, retest, move the ifdefs until you find the one
            that makes the difference.

Finally, you take all the info that you have, kernel revisions, bug
description, the extent to which you have narrowed it down, and pass
that off to whomever you believe is the maintainer of that section.
A post to linux.dev.kernel isn't such a bad idea if you've done some
work to narrow it down.

If you get it down to a routine, you'll probably get a fix in 24 hours.

My apologies to Linus and the other kernel hackers for describing this
brute force approach, it's hardly what a kernel hacker would do.  However,
it does work and it lets non-hackers help fix bugs.  And it is cool
because Linux snapshots will let you do this - something that you can't
do with vendor supplied releases.

Fixing the bug
==============

Nobody is going to tell you how to fix bugs. Seriously. You need to work it
out. But below are some hints on how to use the tools.

To debug a kernel, use objdump and look for the hex offset from the crash
output to find the valid line of code/assembler. Without debug symbols, you
will see the assembler code for the routine shown, but if your kernel has
debug symbols the C code will also be available. (Debug symbols can be enabled
in the kernel hacking menu of the menu configuration.) For example:

    objdump -r -S -l --disassemble net/dccp/ipv4.o

NB.: you need to be at the top level of the kernel tree for this to pick up
your C files.

If you don't have access to the code you can also debug on some crash dumps
e.g. crash dump output as shown by Dave Miller.

>    EIP is at ip_queue_xmit+0x14/0x4c0
>     ...
>    Code: 44 24 04 e8 6f 05 00 00 e9 e8 fe ff ff 8d 76 00 8d bc 27 00 00
>    00 00 55 57  56 53 81 ec bc 00 00 00 8b ac 24 d0 00 00 00 8b 5d 08
>    <8b> 83 3c 01 00 00 89 44  24 14 8b 45 28 85 c0 89 44 24 18 0f 85
>
>    Put the bytes into a "foo.s" file like this:
>
>           .text
>           .globl foo
>    foo:
>           .byte  .... /* bytes from Code: part of OOPS dump */
>
>    Compile it with "gcc -c -o foo.o foo.s" then look at the output of
>    "objdump --disassemble foo.o".
>
>    Output:
>
>    ip_queue_xmit:
>        push       %ebp
>        push       %edi
>        push       %esi
>        push       %ebx
>        sub        $0xbc, %esp
>        mov        0xd0(%esp), %ebp        ! %ebp = arg0 (skb)
>        mov        0x8(%ebp), %ebx         ! %ebx = skb->sk
>        mov        0x13c(%ebx), %eax       ! %eax = inet_sk(sk)->opt

In addition, you can use GDB to figure out the exact file and line
number of the OOPS from the vmlinux file. If you have
CONFIG_DEBUG_INFO enabled, you can simply copy the EIP value from the
OOPS:

 EIP:    0060:[<c021e50e>]    Not tainted VLI

And use GDB to translate that to human-readable form:

  gdb vmlinux
  (gdb) l *0xc021e50e

If you don't have CONFIG_DEBUG_INFO enabled, you use the function
offset from the OOPS:

 EIP is at vt_ioctl+0xda8/0x1482

And recompile the kernel with CONFIG_DEBUG_INFO enabled:

  make vmlinux
  gdb vmlinux
  (gdb) p vt_ioctl
  (gdb) l *(0x<address of vt_ioctl> + 0xda8)
or, as one command
  (gdb) l *(vt_ioctl + 0xda8)

If you have a call trace, such as :-
>Call Trace:
> [<ffffffff8802c8e9>] :jbd:log_wait_commit+0xa3/0xf5
> [<ffffffff810482d9>] autoremove_wake_function+0x0/0x2e
> [<ffffffff8802770b>] :jbd:journal_stop+0x1be/0x1ee
> ...
this shows the problem in the :jbd: module. You can load that module in gdb
and list the relevant code.
  gdb fs/jbd/jbd.ko
  (gdb) p log_wait_commit
  (gdb) l *(0x<address> + 0xa3)
or
  (gdb) l *(log_wait_commit + 0xa3)


Another very useful option of the Kernel Hacking section in menuconfig is
Debug memory allocations. This will help you see whether data has been
initialised and not set before use etc. To see the values that get assigned
with this look at mm/slab.c and search for POISON_INUSE. When using this an
Oops will often show the poisoned data instead of zero which is the default.

Once you have worked out a fix please submit it upstream. After all open
source is about sharing what you do and don't you want to be recognised for
your genius?

Please do read Documentation/SubmittingPatches though to help your code get
accepted.
+1 −1062

File changed.

Preview size limit exceeded, changes collapsed.

Loading