History

ftrace: don't convert function's local variable name in macro

"call" is an argument of macro, but it is also used as a local variable name of function in macro. We should keep this local variable name distinct from any CPP macro parameter name if both are in the same macro scope, although it hasn't caused any problem yet. [ Impact: robustify macro ]

Zhaolei committed 17 years ago

Commit f2aebae1 parent 5b6045a1 file · +10 −10Browse files

Showing the changes to include (1 of 1 file). Show all

Unified · Split

include/trace/ftrace.h+10−10
@@ -397,19 +397,19 @@ static void ftrace_profile_##call(proto) \ · 396 unmodified lines
397397 perf_tpcounter_event(event_##call.id); \
398398 } \
399399 \
400−static int ftrace_profile_enable_##call(struct ftrace_event_call *call) \
400+static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \
401401 { \
402402 int ret = 0; \
403403 \
404− if (!atomic_inc_return(&call->profile_count)) \
404+ if (!atomic_inc_return(&event_call->profile_count)) \
405405 ret = register_trace_##call(ftrace_profile_##call); \
406406 \
407407 return ret; \
408408 } \
409409 \
410−static void ftrace_profile_disable_##call(struct ftrace_event_call *call) \
410+static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
411411 { \
412− if (atomic_add_negative(-1, &call->profile_count)) \
412+ if (atomic_add_negative(-1, &event_call->profile_count)) \
413413 unregister_trace_##call(ftrace_profile_##call); \
414414 }
415415
@@ -433,9 +433,9 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *call) \ · 17 unmodified lines
433433 #define __array(type, item, len)
434434
435435 #undef __string
436−#define __string(item, src) \
437− __str_offsets.item = __str_size + \
438− offsetof(typeof(*entry), __str_data); \
436+#define __string(item, src) \
437+ __str_offsets.item = __str_size + \
438+ offsetof(typeof(*entry), __str_data); \
439439 __str_size += strlen(src) + 1;
440440
441441 #undef __assign_str
@@ -451,8 +451,8 @@ static struct ftrace_event_call event_##call; \ · 9 unmodified lines
451451 \
452452 static void ftrace_raw_event_##call(proto) \
453453 { \
454− struct ftrace_str_offsets_##call __maybe_unused __str_offsets; \
455− struct ftrace_event_call *call = &event_##call; \
454+ struct ftrace_str_offsets_##call __maybe_unused __str_offsets; \
455+ struct ftrace_event_call *event_call = &event_##call; \
456456 struct ring_buffer_event *event; \
457457 struct ftrace_raw_##call *entry; \
458458 unsigned long irq_flags; \
@@ -473,7 +473,7 @@ static void ftrace_raw_event_##call(proto) \ · 14 unmodified lines
473473 \
474474 assign; \
475475 \
476− if (!filter_current_check_discard(call, entry, event)) \
476+ if (!filter_current_check_discard(event_call, entry, event)) \
477477 trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \
478478 } \
479479 \