projects/linux·commit 6fd03301

Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6

6fd03301 · Linus Torvalds <[email protected]> · 2009-06-16 12:57:37 -07:00

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (64 commits)
  debugfs: use specified mode to possibly mark files read/write only
  debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem.
  xen: remove driver_data direct access of struct device from more drivers
  usb: gadget: at91_udc: remove driver_data direct access of struct device
  uml: remove driver_data direct access of struct device
  block/ps3: remove driver_data direct access of struct device
  s390: remove driver_data direct access of struct device
  parport: remove driver_data direct access of struct device
  parisc: remove driver_data direct access of struct device
  of_serial: remove driver_data direct access of struct device
  mips: remove driver_data direct access of struct device
  ipmi: remove driver_data direct access of struct device
  infiniband: ehca: remove driver_data direct access of struct device
  ibmvscsi: gadget: at91_udc: remove driver_data direct access of struct device
  hvcs: remove driver_data direct access of struct device
  xen block: remove driver_data direct access of struct device
  thermal: remove driver_data direct access of struct device
  scsi: remove driver_data direct access of struct device
  pcmcia: remove driver_data direct access of struct device
  PCIE: remove driver_data direct access of struct device
  ...

Manually fix up trivial conflicts due to different direct driver_data
direct access fixups in drivers/block/{ps3disk.c,ps3vram.c}
Commit
6fd03301d76bc439382710e449f58efbb233df1b
Parents
cd5232bd · e4792aa3

Merge commit. Changes below are compared with the first parent: cd5232bd.

Changes

121 files changed · +875 −812

FileStatusAddDelContent
Documentation/DocBook/debugobjects.tmplmodified+1−1View file
Documentation/cdrom/packet-writing.txtmodified+1−1View file
Documentation/driver-model/device.txtmodified+32−0View file
Documentation/fault-injection/fault-injection.txtmodified+35−35View file
Documentation/firmware_class/READMEmodified+2−1View file
Documentation/kprobes.txtmodified+3−3View file
Documentation/trace/ftrace.txtmodified+142−91View file
Documentation/trace/mmiotrace.txtmodified+13−13View file
arch/mips/sni/eisa.cmodified+1−1View file
arch/um/drivers/net_kern.cmodified+2−2View file
arch/um/drivers/ubd_kern.cmodified+2−2View file
arch/x86/kernel/cpuid.cmodified+6−0View file
arch/x86/kernel/microcode_core.cmodified+1−0View file
arch/x86/kernel/msr.cmodified+6−0View file
block/bsg.cmodified+6−0View file
block/genhd.cmodified+10−0View file
drivers/base/core.cmodified+54−3View file
drivers/base/dd.cmodified+5−1View file
drivers/base/firmware_class.cmodified+19−8View file
drivers/base/platform.cmodified+4−3View file
drivers/base/sys.cmodified+7−1View file
drivers/block/aoe/aoechr.cmodified+7−0View file
drivers/block/pktcdvd.cmodified+8−1View file
drivers/block/xen-blkfront.cmodified+7−7View file
drivers/char/hvcs.cmodified+3−3View file
drivers/char/hw_random/core.cmodified+1−0View file
drivers/char/ipmi/ipmi_si_intf.cmodified+2−2View file
drivers/char/misc.cmodified+12−3View file
drivers/char/raw.cmodified+6−0View file
drivers/eisa/pci_eisa.cmodified+1−1View file
drivers/eisa/virtual_root.cmodified+1−1View file
drivers/firewire/fw-sbp2.cmodified+3−3View file
drivers/gpu/drm/drm_debugfs.cmodified+6−6View file
drivers/gpu/drm/drm_drv.cmodified+1−1View file
drivers/gpu/drm/drm_stub.cmodified+1−1View file
drivers/gpu/drm/drm_sysfs.cmodified+7−0View file
drivers/hid/usbhid/hiddev.cmodified+6−1View file
drivers/ide/ide-pm.cmodified+4−2View file
drivers/ide/ide-probe.cmodified+2−2View file
drivers/ide/ide_platform.cmodified+1−1View file
drivers/ieee1394/eth1394.cmodified+7−9View file
drivers/ieee1394/sbp2.cmodified+4−4View file
drivers/infiniband/core/sysfs.cmodified+1−1View file
drivers/infiniband/hw/ehca/ehca_main.cmodified+4−4View file
drivers/input/input.cmodified+6−0View file
drivers/input/touchscreen/wm97xx-core.cmodified+1−1View file
drivers/input/xen-kbdfront.cmodified+4−4View file
drivers/md/dm-ioctl.cmodified+1−0View file
drivers/media/common/tuners/tuner-xc2028.cmodified+1−1View file
drivers/media/dvb/dvb-core/dvbdev.cmodified+10−0View file
drivers/media/dvb/dvb-usb/dvb-usb.hmodified+1−1View file
drivers/media/dvb/firewire/firedtv-1394.cmodified+2−2View file
drivers/media/dvb/firewire/firedtv-dvb.cmodified+1−1View file
drivers/media/video/dabusb.cmodified+6−0View file
drivers/media/video/pvrusb2/pvrusb2-sysfs.cmodified+11−11View file
drivers/mfd/htc-pasic3.cmodified+2−2View file
drivers/mfd/pcf50633-core.cmodified+1−1View file
drivers/mfd/wm8400-core.cmodified+1−1View file
drivers/net/Kconfigmodified+2−2View file
drivers/net/tun.cmodified+1−0View file
drivers/net/wimax/i2400m/i2400m.hmodified+1−1View file
drivers/net/wireless/ath/ath5k/Kconfigmodified+2−3View file
drivers/net/wireless/libertas/READMEmodified+6−6View file
drivers/net/wireless/libertas/if_spi.cmodified+4−4View file
drivers/net/wireless/libertas/if_spi.hmodified+3−0View file
drivers/net/wireless/libertas/if_usb.cmodified+2−6View file
drivers/net/xen-netfront.cmodified+5−5View file
drivers/parisc/eisa.cmodified+1−1View file
drivers/parisc/sba_iommu.cmodified+3−3View file
drivers/parport/parport_gsc.cmodified+2−2View file
drivers/pci/pcie/portdrv_core.cmodified+1−1View file
drivers/pcmcia/ds.cmodified+5−15View file
drivers/s390/char/con3215.cmodified+8−8View file
drivers/s390/char/raw3270.cmodified+8−8View file
drivers/s390/char/tape_34xx.cmodified+1−1View file
drivers/s390/char/tape_3590.cmodified+1−1View file
drivers/s390/char/tape_core.cmodified+11−11View file
drivers/s390/char/vmlogrdr.cmodified+6−6View file
drivers/s390/char/vmur.cmodified+8−8View file
drivers/s390/net/claw.cmodified+26−26View file
drivers/s390/net/lcs.cmodified+10−10View file
drivers/s390/net/lcs.hmodified+2−2View file
drivers/s390/net/netiucv.cmodified+24−23View file
drivers/scsi/aha1740.cmodified+1−1View file
drivers/scsi/ibmvscsi/ibmvscsi.cmodified+3−3View file
drivers/scsi/ibmvscsi/ibmvstgt.cmodified+1−1View file
drivers/scsi/libsrp.cmodified+1−1View file
drivers/scsi/lpfc/lpfc_debugfs.cmodified+1−2View file
drivers/serial/of_serial.cmodified+2−2View file
drivers/thermal/thermal_sys.cmodified+2−2View file
drivers/usb/atm/ueagle-atm.cmodified+5−4View file
drivers/usb/class/usblp.cmodified+6−0View file
drivers/usb/core/file.cmodified+12−1View file
drivers/usb/core/usb.cmodified+11−0View file
drivers/usb/gadget/at91_udc.cmodified+3−3View file
drivers/usb/misc/iowarrior.cmodified+6−0View file
drivers/usb/misc/legousbtower.cmodified+6−0View file
drivers/video/xen-fbfront.cmodified+4−4View file
fs/debugfs/file.cmodified+64−1View file
fs/debugfs/inode.cmodified+11−0View file
fs/sysfs/symlink.cmodified+4−1View file
include/linux/device.hmodified+5−0View file
include/linux/eisa.hmodified+2−2View file
include/linux/firmware.hmodified+0−1View file
include/linux/genhd.hmodified+1−1View file
include/linux/kernel.hmodified+1−1View file
include/linux/miscdevice.hmodified+1−0View file
include/linux/platform_device.hmodified+2−2View file
include/linux/sched.hmodified+1−1View file
include/linux/tracepoint.hmodified+2−2View file
include/linux/usb.hmodified+3−0View file
init/Kconfigmodified+3−3View file
kernel/trace/Kconfigmodified+5−5View file
kernel/trace/trace.cmodified+11−12View file
kernel/user.cmodified+39−28View file
lib/kobject.cmodified+6−1View file
samples/Kconfigmodified+2−1View file
samples/firmware_class/firmware_sample_driver.cdeleted+0−121View before deletion
samples/firmware_class/firmware_sample_firmware_class.cdeleted+0−204View before deletion
scripts/tracing/draw_functrace.pymodified+3−4View file
sound/sound_core.cmodified+7−0View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/DocBook/debugobjects.tmpl

View file
diff --git a/Documentation/DocBook/debugobjects.tmpl b/Documentation/DocBook/debugobjects.tmpl
index 7f5f218..08ff908 100644
--- a/Documentation/DocBook/debugobjects.tmpl
+++ b/Documentation/DocBook/debugobjects.tmpl
@@ -106,7 +106,7 @@
number of errors are printk'ed including a full stack trace.
</para>
<para>
- The statistics are available via debugfs/debug_objects/stats.
+ The statistics are available via /sys/kernel/debug/debug_objects/stats.
They provide information about the number of warnings and the
number of successful fixups along with information about the
usage of the internal tracking objects and the state of the

Documentation/cdrom/packet-writing.txt

View file
diff --git a/Documentation/cdrom/packet-writing.txt b/Documentation/cdrom/packet-writing.txt
index cf1f812..1c40777 100644
--- a/Documentation/cdrom/packet-writing.txt
+++ b/Documentation/cdrom/packet-writing.txt
@@ -117,7 +117,7 @@ Using the pktcdvd debugfs interface
To read pktcdvd device infos in human readable form, do:
- # cat /debug/pktcdvd/pktcdvd[0-7]/info
+ # cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/info
For a description of the debugfs interface look into the file:

Documentation/driver-model/device.txt

View file
diff --git a/Documentation/driver-model/device.txt b/Documentation/driver-model/device.txt
index a7cbfff..a124f31 100644
--- a/Documentation/driver-model/device.txt
+++ b/Documentation/driver-model/device.txt
@@ -162,3 +162,35 @@ device_remove_file(dev,&dev_attr_power);
The file name will be 'power' with a mode of 0644 (-rw-r--r--).
+Word of warning: While the kernel allows device_create_file() and
+device_remove_file() to be called on a device at any time, userspace has
+strict expectations on when attributes get created. When a new device is
+registered in the kernel, a uevent is generated to notify userspace (like
+udev) that a new device is available. If attributes are added after the
+device is registered, then userspace won't get notified and userspace will
+not know about the new attributes.
+
+This is important for device driver that need to publish additional
+attributes for a device at driver probe time. If the device driver simply
+calls device_create_file() on the device structure passed to it, then
+userspace will never be notified of the new attributes. Instead, it should
+probably use class_create() and class->dev_attrs to set up a list of
+desired attributes in the modules_init function, and then in the .probe()
+hook, and then use device_create() to create a new device as a child
+of the probed device. The new device will generate a new uevent and
+properly advertise the new attributes to userspace.
+
+For example, if a driver wanted to add the following attributes:
+struct device_attribute mydriver_attribs[] = {
+ __ATTR(port_count, 0444, port_count_show),
+ __ATTR(serial_number, 0444, serial_number_show),
+ NULL
+};
+
+Then in the module init function is would do:
+ mydriver_class = class_create(THIS_MODULE, "my_attrs");
+ mydriver_class.dev_attr = mydriver_attribs;
+
+And assuming 'dev' is the struct device passed into the probe hook, the driver
+probe function would do something like:
+ create_device(&mydriver_class, dev, chrdev, &private_data, "my_name");

Documentation/fault-injection/fault-injection.txt

View file
diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt
index 4bc374a..0793056 100644
--- a/Documentation/fault-injection/fault-injection.txt
+++ b/Documentation/fault-injection/fault-injection.txt
@@ -29,16 +29,16 @@ o debugfs entries
fault-inject-debugfs kernel module provides some debugfs entries for runtime
configuration of fault-injection capabilities.
-- /debug/fail*/probability:
+- /sys/kernel/debug/fail*/probability:
likelihood of failure injection, in percent.
Format: <percent>
Note that one-failure-per-hundred is a very high error rate
for some testcases. Consider setting probability=100 and configure
- /debug/fail*/interval for such testcases.
+ /sys/kernel/debug/fail*/interval for such testcases.
-- /debug/fail*/interval:
+- /sys/kernel/debug/fail*/interval:
specifies the interval between failures, for calls to
should_fail() that pass all the other tests.
@@ -46,18 +46,18 @@ configuration of fault-injection capabilities.
Note that if you enable this, by setting interval>1, you will
probably want to set probability=100.
-- /debug/fail*/times:
+- /sys/kernel/debug/fail*/times:
specifies how many times failures may happen at most.
A value of -1 means "no limit".
-- /debug/fail*/space:
+- /sys/kernel/debug/fail*/space:
specifies an initial resource "budget", decremented by "size"
on each call to should_fail(,size). Failure injection is
suppressed until "space" reaches zero.
-- /debug/fail*/verbose
+- /sys/kernel/debug/fail*/verbose
Format: { 0 | 1 | 2 }
specifies the verbosity of the messages when failure is
@@ -65,17 +65,17 @@ configuration of fault-injection capabilities.
log line per failure; '2' will print a call trace too -- useful
to debug the problems revealed by fault injection.
-- /debug/fail*/task-filter:
+- /sys/kernel/debug/fail*/task-filter:
Format: { 'Y' | 'N' }
A value of 'N' disables filtering by process (default).
Any positive value limits failures to only processes indicated by
/proc/<pid>/make-it-fail==1.
-- /debug/fail*/require-start:
-- /debug/fail*/require-end:
-- /debug/fail*/reject-start:
-- /debug/fail*/reject-end:
+- /sys/kernel/debug/fail*/require-start:
+- /sys/kernel/debug/fail*/require-end:
+- /sys/kernel/debug/fail*/reject-start:
+- /sys/kernel/debug/fail*/reject-end:
specifies the range of virtual addresses tested during
stacktrace walking. Failure is injected only if some caller
@@ -84,26 +84,26 @@ configuration of fault-injection capabilities.
Default required range is [0,ULONG_MAX) (whole of virtual address space).
Default rejected range is [0,0).
-- /debug/fail*/stacktrace-depth:
+- /sys/kernel/debug/fail*/stacktrace-depth:
specifies the maximum stacktrace depth walked during search
for a caller within [require-start,require-end) OR
[reject-start,reject-end).
-- /debug/fail_page_alloc/ignore-gfp-highmem:
+- /sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem:
Format: { 'Y' | 'N' }
default is 'N', setting it to 'Y' won't inject failures into
highmem/user allocations.
-- /debug/failslab/ignore-gfp-wait:
-- /debug/fail_page_alloc/ignore-gfp-wait:
+- /sys/kernel/debug/failslab/ignore-gfp-wait:
+- /sys/kernel/debug/fail_page_alloc/ignore-gfp-wait:
Format: { 'Y' | 'N' }
default is 'N', setting it to 'Y' will inject failures
only into non-sleep allocations (GFP_ATOMIC allocations).
-- /debug/fail_page_alloc/min-order:
+- /sys/kernel/debug/fail_page_alloc/min-order:
specifies the minimum page allocation order to be injected
failures.
@@ -166,13 +166,13 @@ o Inject slab allocation failures into module init/exit code
#!/bin/bash
FAILTYPE=failslab
-echo Y > /debug/$FAILTYPE/task-filter
-echo 10 > /debug/$FAILTYPE/probability
-echo 100 > /debug/$FAILTYPE/interval
-echo -1 > /debug/$FAILTYPE/times
-echo 0 > /debug/$FAILTYPE/space
-echo 2 > /debug/$FAILTYPE/verbose
-echo 1 > /debug/$FAILTYPE/ignore-gfp-wait
+echo Y > /sys/kernel/debug/$FAILTYPE/task-filter
+echo 10 > /sys/kernel/debug/$FAILTYPE/probability
+echo 100 > /sys/kernel/debug/$FAILTYPE/interval
+echo -1 > /sys/kernel/debug/$FAILTYPE/times
+echo 0 > /sys/kernel/debug/$FAILTYPE/space
+echo 2 > /sys/kernel/debug/$FAILTYPE/verbose
+echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
faulty_system()
{
@@ -217,20 +217,20 @@ then
exit 1
fi
-cat /sys/module/$module/sections/.text > /debug/$FAILTYPE/require-start
-cat /sys/module/$module/sections/.data > /debug/$FAILTYPE/require-end
+cat /sys/module/$module/sections/.text > /sys/kernel/debug/$FAILTYPE/require-start
+cat /sys/module/$module/sections/.data > /sys/kernel/debug/$FAILTYPE/require-end
-echo N > /debug/$FAILTYPE/task-filter
-echo 10 > /debug/$FAILTYPE/probability
-echo 100 > /debug/$FAILTYPE/interval
-echo -1 > /debug/$FAILTYPE/times
-echo 0 > /debug/$FAILTYPE/space
-echo 2 > /debug/$FAILTYPE/verbose
-echo 1 > /debug/$FAILTYPE/ignore-gfp-wait
-echo 1 > /debug/$FAILTYPE/ignore-gfp-highmem
-echo 10 > /debug/$FAILTYPE/stacktrace-depth
+echo N > /sys/kernel/debug/$FAILTYPE/task-filter
+echo 10 > /sys/kernel/debug/$FAILTYPE/probability
+echo 100 > /sys/kernel/debug/$FAILTYPE/interval
+echo -1 > /sys/kernel/debug/$FAILTYPE/times
+echo 0 > /sys/kernel/debug/$FAILTYPE/space
+echo 2 > /sys/kernel/debug/$FAILTYPE/verbose
+echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
+echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-highmem
+echo 10 > /sys/kernel/debug/$FAILTYPE/stacktrace-depth
-trap "echo 0 > /debug/$FAILTYPE/probability" SIGINT SIGTERM EXIT
+trap "echo 0 > /sys/kernel/debug/$FAILTYPE/probability" SIGINT SIGTERM EXIT
echo "Injecting errors into the module $module... (interrupt to stop)"
sleep 1000000

Documentation/firmware_class/README

View file
diff --git a/Documentation/firmware_class/README b/Documentation/firmware_class/README
index c3480aa..7eceaff 100644
--- a/Documentation/firmware_class/README
+++ b/Documentation/firmware_class/README
@@ -77,7 +77,8 @@
seconds for the whole load operation.
- request_firmware_nowait() is also provided for convenience in
- non-user contexts.
+ user contexts to request firmware asynchronously, but can't be called
+ in atomic contexts.
about in-kernel persistence:

Documentation/kprobes.txt

View file
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 1e7a769..053037a 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -507,9 +507,9 @@ http://www.linuxsymposium.org/2006/linuxsymposium_procv2.pdf (pages 101-115)
Appendix A: The kprobes debugfs interface
With recent kernels (> 2.6.20) the list of registered kprobes is visible
-under the /debug/kprobes/ directory (assuming debugfs is mounted at /debug).
+under the /sys/kernel/debug/kprobes/ directory (assuming debugfs is mounted at //sys/kernel/debug).
-/debug/kprobes/list: Lists all registered probes on the system
+/sys/kernel/debug/kprobes/list: Lists all registered probes on the system
c015d71a k vfs_read+0x0
c011a316 j do_fork+0x0
@@ -525,7 +525,7 @@ virtual addresses that correspond to modules that've been unloaded),
such probes are marked with [GONE]. If the probe is temporarily disabled,
such probes are marked with [DISABLED].
-/debug/kprobes/enabled: Turn kprobes ON/OFF forcibly.
+/sys/kernel/debug/kprobes/enabled: Turn kprobes ON/OFF forcibly.
Provides a knob to globally and forcibly turn registered kprobes ON or OFF.
By default, all kprobes are enabled. By echoing "0" to this file, all

Documentation/trace/ftrace.txt

View file
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt
index 7bd27f0..a39b3c7 100644
--- a/Documentation/trace/ftrace.txt
+++ b/Documentation/trace/ftrace.txt
@@ -7,7 +7,6 @@ Copyright 2008 Red Hat Inc.
(dual licensed under the GPL v2)
Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton,
John Kacur, and David Teigland.
-
Written for: 2.6.28-rc2
Introduction
@@ -33,13 +32,26 @@ The File System
Ftrace uses the debugfs file system to hold the control files as
well as the files to display output.
-To mount the debugfs system:
+When debugfs is configured into the kernel (which selecting any ftrace
+option will do) the directory /sys/kernel/debug will be created. To mount
+this directory, you can add to your /etc/fstab file:
+
+ debugfs /sys/kernel/debug debugfs defaults 0 0
+
+Or you can mount it at run time with:
+
+ mount -t debugfs nodev /sys/kernel/debug
- # mkdir /debug
- # mount -t debugfs nodev /debug
+For quicker access to that directory you may want to make a soft link to
+it:
-( Note: it is more common to mount at /sys/kernel/debug, but for
- simplicity this document will use /debug)
+ ln -s /sys/kernel/debug /debug
+
+Any selected ftrace option will also create a directory called tracing
+within the debugfs. The rest of the document will assume that you are in
+the ftrace directory (cd /sys/kernel/debug/tracing) and will only concentrate
+on the files within that directory and not distract from the content with
+the extended "/sys/kernel/debug/tracing" path name.
That's it! (assuming that you have ftrace configured into your kernel)
@@ -389,18 +401,18 @@ trace_options
The trace_options file is used to control what gets printed in
the trace output. To see what is available, simply cat the file:
- cat /debug/tracing/trace_options
+ cat trace_options
print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \
noblock nostacktrace nosched-tree nouserstacktrace nosym-userobj
To disable one of the options, echo in the option prepended with
"no".
- echo noprint-parent > /debug/tracing/trace_options
+ echo noprint-parent > trace_options
To enable an option, leave off the "no".
- echo sym-offset > /debug/tracing/trace_options
+ echo sym-offset > trace_options
Here are the available options:
@@ -476,11 +488,11 @@ sched_switch
This tracer simply records schedule switches. Here is an example
of how to use it.
- # echo sched_switch > /debug/tracing/current_tracer
- # echo 1 > /debug/tracing/tracing_enabled
+ # echo sched_switch > current_tracer
+ # echo 1 > tracing_enabled
# sleep 1
- # echo 0 > /debug/tracing/tracing_enabled
- # cat /debug/tracing/trace
+ # echo 0 > tracing_enabled
+ # cat trace
# tracer: sched_switch
#
@@ -583,13 +595,13 @@ new trace is saved.
To reset the maximum, echo 0 into tracing_max_latency. Here is
an example:
- # echo irqsoff > /debug/tracing/current_tracer
- # echo 0 > /debug/tracing/tracing_max_latency
- # echo 1 > /debug/tracing/tracing_enabled
+ # echo irqsoff > current_tracer
+ # echo 0 > tracing_max_latency
+ # echo 1 > tracing_enabled
# ls -ltr
[...]
- # echo 0 > /debug/tracing/tracing_enabled
- # cat /debug/tracing/latency_trace
+ # echo 0 > tracing_enabled
+ # cat latency_trace
# tracer: irqsoff
#
irqsoff latency trace v1.1.5 on 2.6.26
@@ -690,13 +702,13 @@ Like the irqsoff tracer, it records the maximum latency for
which preemption was disabled. The control of preemptoff tracer
is much like the irqsoff tracer.
- # echo preemptoff > /debug/tracing/current_tracer
- # echo 0 > /debug/tracing/tracing_max_latency
- # echo 1 > /debug/tracing/tracing_enabled
+ # echo preemptoff > current_tracer
+ # echo 0 > tracing_max_latency
+ # echo 1 > tracing_enabled
# ls -ltr
[...]
- # echo 0 > /debug/tracing/tracing_enabled
- # cat /debug/tracing/latency_trace
+ # echo 0 > tracing_enabled
+ # cat latency_trace
# tracer: preemptoff
#
preemptoff latency trace v1.1.5 on 2.6.26-rc8
@@ -837,13 +849,13 @@ tracer.
Again, using this trace is much like the irqsoff and preemptoff
tracers.
- # echo preemptirqsoff > /debug/tracing/current_tracer
- # echo 0 > /debug/tracing/tracing_max_latency
- # echo 1 > /debug/tracing/tracing_enabled
+ # echo preemptirqsoff > current_tracer
+ # echo 0 > tracing_max_latency
+ # echo 1 > tracing_enabled
# ls -ltr
[...]
- # echo 0 > /debug/tracing/tracing_enabled
- # cat /debug/tracing/latency_trace
+ # echo 0 > tracing_enabled
+ # cat latency_trace
# tracer: preemptirqsoff
#
preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8
@@ -999,12 +1011,12 @@ slightly differently than we did with the previous tracers.
Instead of performing an 'ls', we will run 'sleep 1' under
'chrt' which changes the priority of the task.
- # echo wakeup > /debug/tracing/current_tracer
- # echo 0 > /debug/tracing/tracing_max_latency
- # echo 1 > /debug/tracing/tracing_enabled
+ # echo wakeup > current_tracer
+ # echo 0 > tracing_max_latency
+ # echo 1 > tracing_enabled
# chrt -f 5 sleep 1
- # echo 0 > /debug/tracing/tracing_enabled
- # cat /debug/tracing/latency_trace
+ # echo 0 > tracing_enabled
+ # cat latency_trace
# tracer: wakeup
#
wakeup latency trace v1.1.5 on 2.6.26-rc8
@@ -1114,11 +1126,11 @@ can be done from the debug file system. Make sure the
ftrace_enabled is set; otherwise this tracer is a nop.
# sysctl kernel.ftrace_enabled=1
- # echo function > /debug/tracing/current_tracer
- # echo 1 > /debug/tracing/tracing_enabled
+ # echo function > current_tracer
+ # echo 1 > tracing_enabled
# usleep 1
- # echo 0 > /debug/tracing/tracing_enabled
- # cat /debug/tracing/trace
+ # echo 0 > tracing_enabled
+ # cat trace
# tracer: function
#
# TASK-PID CPU# TIMESTAMP FUNCTION
@@ -1155,7 +1167,7 @@ int trace_fd;
[...]
int main(int argc, char *argv[]) {
[...]
- trace_fd = open("/debug/tracing/tracing_enabled", O_WRONLY);
+ trace_fd = open(tracing_file("tracing_enabled"), O_WRONLY);
[...]
if (condition_hit()) {
write(trace_fd, "0", 1);
@@ -1163,26 +1175,20 @@ int main(int argc, char *argv[]) {
[...]
}
-Note: Here we hard coded the path name. The debugfs mount is not
-guaranteed to be at /debug (and is more commonly at
-/sys/kernel/debug). For simple one time traces, the above is
-sufficent. For anything else, a search through /proc/mounts may
-be needed to find where the debugfs file-system is mounted.
-
Single thread tracing
---------------------
-By writing into /debug/tracing/set_ftrace_pid you can trace a
+By writing into set_ftrace_pid you can trace a
single thread. For example:
-# cat /debug/tracing/set_ftrace_pid
+# cat set_ftrace_pid
no pid
-# echo 3111 > /debug/tracing/set_ftrace_pid
-# cat /debug/tracing/set_ftrace_pid
+# echo 3111 > set_ftrace_pid
+# cat set_ftrace_pid
3111
-# echo function > /debug/tracing/current_tracer
-# cat /debug/tracing/trace | head
+# echo function > current_tracer
+# cat trace | head
# tracer: function
#
# TASK-PID CPU# TIMESTAMP FUNCTION
@@ -1193,8 +1199,8 @@ no pid
yum-updatesd-3111 [003] 1637.254683: lock_hrtimer_base <-hrtimer_try_to_cancel
yum-updatesd-3111 [003] 1637.254685: fget_light <-do_sys_poll
yum-updatesd-3111 [003] 1637.254686: pipe_poll <-do_sys_poll
-# echo -1 > /debug/tracing/set_ftrace_pid
-# cat /debug/tracing/trace |head
+# echo -1 > set_ftrace_pid
+# cat trace |head
# tracer: function
#
# TASK-PID CPU# TIMESTAMP FUNCTION
@@ -1216,6 +1222,51 @@ something like this simple program:
#include <fcntl.h>
#include <unistd.h>
+#define _STR(x) #x
+#define STR(x) _STR(x)
+#define MAX_PATH 256
+
+const char *find_debugfs(void)
+{
+ static char debugfs[MAX_PATH+1];
+ static int debugfs_found;
+ char type[100];
+ FILE *fp;
+
+ if (debugfs_found)
+ return debugfs;
+
+ if ((fp = fopen("/proc/mounts","r")) == NULL) {
+ perror("/proc/mounts");
+ return NULL;
+ }
+
+ while (fscanf(fp, "%*s %"
+ STR(MAX_PATH)
+ "s %99s %*s %*d %*d\n",
+ debugfs, type) == 2) {
+ if (strcmp(type, "debugfs") == 0)
+ break;
+ }
+ fclose(fp);
+
+ if (strcmp(type, "debugfs") != 0) {
+ fprintf(stderr, "debugfs not mounted");
+ return NULL;
+ }
+
+ debugfs_found = 1;
+
+ return debugfs;
+}
+
+const char *tracing_file(const char *file_name)
+{
+ static char trace_file[MAX_PATH+1];
+ snprintf(trace_file, MAX_PATH, "%s/%s", find_debugfs(), file_name);
+ return trace_file;
+}
+
int main (int argc, char **argv)
{
if (argc < 1)
@@ -1226,12 +1277,12 @@ int main (int argc, char **argv)
char line[64];
int s;
- ffd = open("/debug/tracing/current_tracer", O_WRONLY);
+ ffd = open(tracing_file("current_tracer"), O_WRONLY);
if (ffd < 0)
exit(-1);
write(ffd, "nop", 3);
- fd = open("/debug/tracing/set_ftrace_pid", O_WRONLY);
+ fd = open(tracing_file("set_ftrace_pid"), O_WRONLY);
s = sprintf(line, "%d\n", getpid());
write(fd, line, s);
@@ -1383,22 +1434,22 @@ want, depending on your needs.
tracing_cpu_mask file) or you might sometimes see unordered
function calls while cpu tracing switch.
- hide: echo nofuncgraph-cpu > /debug/tracing/trace_options
- show: echo funcgraph-cpu > /debug/tracing/trace_options
+ hide: echo nofuncgraph-cpu > trace_options
+ show: echo funcgraph-cpu > trace_options
- The duration (function's time of execution) is displayed on
the closing bracket line of a function or on the same line
than the current function in case of a leaf one. It is default
enabled.
- hide: echo nofuncgraph-duration > /debug/tracing/trace_options
- show: echo funcgraph-duration > /debug/tracing/trace_options
+ hide: echo nofuncgraph-duration > trace_options
+ show: echo funcgraph-duration > trace_options
- The overhead field precedes the duration field in case of
reached duration thresholds.
- hide: echo nofuncgraph-overhead > /debug/tracing/trace_options
- show: echo funcgraph-overhead > /debug/tracing/trace_options
+ hide: echo nofuncgraph-overhead > trace_options
+ show: echo funcgraph-overhead > trace_options
depends on: funcgraph-duration
ie:
@@ -1427,8 +1478,8 @@ want, depending on your needs.
- The task/pid field displays the thread cmdline and pid which
executed the function. It is default disabled.
- hide: echo nofuncgraph-proc > /debug/tracing/trace_options
- show: echo funcgraph-proc > /debug/tracing/trace_options
+ hide: echo nofuncgraph-proc > trace_options
+ show: echo funcgraph-proc > trace_options
ie:
@@ -1451,8 +1502,8 @@ want, depending on your needs.
system clock since it started. A snapshot of this time is
given on each entry/exit of functions
- hide: echo nofuncgraph-abstime > /debug/tracing/trace_options
- show: echo funcgraph-abstime > /debug/tracing/trace_options
+ hide: echo nofuncgraph-abstime > trace_options

This diff is incomplete. Download the complete patch.

Documentation/trace/mmiotrace.txt

View file

This diff is incomplete. Download the complete patch.

arch/mips/sni/eisa.c

View file

This diff is incomplete. Download the complete patch.

arch/um/drivers/net_kern.c

View file

This diff is incomplete. Download the complete patch.

arch/um/drivers/ubd_kern.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/cpuid.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/microcode_core.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/msr.c

View file

This diff is incomplete. Download the complete patch.

block/bsg.c

View file

This diff is incomplete. Download the complete patch.

block/genhd.c

View file

This diff is incomplete. Download the complete patch.

drivers/base/core.c

View file

This diff is incomplete. Download the complete patch.

drivers/base/dd.c

View file

This diff is incomplete. Download the complete patch.

drivers/base/firmware_class.c

View file

This diff is incomplete. Download the complete patch.

drivers/base/platform.c

View file

This diff is incomplete. Download the complete patch.

drivers/base/sys.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/aoe/aoechr.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/pktcdvd.c

View file

This diff is incomplete. Download the complete patch.

drivers/block/xen-blkfront.c

View file

This diff is incomplete. Download the complete patch.

drivers/char/hvcs.c

View file

This diff is incomplete. Download the complete patch.

drivers/char/hw_random/core.c

View file

This diff is incomplete. Download the complete patch.

drivers/char/ipmi/ipmi_si_intf.c

View file

This diff is incomplete. Download the complete patch.

drivers/char/misc.c

View file

This diff is incomplete. Download the complete patch.

drivers/char/raw.c

View file

This diff is incomplete. Download the complete patch.

drivers/eisa/pci_eisa.c

View file

This diff is incomplete. Download the complete patch.

drivers/eisa/virtual_root.c

View file

This diff is incomplete. Download the complete patch.

drivers/firewire/fw-sbp2.c

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/drm_debugfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/drm_drv.c

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/drm_stub.c

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/drm_sysfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/hid/usbhid/hiddev.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide-pm.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide-probe.c

View file

This diff is incomplete. Download the complete patch.

drivers/ide/ide_platform.c

View file

This diff is incomplete. Download the complete patch.

drivers/ieee1394/eth1394.c

View file

This diff is incomplete. Download the complete patch.

drivers/ieee1394/sbp2.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/core/sysfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ehca/ehca_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/input.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/wm97xx-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/xen-kbdfront.c

View file

This diff is incomplete. Download the complete patch.

drivers/md/dm-ioctl.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/common/tuners/tuner-xc2028.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/dvb/dvb-core/dvbdev.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/dvb/dvb-usb/dvb-usb.h

View file

This diff is incomplete. Download the complete patch.

drivers/media/dvb/firewire/firedtv-1394.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/dvb/firewire/firedtv-dvb.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/video/dabusb.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/video/pvrusb2/pvrusb2-sysfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/htc-pasic3.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/pcf50633-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/wm8400-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/net/tun.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wimax/i2400m/i2400m.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/ath/ath5k/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/libertas/README

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/libertas/if_spi.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/libertas/if_spi.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/libertas/if_usb.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/xen-netfront.c

View file

This diff is incomplete. Download the complete patch.

drivers/parisc/eisa.c

View file

This diff is incomplete. Download the complete patch.

drivers/parisc/sba_iommu.c

View file

This diff is incomplete. Download the complete patch.

drivers/parport/parport_gsc.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/pcie/portdrv_core.c

View file

This diff is incomplete. Download the complete patch.

drivers/pcmcia/ds.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/con3215.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/raw3270.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/tape_34xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/tape_3590.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/tape_core.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/vmlogrdr.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/vmur.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/net/claw.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/net/lcs.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/net/lcs.h

View file

This diff is incomplete. Download the complete patch.

drivers/s390/net/netiucv.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/aha1740.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ibmvscsi/ibmvscsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/ibmvscsi/ibmvstgt.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/libsrp.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/lpfc/lpfc_debugfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/serial/of_serial.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/thermal_sys.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/atm/ueagle-atm.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/class/usblp.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/core/file.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/core/usb.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/gadget/at91_udc.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/misc/iowarrior.c

View file

This diff is incomplete. Download the complete patch.

drivers/usb/misc/legousbtower.c

View file

This diff is incomplete. Download the complete patch.

drivers/video/xen-fbfront.c

View file

This diff is incomplete. Download the complete patch.

fs/debugfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/debugfs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/sysfs/symlink.c

View file

This diff is incomplete. Download the complete patch.

include/linux/device.h

View file

This diff is incomplete. Download the complete patch.

include/linux/eisa.h

View file

This diff is incomplete. Download the complete patch.

include/linux/firmware.h

View file

This diff is incomplete. Download the complete patch.

include/linux/genhd.h

View file

This diff is incomplete. Download the complete patch.

include/linux/kernel.h

View file

This diff is incomplete. Download the complete patch.

include/linux/miscdevice.h

View file

This diff is incomplete. Download the complete patch.

include/linux/platform_device.h

View file

This diff is incomplete. Download the complete patch.

include/linux/sched.h

View file

This diff is incomplete. Download the complete patch.

include/linux/tracepoint.h

View file

This diff is incomplete. Download the complete patch.

include/linux/usb.h

View file

This diff is incomplete. Download the complete patch.

init/Kconfig

View file

This diff is incomplete. Download the complete patch.

kernel/trace/Kconfig

View file

This diff is incomplete. Download the complete patch.

kernel/trace/trace.c

View file

This diff is incomplete. Download the complete patch.

kernel/user.c

View file

This diff is incomplete. Download the complete patch.

lib/kobject.c

View file

This diff is incomplete. Download the complete patch.

samples/Kconfig

View file

This diff is incomplete. Download the complete patch.

samples/firmware_class/firmware_sample_driver.c

View before deletion

This diff is incomplete. Download the complete patch.

samples/firmware_class/firmware_sample_firmware_class.c

View before deletion

This diff is incomplete. Download the complete patch.

scripts/tracing/draw_functrace.py

View file

This diff is incomplete. Download the complete patch.

sound/sound_core.c

View file

This diff is incomplete. Download the complete patch.