lkml.org 
[lkml]   [2008]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch for 2.6.26 0/7] Architecture Independent Markers
Date
On Thursday 27 March 2008 14:20, Mathieu Desnoyers wrote:
> Hi Andrew,
>
> After a few RFC rounds, I propose these markers for 2.6.26. They include
> work done after comments from the memory management community. Most of them have
> been used by the LTTng project for about 2 years.

Not in this patch, but I noticed:

#define __trace_mark(name, call_private, format, args...) \
do { \
static const char __mstrtab_##name[] \
__attribute__((section("__markers_strings"))) \
= #name "\0" format; \
static struct marker __mark_##name \
__attribute__((section("__markers"), aligned(8))) = \
{ __mstrtab_##name, &__mstrtab_##name[sizeof(#name)], \
0, 0, marker_probe_cb, \
{ __mark_empty_function, NULL}, NULL }; \
__mark_check_format(format, ## args); \
if (unlikely(__mark_##name.state)) { \
(*__mark_##name.call) \
(&__mark_##name, call_private, \
format, ## args); \
} \
} while (0)

In this call:

(*__mark_##name.call) \
(&__mark_##name, call_private, \
format, ## args); \

you make gcc allocate duplicate format string. You can use
&__mstrtab_##name[sizeof(#name)] instead since it holds the same string,
or drop ", format," above and "const char *fmt" from here:

void (*call)(const struct marker *mdata, /* Probe wrapper */
void *call_private, const char *fmt, ...);

since mdata->format is the same and all callees which need it can take it there.
--
vda


\
 
 \ /
  Last update: 2008-03-28 01:05    [W:0.148 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site