aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-23 09:48:10 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-23 09:48:10 -0700
commitdea09c6c2089743ef55fb921792b61d14e65ade4 (patch)
tree06effb7fe67724c6bf428d5609d9d23ecb95f841
parent5b8c8b93b6b95318982ef23f67be7da390c2e8b2 (diff)
downloadstable-queue-dea09c6c2089743ef55fb921792b61d14e65ade4.tar.gz
4.19-stable patches
added patches: tracing-remove-hist-trigger-synth_var_refs.patch tracing-use-var_refs-for-hist-trigger-reference-checking.patch
-rw-r--r--queue-4.19/series2
-rw-r--r--queue-4.19/tracing-remove-hist-trigger-synth_var_refs.patch73
-rw-r--r--queue-4.19/tracing-use-var_refs-for-hist-trigger-reference-checking.patch119
3 files changed, 194 insertions, 0 deletions
diff --git a/queue-4.19/series b/queue-4.19/series
index 21ade3143d..c8a0a68923 100644
--- a/queue-4.19/series
+++ b/queue-4.19/series
@@ -33,3 +33,5 @@ speakup-avoid-crash-on-very-long-word.patch
fs-sysfs-fix-reference-leak-in-sysfs_break_active_protection.patch
nouveau-fix-instmem-race-condition-around-ptr-stores.patch
nilfs2-fix-oob-in-nilfs_set_de_type.patch
+tracing-remove-hist-trigger-synth_var_refs.patch
+tracing-use-var_refs-for-hist-trigger-reference-checking.patch
diff --git a/queue-4.19/tracing-remove-hist-trigger-synth_var_refs.patch b/queue-4.19/tracing-remove-hist-trigger-synth_var_refs.patch
new file mode 100644
index 0000000000..73b17229f6
--- /dev/null
+++ b/queue-4.19/tracing-remove-hist-trigger-synth_var_refs.patch
@@ -0,0 +1,73 @@
+From 912201345f7c39e6b0ac283207be2b6641fa47b9 Mon Sep 17 00:00:00 2001
+From: Tom Zanussi <tom.zanussi@linux.intel.com>
+Date: Tue, 18 Dec 2018 14:33:25 -0600
+Subject: tracing: Remove hist trigger synth_var_refs
+
+From: Tom Zanussi <tom.zanussi@linux.intel.com>
+
+commit 912201345f7c39e6b0ac283207be2b6641fa47b9 upstream.
+
+All var_refs are now handled uniformly and there's no reason to treat
+the synth_refs in a special way now, so remove them and associated
+functions.
+
+Link: http://lkml.kernel.org/r/b4d3470526b8f0426dcec125399dad9ad9b8589d.1545161087.git.tom.zanussi@linux.intel.com
+
+Acked-by: Namhyung Kim <namhyung@kernel.org>
+Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
+Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: George Guo <guodongtai@kylinos.cn>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/trace/trace_events_hist.c | 18 ------------------
+ 1 file changed, 18 deletions(-)
+
+--- a/kernel/trace/trace_events_hist.c
++++ b/kernel/trace/trace_events_hist.c
+@@ -280,8 +280,6 @@ struct hist_trigger_data {
+ struct action_data *actions[HIST_ACTIONS_MAX];
+ unsigned int n_actions;
+
+- struct hist_field *synth_var_refs[SYNTH_FIELDS_MAX];
+- unsigned int n_synth_var_refs;
+ struct field_var *field_vars[SYNTH_FIELDS_MAX];
+ unsigned int n_field_vars;
+ unsigned int n_field_var_str;
+@@ -3708,20 +3706,6 @@ static void save_field_var(struct hist_t
+ }
+
+
+-static void destroy_synth_var_refs(struct hist_trigger_data *hist_data)
+-{
+- unsigned int i;
+-
+- for (i = 0; i < hist_data->n_synth_var_refs; i++)
+- destroy_hist_field(hist_data->synth_var_refs[i], 0);
+-}
+-
+-static void save_synth_var_ref(struct hist_trigger_data *hist_data,
+- struct hist_field *var_ref)
+-{
+- hist_data->synth_var_refs[hist_data->n_synth_var_refs++] = var_ref;
+-}
+-
+ static int check_synth_field(struct synth_event *event,
+ struct hist_field *hist_field,
+ unsigned int field_pos)
+@@ -3884,7 +3868,6 @@ static int onmatch_create(struct hist_tr
+ goto err;
+ }
+
+- save_synth_var_ref(hist_data, var_ref);
+ field_pos++;
+ kfree(p);
+ continue;
+@@ -4631,7 +4614,6 @@ static void destroy_hist_data(struct his
+ destroy_actions(hist_data);
+ destroy_field_vars(hist_data);
+ destroy_field_var_hists(hist_data);
+- destroy_synth_var_refs(hist_data);
+
+ kfree(hist_data);
+ }
diff --git a/queue-4.19/tracing-use-var_refs-for-hist-trigger-reference-checking.patch b/queue-4.19/tracing-use-var_refs-for-hist-trigger-reference-checking.patch
new file mode 100644
index 0000000000..84ccb4ee60
--- /dev/null
+++ b/queue-4.19/tracing-use-var_refs-for-hist-trigger-reference-checking.patch
@@ -0,0 +1,119 @@
+From e4f6d245031e04bdd12db390298acec0474a1a46 Mon Sep 17 00:00:00 2001
+From: Tom Zanussi <tzanussi@gmail.com>
+Date: Wed, 19 Dec 2018 13:09:16 -0600
+Subject: tracing: Use var_refs[] for hist trigger reference checking
+
+From: Tom Zanussi <tzanussi@gmail.com>
+
+commit e4f6d245031e04bdd12db390298acec0474a1a46 upstream.
+
+Since all the variable reference hist_fields are collected into
+hist_data->var_refs[] array, there's no need to go through all the
+fields looking for them, or in separate arrays like synth_var_refs[],
+which will be going away soon anyway.
+
+This also allows us to get rid of some unnecessary code and functions
+currently used for the same purpose.
+
+Link: http://lkml.kernel.org/r/1545246556.4239.7.camel@gmail.com
+
+Acked-by: Namhyung Kim <namhyung@kernel.org>
+Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
+Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: George Guo <guodongtai@kylinos.cn>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/trace/trace_events_hist.c | 68 ++++++---------------------------------
+ 1 file changed, 11 insertions(+), 57 deletions(-)
+
+--- a/kernel/trace/trace_events_hist.c
++++ b/kernel/trace/trace_events_hist.c
+@@ -1289,49 +1289,13 @@ check_field_for_var_ref(struct hist_fiel
+ struct hist_trigger_data *var_data,
+ unsigned int var_idx)
+ {
+- struct hist_field *found = NULL;
++ WARN_ON(!(hist_field && hist_field->flags & HIST_FIELD_FL_VAR_REF));
+
+- if (hist_field && hist_field->flags & HIST_FIELD_FL_VAR_REF) {
+- if (hist_field->var.idx == var_idx &&
+- hist_field->var.hist_data == var_data) {
+- found = hist_field;
+- }
+- }
+-
+- return found;
+-}
+-
+-static struct hist_field *
+-check_field_for_var_refs(struct hist_trigger_data *hist_data,
+- struct hist_field *hist_field,
+- struct hist_trigger_data *var_data,
+- unsigned int var_idx,
+- unsigned int level)
+-{
+- struct hist_field *found = NULL;
+- unsigned int i;
++ if (hist_field && hist_field->var.idx == var_idx &&
++ hist_field->var.hist_data == var_data)
++ return hist_field;
+
+- if (level > 3)
+- return found;
+-
+- if (!hist_field)
+- return found;
+-
+- found = check_field_for_var_ref(hist_field, var_data, var_idx);
+- if (found)
+- return found;
+-
+- for (i = 0; i < HIST_FIELD_OPERANDS_MAX; i++) {
+- struct hist_field *operand;
+-
+- operand = hist_field->operands[i];
+- found = check_field_for_var_refs(hist_data, operand, var_data,
+- var_idx, level + 1);
+- if (found)
+- return found;
+- }
+-
+- return found;
++ return NULL;
+ }
+
+ /**
+@@ -1350,26 +1314,16 @@ static struct hist_field *find_var_ref(s
+ struct hist_trigger_data *var_data,
+ unsigned int var_idx)
+ {
+- struct hist_field *hist_field, *found = NULL;
++ struct hist_field *hist_field;
+ unsigned int i;
+
+- for_each_hist_field(i, hist_data) {
+- hist_field = hist_data->fields[i];
+- found = check_field_for_var_refs(hist_data, hist_field,
+- var_data, var_idx, 0);
+- if (found)
+- return found;
+- }
+-
+- for (i = 0; i < hist_data->n_synth_var_refs; i++) {
+- hist_field = hist_data->synth_var_refs[i];
+- found = check_field_for_var_refs(hist_data, hist_field,
+- var_data, var_idx, 0);
+- if (found)
+- return found;
++ for (i = 0; i < hist_data->n_var_refs; i++) {
++ hist_field = hist_data->var_refs[i];
++ if (check_field_for_var_ref(hist_field, var_data, var_idx))
++ return hist_field;
+ }
+
+- return found;
++ return NULL;
+ }
+
+ /**