Adds flavor field to __mark_marker
PATCH 1/1 Adds flavor field to __mark_marker
This patch demonstrates an extension field to the low-level marker functionality, and updates macros to accept this additional data.
include/linux/marker.h +10 -3
@@ -31,10 +31,14 @@const char *args;/* List of arguments litteraly transformed * into a string: "arg1, arg2, arg3". */ +const int flavor;/* site-defined marker flavor */ immediate_char_t state;/* Immediate value state. */ marker_probe_func *call;/* Probe handler function pointer */ void *pdata;/* Private probe data */ -} __attribute__((aligned(8))); +} __attribute__((aligned(32))); + +/* Default marker flavor */ +#define MARKER_DEFAULT 0#ifdef CONFIG_MARKERS
@@ -46,7 +50,7 @@* not add unwanted padding between the beginning of the section and the * structure. Force alignment to the same alignment as the section start. */ -#define __trace_mark(generic, name, format, args...) \ +#define ___trace_mark(generic, flavor, name, format, args...) \ do { \ static const char __mstrtab_name_##name[] \ __attribute__((section("__markers_strings"))) \
@@ -60,7 +64,7 @@ static struct __mark_marker __mark_##name \ __attribute__((section("__markers"))) = \ { __mstrtab_name_##name, __mstrtab_format_##name, \ - __mstrtab_args_##name, { 0 }, \ + __mstrtab_args_##name, flavor, { 0 }, \ __mark_empty_function, NULL }; \ asm volatile ( "" : : "i" (&__mark_##name)); \ __mark_check_format(format, ## args); \
@@ -81,6 +85,9 @@ } \ } while (0) +#define __trace_mark(generic, name, format, args...) \ + ___trace_mark(generic, MARKER_DEFAULT, name, format, ## args) +extern void module_marker_update (struct module *mod);#else /* !CONFIG_MARKERS */ #define __trace_mark(generic, name, format, args...) \
include/asm-generic/vmlinux.lds.h +1 -1
@@ -13,7 +13,7 @@#define DATA_DATA \ *(.data) \ *(.data.init.refok) \ - . = ALIGN(8); \ + . = ALIGN(32); \ VMLINUX_SYMBOL(__start___markers) = .; \ *(__markers) \ VMLINUX_SYMBOL(__stop___markers) = .;