History

Merge tag 'trace-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pulltracing fixes from Steven Rostedt: - Limit mcount build time sorting to only those archs that we know it works for. - Fix memory leak in error path of histogram setup - Fix and clean up rel_loc array out of bounds issue - tools/rtla documentation fixes - Fix issues with histogram logic * tag 'trace-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Don't inc err_log entry count if entry allocation fails tracing: Propagate is_signed to expression tracing: Fix smatch warning for do while check in event_hist_trigger_parse() tracing: Fix smatch warning for null glob in event_hist_trigger_parse() tools/tracing: Update Makefile to build rtla rtla: Make doc build optional tracing/perf: Avoid -Warray-bounds warning for __rel_loc macro tracing: Avoid -Warray-bounds warning for __rel_loc macro tracing/histogram: Fix a potential memory leak for kstrdup() ftrace: Have architectures opt-in for mcount build time sorting

Linus Torvalds committed 4 years ago

Commit df000152 parents 76fcbc9 67ab5eb10 files · +43 −16Browse files

Showing the changes to include/trace (2 of 10 files). Show all

Unified · Split

2 files
  1. include/trace/perf.h +3 −2
  2. include/trace/trace_events.h +5 −4
include/trace/perf.h+3−2
@@ -23,8 +23,9 @@ · 22 unmodified lines
2323
2424 #undef __get_rel_dynamic_array
2525 #define __get_rel_dynamic_array(field) \
26− ((void *)(&__entry->__rel_loc_##field) + \
27− sizeof(__entry->__rel_loc_##field) + \
26+ ((void *)__entry + \
27+ offsetof(typeof(*__entry), __rel_loc_##field) + \
28+ sizeof(__entry->__rel_loc_##field) + \
2829 (__entry->__rel_loc_##field & 0xffff))
2930
3031 #undef __get_rel_dynamic_array_len
include/trace/trace_events.h+5−4
@@ -128,7 +128,7 @@ TRACE_MAKE_SYSTEM_STR(); · 127 unmodified lines
128128 struct trace_event_raw_##name { \
129129 struct trace_entry ent; \
130130 tstruct \
131− char __data[0]; \
131+ char __data[]; \
132132 }; \
133133 \
134134 static struct trace_event_class event_class_##name;
@@ -318,9 +318,10 @@ TRACE_MAKE_SYSTEM_STR(); · 183 unmodified lines
318318 #define __get_str(field) ((char *)__get_dynamic_array(field))
319319
320320 #undef __get_rel_dynamic_array
321−#define __get_rel_dynamic_array(field) \
322− ((void *)(&__entry->__rel_loc_##field) + \
323− sizeof(__entry->__rel_loc_##field) + \
321+#define __get_rel_dynamic_array(field) \
322+ ((void *)__entry + \
323+ offsetof(typeof(*__entry), __rel_loc_##field) + \
324+ sizeof(__entry->__rel_loc_##field) + \
324325 (__entry->__rel_loc_##field & 0xffff))
325326
326327 #undef __get_rel_dynamic_array_len