Skip to contentSkip to conversation

LTT for 2.5.37 2/9: Trace driver

PATCH In review Karim Yaghmour 3 participants 4 messages Sep 21, 2002 – Sep 23, 2002

lore
Share & tools
lore
#0 lore raw

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

This is the LTT trace driver itself. This is the only place where the configuration option of the lockless scheme actually has any effect. Otherwise, there would to much of #ifdef's mess around.

Here are the file modifications:

 drivers/Makefile          |    1
 drivers/trace/Config.help |   48
 drivers/trace/Config.in   |    8
 drivers/trace/Makefile    |   17
 drivers/trace/tracer.c    | 2398 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/trace/tracer.h    |  233 ++++
 6 files changed, 2705 insertions 
drivers/Makefile +1 -0
diff -urpN linux-2.5.37/drivers/Makefile linux-2.5.37-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 +48 -0

48 lines not on this page · raw message

drivers/trace/Config.in +8 -0
diff -urpN linux-2.5.37/drivers/trace/Config.in linux-2.5.37-ltt/drivers/trace/Config.in
@@ -0,0 +1,8 @@
+mainmenu_option next_comment
+comment 'Kernel tracing'
+tristate 'Kernel events tracing support' CONFIG_TRACE
+if [ "$CONFIG_TRACE" != "n" ]; then
+   dep_mbool '  Lock-free tracing support' CONFIG_LOCKLESS_TRACE $CONFIG_TRACE
+fi
+
+endmenu
drivers/trace/Makefile +17 -0
diff -urpN linux-2.5.37/drivers/trace/Makefile linux-2.5.37-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 +2398 -0

2,398 lines not on this page · raw message

drivers/trace/tracer.h +233 -0

233 lines not on this page · raw message

#1 lore raw

Hi!

drivers/trace/tracer.c line 69

Quoted 4 lines
drivers/trace/tracer.c +4 -0
+/*  Driver */
+static int		sMajorNumber;		/* Major number of the tracer */
+static int		sOpenCount;		/* Number of times device is open */
+/*  Locking */

Why *s*OpenCount? Some creeping infection by hungarian notation?

Pavel

Signature · 2 lines
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.
#2 lore raw
Quoted 9 lines · Pavel Machek

Hi!

drivers/trace/tracer.c line 69

Quoted 4 lines
drivers/trace/tracer.c +4 -0
+/*  Driver */
+static int		sMajorNumber;		/* Major number of the tracer */
+static int		sOpenCount;		/* Number of times device is open */
+/*  Locking */

Why *s*OpenCount? Some creeping infection by hungarian notation?

int YesItLooksAsThoughSomeOfThisHasCreptIntoTheKernelAsWell = TRUE;

Methinks it started in a BusLogic driver and wasn't stamped out before it spread and infected everything else!

Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips). The US military has given us many words, FUBAR, SNAFU, now ENRON. Yes, top management were graduates of West Point and Annapolis.

#3 lore raw
In reply to Pavel Machek
Quoted 8 lines · Pavel Machek

Hi!

drivers/trace/tracer.c line 69

Quoted 4 lines
drivers/trace/tracer.c +4 -0
+/*  Driver */
+static int           sMajorNumber;           /* Major number of the tracer */
+static int           sOpenCount;             /* Number of times device is open */
+/*  Locking */

Why *s*OpenCount? Some creeping infection by hungarian notation?

"static" as opposed 'l' for "local" elsewhere in the code, but you're looking at code that is going to change to fit the usual kernel coding style. So all those S's and L's will go away ;)

Karim

===================================================
Karim Yaghmour
[email protected]
Embedded and Real-Time Linux Expert
===================================================