diff options
| -rw-r--r-- | include/trace/ftrace.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 52594b20179e..d17a35c6537e 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
| @@ -372,7 +372,8 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | |||
| 372 | __data_size += (len) * sizeof(type); | 372 | __data_size += (len) * sizeof(type); |
| 373 | 373 | ||
| 374 | #undef __string | 374 | #undef __string |
| 375 | #define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) | 375 | #define __string(item, src) __dynamic_array(char, item, \ |
| 376 | strlen((src) ? (const char *)(src) : "(null)") + 1) | ||
| 376 | 377 | ||
| 377 | #undef DECLARE_EVENT_CLASS | 378 | #undef DECLARE_EVENT_CLASS |
| 378 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 379 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| @@ -501,7 +502,7 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
| 501 | 502 | ||
| 502 | #undef __assign_str | 503 | #undef __assign_str |
| 503 | #define __assign_str(dst, src) \ | 504 | #define __assign_str(dst, src) \ |
| 504 | strcpy(__get_str(dst), src); | 505 | strcpy(__get_str(dst), (src) ? (const char *)(src) : "(null)"); |
| 505 | 506 | ||
| 506 | #undef TP_fast_assign | 507 | #undef TP_fast_assign |
| 507 | #define TP_fast_assign(args...) args | 508 | #define TP_fast_assign(args...) args |
