LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [GIT PULL] tracing: Small fixes to histogram code and header cleanup
@ 2019-05-25  3:11 Steven Rostedt
  2019-05-25 17:09 ` Linus Torvalds
  2019-05-25 17:15 ` pr-tracker-bot
  0 siblings, 2 replies; 5+ messages in thread
From: Steven Rostedt @ 2019-05-25  3:11 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: LKML, Ingo Molnar, Andrew Morton, Tom Zanussi, Jagadeesh Pagadala



Linus,

Tom Zanussi sent me some small fixes and cleanups to the histogram
code and I forgot to incorporate them.

I also added a small clean up patch that was sent to me a while ago
and I just noticed it.


Please pull the latest trace-v5.2-rc1 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v5.2-rc1

Tag SHA1: bceb0fd66744c3aa0cd8f3bba3e4b45ca38b3aaa
Head SHA1: 4eebe38a37f9397ffecd4bd3afbdf36838a97969


Jagadeesh Pagadala (1):
      kernel/trace/trace.h: Remove duplicate header of trace_seq.h

Tom Zanussi (3):
      tracing: Prevent hist_field_var_ref() from accessing NULL tracing_map_elts
      tracing: Check keys for variable references in expressions too
      tracing: Add a check_val() check before updating cond_snapshot() track_val

----
 kernel/trace/trace.h             |  1 -
 kernel/trace/trace_events_hist.c | 13 +++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
---------------------------
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 1974ce818ddb..82c70b63d375 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -15,7 +15,6 @@
 #include <linux/trace_seq.h>
 #include <linux/trace_events.h>
 #include <linux/compiler.h>
-#include <linux/trace_seq.h>
 #include <linux/glob.h>
 
 #ifdef CONFIG_FTRACE_SYSCALLS
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 7fca3457c705..ca6b0dff60c5 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -59,7 +59,7 @@
 	C(NO_CLOSING_PAREN,	"No closing paren found"),		\
 	C(SUBSYS_NOT_FOUND,	"Missing subsystem"),			\
 	C(INVALID_SUBSYS_EVENT,	"Invalid subsystem or event name"),	\
-	C(INVALID_REF_KEY,	"Using variable references as keys not supported"), \
+	C(INVALID_REF_KEY,	"Using variable references in keys not supported"), \
 	C(VAR_NOT_FOUND,	"Couldn't find variable"),		\
 	C(FIELD_NOT_FOUND,	"Couldn't find field"),
 
@@ -1854,6 +1854,9 @@ static u64 hist_field_var_ref(struct hist_field *hist_field,
 	struct hist_elt_data *elt_data;
 	u64 var_val = 0;
 
+	if (WARN_ON_ONCE(!elt))
+		return var_val;
+
 	elt_data = elt->private_data;
 	var_val = elt_data->var_ref_vals[hist_field->var_ref_idx];
 
@@ -3582,14 +3585,20 @@ static bool cond_snapshot_update(struct trace_array *tr, void *cond_data)
 	struct track_data *track_data = tr->cond_snapshot->cond_data;
 	struct hist_elt_data *elt_data, *track_elt_data;
 	struct snapshot_context *context = cond_data;
+	struct action_data *action;
 	u64 track_val;
 
 	if (!track_data)
 		return false;
 
+	action = track_data->action_data;
+
 	track_val = get_track_val(track_data->hist_data, context->elt,
 				  track_data->action_data);
 
+	if (!action->track_data.check_val(track_data->track_val, track_val))
+		return false;
+
 	track_data->track_val = track_val;
 	memcpy(track_data->key, context->key, track_data->key_len);
 
@@ -4503,7 +4512,7 @@ static int create_key_field(struct hist_trigger_data *hist_data,
 			goto out;
 		}
 
-		if (hist_field->flags & HIST_FIELD_FL_VAR_REF) {
+		if (field_has_hist_vars(hist_field, 0))	{
 			hist_err(tr, HIST_ERR_INVALID_REF_KEY, errpos(field_str));
 			destroy_hist_field(hist_field, 0);
 			ret = -EINVAL;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [GIT PULL] tracing: Small fixes to histogram code and header cleanup
  2019-05-25  3:11 [GIT PULL] tracing: Small fixes to histogram code and header cleanup Steven Rostedt
@ 2019-05-25 17:09 ` Linus Torvalds
  2019-05-25 22:39   ` Steven Rostedt
  2019-05-25 17:15 ` pr-tracker-bot
  1 sibling, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2019-05-25 17:09 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Andrew Morton, Tom Zanussi, Jagadeesh Pagadala

On Fri, May 24, 2019 at 8:11 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> Tom Zanussi sent me some small fixes and cleanups to the histogram
> code and I forgot to incorporate them.
>
> I also added a small clean up patch that was sent to me a while ago
> and I just noticed it.

Why not the warning avoidance patch? It changes no actual code, and
avoids two 20-line build warnings for me that are very annoying..

               Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [GIT PULL] tracing: Small fixes to histogram code and header cleanup
  2019-05-25  3:11 [GIT PULL] tracing: Small fixes to histogram code and header cleanup Steven Rostedt
  2019-05-25 17:09 ` Linus Torvalds
@ 2019-05-25 17:15 ` pr-tracker-bot
  1 sibling, 0 replies; 5+ messages in thread
From: pr-tracker-bot @ 2019-05-25 17:15 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Linus Torvalds, LKML, Ingo Molnar, Andrew Morton, Tom Zanussi,
	Jagadeesh Pagadala

The pull request you sent on Fri, 24 May 2019 23:11:06 -0400:

> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git trace-v5.2-rc1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/a2c48d98fc0770f7993cf61c71659a99e1d2857e

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [GIT PULL] tracing: Small fixes to histogram code and header cleanup
  2019-05-25 17:09 ` Linus Torvalds
@ 2019-05-25 22:39   ` Steven Rostedt
  2019-05-25 22:47     ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2019-05-25 22:39 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: LKML, Ingo Molnar, Andrew Morton, Tom Zanussi, Jagadeesh Pagadala

On Sat, 25 May 2019 10:09:19 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Fri, May 24, 2019 at 8:11 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > Tom Zanussi sent me some small fixes and cleanups to the histogram
> > code and I forgot to incorporate them.
> >
> > I also added a small clean up patch that was sent to me a while ago
> > and I just noticed it.  
> 
> Why not the warning avoidance patch? It changes no actual code, and
> avoids two 20-line build warnings for me that are very annoying..
> 

You mean this one:

 http://lkml.kernel.org/r/20190523124535.GA12931@gmail.com

?

I have it in my queue for the next merge window, but I can cherry pick
it and send it to you directly now. It's already been through my test
suite.

-- Steve

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [GIT PULL] tracing: Small fixes to histogram code and header cleanup
  2019-05-25 22:39   ` Steven Rostedt
@ 2019-05-25 22:47     ` Linus Torvalds
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2019-05-25 22:47 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Andrew Morton, Tom Zanussi, Jagadeesh Pagadala

On Sat, May 25, 2019 at 3:39 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> You mean this one:

Yes.

> I have it in my queue for the next merge window, but I can cherry pick
> it and send it to you directly now.

Oh, "next merge window" is *way* too late.

This is a serious problem that causes tens of lines of warnings, and
may be hiding other warnings as a result simply because developers
stop looking at them.

Warnings are bad.

            Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-25 22:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-25  3:11 [GIT PULL] tracing: Small fixes to histogram code and header cleanup Steven Rostedt
2019-05-25 17:09 ` Linus Torvalds
2019-05-25 22:39   ` Steven Rostedt
2019-05-25 22:47     ` Linus Torvalds
2019-05-25 17:15 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).