From: Greg Kroah-Hartman Date: Tue, 23 Aug 2022 07:01:36 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v4.9.326~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c864d42f868de6019b5a327e8d0492489c9f208c;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: tracing-eprobes-fix-reading-of-string-fields.patch --- diff --git a/queue-5.15/series b/queue-5.15/series index 3440ca26e65..27e0cc49bb0 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -150,6 +150,7 @@ stmmac-intel-add-a-missing-clk_disable_unprepare-call-in-intel_eth_pci_remove.pa igb-add-lock-to-avoid-data-race.patch kbuild-fix-the-modules-order-between-drivers-and-libs.patch gcc-plugins-undefine-latent_entropy_plugin-when-plugin-disabled-for-a-file.patch +tracing-eprobes-fix-reading-of-string-fields.patch drm-imx-dcss-get-rid-of-hpd-warning-message.patch asoc-sof-intel-hda-define-rom_status_reg-in-sof_inte.patch asoc-sof-intel-hda-fix-potential-buffer-overflow-by-.patch diff --git a/queue-5.15/tracing-eprobes-fix-reading-of-string-fields.patch b/queue-5.15/tracing-eprobes-fix-reading-of-string-fields.patch new file mode 100644 index 00000000000..ca9ccfe26d3 --- /dev/null +++ b/queue-5.15/tracing-eprobes-fix-reading-of-string-fields.patch @@ -0,0 +1,61 @@ +From f04dec93466a0481763f3b56cdadf8076e28bfbf Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (Google)" +Date: Sat, 20 Aug 2022 09:43:19 -0400 +Subject: tracing/eprobes: Fix reading of string fields + +From: Steven Rostedt (Google) + +commit f04dec93466a0481763f3b56cdadf8076e28bfbf upstream. + +Currently when an event probe (eprobe) hooks to a string field, it does +not display it as a string, but instead as a number. This makes the field +rather useless. Handle the different kinds of strings, dynamic, static, +relational/dynamic etc. + +Now when a string field is used, the ":string" type can be used to display +it: + + echo "e:sw sched/sched_switch comm=$next_comm:string" > dynamic_events + +Link: https://lkml.kernel.org/r/20220820134400.959640191@goodmis.org + +Cc: stable@vger.kernel.org +Cc: Ingo Molnar +Cc: Andrew Morton +Cc: Tzvetomir Stoyanov +Cc: Tom Zanussi +Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events") +Acked-by: Masami Hiramatsu (Google) +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/trace_eprobe.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/kernel/trace/trace_eprobe.c ++++ b/kernel/trace/trace_eprobe.c +@@ -320,6 +320,24 @@ static unsigned long get_event_field(str + + addr = rec + field->offset; + ++ if (is_string_field(field)) { ++ switch (field->filter_type) { ++ case FILTER_DYN_STRING: ++ val = (unsigned long)(rec + (*(unsigned int *)addr & 0xffff)); ++ break; ++ case FILTER_STATIC_STRING: ++ val = (unsigned long)addr; ++ break; ++ case FILTER_PTR_STRING: ++ val = (unsigned long)(*(char *)addr); ++ break; ++ default: ++ WARN_ON_ONCE(1); ++ return 0; ++ } ++ return val; ++ } ++ + switch (field->size) { + case 1: + if (field->is_signed)