Skip to contentSkip to conversation

TRACE_EVENT: mapping "=" and memcpy to macros

RFC Mathieu Desnoyers 1 participant 1 message Oct 25, 2010 7 messages not in the archive

lore
Share & tools
lore
#7 lore raw
In reply to a message not in the archive

LTTng needs to override the assignment primitives to deal with cross-page writes. A first step needed to move LTTng to TRACE_EVENT is to introduce the following macros:

for ftrace and perf:

#define __assign(dest, src) (dest) = (src)
#define __assign_memcpy(dest, src, len) memcpy(dest, src, len)

which would turn (e.g.)

        TP_fast_assign(
                memcpy(__entry->comm, t->comm, TASK_COMM_LEN);
                __entry->pid    = t->pid;
        ),

into

        TP_fast_assign(
                __assign_memcpy(__entry->comm, t->comm, TASK_COMM_LEN);
                __assign(__entry->pid, t->pid);
        ),

So LTTng (and other tracers) can override these with their own primitives. This is a basic step required to bring the LTTng tree closer to mainline.

Thoughts ?

Mathieu

Signature · 4 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com