Skip to contentSkip to conversation

LTT for 2.5.36 2/9: Trace driver

PATCH New Karim Yaghmour 1 participant 1 message Sep 19, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LTT for 2.5.36 2/9: Trace driver

This is the LTT trace driver itself. The bulk of the lockless tracing scheme is implemented here. The user can choose between the locking and the lockless scheme by passing the appropriate parameter the daemon's command line.

Here are the file modifications:

 drivers/Makefile          |    1
 drivers/trace/Config.help |   36
 drivers/trace/Config.in   |    4
 drivers/trace/Makefile    |   17
 drivers/trace/tracer.c    | 2340 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/trace/tracer.h    |  232 ++++
 6 files changed, 2630 insertions
drivers/Makefile +1 -0
diff -urpN linux-2.5.36/drivers/Makefile linux-2.5.36-ltt/drivers/Makefile
@@ -41,5 +41,6 @@ obj-$(CONFIG_MD)		+= md/
 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
diff -urpN linux-2.5.36/drivers/trace/Config.help linux-2.5.36-ltt/drivers/trace/Config.help
@@ -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
diff -urpN linux-2.5.36/drivers/trace/Config.in linux-2.5.36-ltt/drivers/trace/Config.in
@@ -0,0 +1,4 @@
+mainmenu_option next_comment
+comment 'Kernel tracing'
+tristate 'Kernel events tracing support' CONFIG_TRACE
+endmenu
drivers/trace/Makefile +17 -0
diff -urpN linux-2.5.36/drivers/trace/Makefile linux-2.5.36-ltt/drivers/trace/Makefile
@@ -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 +2340 -0

2,340 lines not on this page · raw message

drivers/trace/tracer.h +232 -0

232 lines not on this page · raw message