Skip to content

Commit

Permalink
tracing: Change STR_VAR_MAX_LEN
Browse files Browse the repository at this point in the history
32 is too small for this value, and anyway it makes more sense to use
MAX_FILTER_STR_VAL, as this is also the value used for variable-length
__strings.

Link: https://lkml.kernel.org/r/6adfd1668ac1fd8670bd58206944a762061a5559.1601848695.git.zanussi@kernel.org

Tested-by: Axel Rasmussen <axelrasmussen@google.com>
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Tom Zanussi authored and rostedt committed Oct 5, 2020
1 parent fdda88d commit 4a4a56b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions kernel/trace/trace_events_hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,8 @@ static int hist_trigger_elt_data_alloc(struct tracing_map_elt *elt)

n_str = hist_data->n_field_var_str + hist_data->n_save_var_str;

BUILD_BUG_ON(STR_VAR_LEN_MAX & (sizeof(u64) - 1));

size = STR_VAR_LEN_MAX;

for (i = 0; i < n_str; i++) {
Expand Down
2 changes: 1 addition & 1 deletion kernel/trace/trace_synth.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define SYNTH_SYSTEM "synthetic"
#define SYNTH_FIELDS_MAX 32

#define STR_VAR_LEN_MAX 32 /* must be multiple of sizeof(u64) */
#define STR_VAR_LEN_MAX MAX_FILTER_STR_VAL /* must be multiple of sizeof(u64) */

struct synth_field {
char *type;
Expand Down

0 comments on commit 4a4a56b

Please sign in to comment.