2/8 LTT for 2.5.33: Trace driver
PATCH 1/1 2/8 LTT for 2.5.33: Trace driver
This is LTT's trace driver. This patch adds the following files:drivers/trace/Config.helpdrivers/trace/Config.indrivers/trace/tracer.cdrivers/trace/tracer.h
The trace driver uses the rvmalloc/rvfree couple to allocate a mem region it can remap to the daemon's address space.
drivers/Makefile +1 -0
@@ -41,5 +41,6 @@ obj-$(CONFIG_BLUEZ) += bluetooth/ obj-$(CONFIG_HOTPLUG_PCI) += hotplug/ obj-$(CONFIG_ISDN_BOOL) += isdn/ +obj-$(CONFIG_TRACE) += trace/ include $(TOPDIR)/Rules.make
drivers/trace/Config.help +36 -0
@@ -0,0 +1,36 @@ +Kernel events tracing support +CONFIG_TRACE + It is possible for the kernel to log important events to a tracing + driver. Doing so, enables the use of the generated traces in order + to reconstruct the dynamic behavior of the kernel, and hence the + whole system. + + The tracing process contains 4 parts : + 1) The logging of events by key parts of the kernel. + 2) The trace driver that keeps the events in a data buffer. + 3) A trace daemon that opens the trace driver and is notified + every time there is a certain quantity of data to read + from the trace driver (using SIG_IO). + 4) A trace event data decoder that reads the accumulated data + and formats it in a human-readable format. + + If you say Y or M here, the first part of the tracing process will + always take place. That is, critical parts of the kernel will call + upon the kernel tracing function. The data generated doesn't go + any further until a trace driver registers himself as such with the + kernel. Therefore, if you answer Y, then the driver will be part of + the kernel and the events will always proceed onto the driver and + if you say M, then the events will only proceed onto the driver when + it's module is loaded. Note that event's aren't logged in the driver + until the profiling daemon opens the device, configures it and + issues the "start" command through ioctl(). + + The impact of a fully functionnal system (kernel event logging + + driver event copying + active trace daemon) is of 2.5% for core events. + This means that for a task that took 100 seconds on a normal system, it + will take 102.5 seconds on a traced system. This is very low compared + to other profiling or tracing methods. + + For more information on kernel tracing, the trace daemon or the event + decoder, please check the following address : + http://www.opersys.com/LTT
drivers/trace/Config.in +4 -0
@@ -0,0 +1,4 @@ +mainmenu_option next_comment +comment 'Kernel tracing' +tristate 'Kernel events tracing support' CONFIG_TRACE +endmenu
drivers/trace/Makefile +17 -0
@@ -0,0 +1,17 @@ +# +# Makefile for the kernel tracing drivers. +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are now inherited from the +# parent makes.. +# + +O_TARGET := built-in.o + +# Is it loaded as a module or as part of the kernel +obj-$(CONFIG_TRACE) = tracer.o + +include $(TOPDIR)/Rules.make
drivers/trace/tracer.c +1321 -0
1,321 lines not on this page · raw message
drivers/trace/tracer.h +160 -0
160 lines not on this page · raw message