LTTng 0.6.36 for 2.6.18 : Linux Kernel Markers
Subsystems (2)
PATCH 3/16 LTTng 0.6.36 for 2.6.18 : Linux Kernel Markers
This patch adds the Linux Kernel Markers, except the build system modification (/Makefile), which is in patch16-2.6.18-lttng-core-0.6.36-build.diff.
patch03-2.6.18-lttng-core-0.6.36-markers.diff
--BEGIN--
include/asm-generic/vmlinux.lds.h +6 -0
@@ -118,6 +118,12 @@ #define RODATA \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ *(__ksymtab_strings) \ } \ +/* Kernel markers : pointers */ \ + .markers : AT(ADDR(.markers) - LOAD_OFFSET) { \ + VMLINUX_SYMBOL(__start___markers) = .; \ + *(.markers) \ + VMLINUX_SYMBOL(__stop___markers) = .; \ + } \ __end_rodata = .; \ . = ALIGN(4096); \ \
kernel/Kconfig.marker new file +17 -0
@@ -0,0 +1,17 @@ +# Code markers configuration + +config MARKERS + bool "Activate markers" + select MODULES + default n + help + Place an empty function call at each marker site. Can be + dynamically changed for a probe function. + +config MARKERS_DISABLE_OPTIMIZATION + bool "Disable architecture specific marker optimization" + depends EMBEDDED + default n + help + Disable code replacement jump optimisations. Especially useful if your + code is in a read-only rom/flash.
include/linux/module.h +4 -0
@@ -345,6 +345,9 @@ #endif/* The command line arguments (may be mangled). People like keeping pointers to this stuff */ char *args; + +const struct __mark_marker *markers; +unsigned int num_markers; };/* FIXME: It'd be nice to isolate modules during init, too, so they
@@ -468,6 +471,7 @@ extern void print_modules(void);struct device_driver ;void module_add_driver (struct module *,struct device_driver *);void module_remove_driver (struct device_driver *); +extern void list_modules (void );#else /* !CONFIG_MODULES... */ #define EXPORT_SYMBOL (sym)
include/linux/marker.h new file +65 -0
65 lines not on this page · raw message
include/asm-arm/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-cris/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-frv/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-generic/marker.h new file +49 -0
49 lines not on this page · raw message
include/asm-h8300/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-i386/marker.h new file +53 -0
53 lines not on this page · raw message
include/asm-ia64/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-m32r/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-m68k/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-m68knommu/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-mips/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-parisc/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-powerpc/marker.h new file +57 -0
57 lines not on this page · raw message
include/asm-ppc64/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-ppc/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-s390/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-sh64/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-sh/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-sparc64/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-sparc/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-um/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-v850/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-x86_64/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
include/asm-xtensa/marker.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* marker.h +* +* Code markup for dynamic and static tracing. Architecture specific +* optimisations. +* +* No optimisation implemented. +* +* This file is released under the GPLv2. +* See the file COPYING for more details. +*/ + +#include <asm-generic/marker.h>
kernel/module.c +204 -0
246 lines not on this page · raw message
--END--
OpenPGP public key: http://krystal.dyndns.org:8080/key/compudj.gpg Key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
Quoted 2 lines · Mathieu Desnoyers
This patch adds the Linux Kernel Markers [...]
Signed-off-by Mathieu Desnoyers <[email protected]>
If it helps,
One question:
kernel/module.c static struct module *find_module(const · line 416
Quoted 9 lines
[...]
kernel/module.c +7
-0+/* Markers in modules. */ +list_for_each_entry (mod, &modules, list) { +if (mod->license_gplok) + found +=marker_set_probe_range (name, format, probe, + mod->markers, mod->markers+mod->num_markers); + } +EXPORT_SYMBOL (marker_set_probe);
Are you sure the license_gplok check is necessary here? We should consider encouraging non-gpl module writers to instrument their code, to give users a slightly better chance of debugging problems.
- FChE
Quoted 16 lines · * Frank Ch. Eigler ([email protected]) wrote:
One question:
kernel/module.c static struct module *find_module(const · line 416
Quoted 9 lines
[...]
kernel/module.c +7
-0+/* Markers in modules. */ +list_for_each_entry (mod, &modules, list) { +if (mod->license_gplok) + found +=marker_set_probe_range (name, format, probe, + mod->markers, mod->markers+mod->num_markers); + } +EXPORT_SYMBOL (marker_set_probe);Are you sure the
license_gplokcheck is necessary here? We should consider encouraging non-gpl module writers to instrument their code, to give users a slightly better chance of debugging problems.
Hi Frank,
I was kind of expecting this question. Well, it turns out that my markers module modifies the struct module in module.h to add a few fields. Some drivers that I won't name (ok, ok I will : clearcase) have the funny habit of distributing their kernel modules as ".ko" files instead of sending a proper ".o" and later link it against a wrapper.
The result is, I must say, quite bad : when I want to add a probe, I iterate on each modules, verifying if there are any markers in the object. Things gets really messy when the structure is corrupted.
The simplest way to work around this non-GPL problem is to completely disable access to the marker infrastructure to non-GPL modules. I am not against instrumentation of binary-only modules, but I don't think it is kernel developer's job to support their broken binary blob distribution.
I thought that we might use the crc checksum as another criterion. As long as the machines do not crash when adding markers when such modules are loaded.
Regards,
Mathieu
OpenPGP public key: http://krystal.dyndns.org:8080/key/compudj.gpg Key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
Quoted 30 lines · Mathieu Desnoyers
Quoted 16 lines · * Frank Ch. Eigler ([email protected]) wrote:
One question:
kernel/module.c static struct module *find_module(const · line 416
Quoted 9 lines
[...]
kernel/module.c +7
-0+/* Markers in modules. */ +list_for_each_entry (mod, &modules, list) { +if (mod->license_gplok) + found +=marker_set_probe_range (name, format, probe, + mod->markers, mod->markers+mod->num_markers); + } +EXPORT_SYMBOL (marker_set_probe);Are you sure the
license_gplokcheck is necessary here? We should consider encouraging non-gpl module writers to instrument their code, to give users a slightly better chance of debugging problems.Hi Frank,
I was kind of expecting this question. Well, it turns out that my markers module modifies the struct module in
module.hto add a few fields. Some drivers that I won't name (ok, ok I will : clearcase) have the funny habit of distributing their kernel modules as ".ko" files instead of sending a proper ".o" and later link it against a wrapper.The result is, I must say, quite bad : when I want to add a probe, I iterate on each modules, verifying if there are any markers in the object. Things gets really messy when the structure is corrupted.
Quoted 7 lines
The simplest way to work around this non-GPL problem is to completely disable access to the marker infrastructure to non-GPL modules. I am not against instrumentation of binary-only modules, but I don't think it is kernel developer's job to support their broken binary blob distribution.
I thought that we might use the crc checksum as another criterion. As long as the machines do not crash when adding markers when such modules are loaded.
Please don't add hacks like that for non-GPL modules. But neither should we export any tracing functionality for them. They;re not the kind of people we want to help at all, and Frank just shows once again that he should rather stay away from kernel stuff and keep on writing C++.
Hi -
Quoted 5 lines · Christoph Hellwig
[...]
Quoted 3 lines
Quoted 3 lines
Are you sure the
license_gplokcheck is necessary here? We should consider encouraging non-gpl module writers to instrument their code, to give users a slightly better chance of debugging problems.
Quoted 7 lines
Quoted 5 lines
[... the authors of clearcase] have the funny habit of distributing their kernel modules as ".ko" files instead of sending a proper ".o" and later link it against a wrapper. The result is, I must say, quite bad [...] the structure is corrupted.
Please don't add hacks like that for non-GPL modules.
Indeed, offline Matheiu elaborated on his problem, and it turns out that good old modversions would have solved it.
Quoted 2 lines
But neither should we export any tracing functionality for them. They're not the kind of people we want to help at all,
Making that sort of political decision is beyond my pay grade. I merely suggested its consideration.
Quoted 2 lines
and Frank just shows once again that he should rather stay away from kernel stuff and keep on writing C++.
Now now, if you don't like my C++, wait till you see my Smalltalk-80. Or are you just jealous that my initials subsume yours?
- FChE (this space for rent)