From: Tom Zanussi <tom.zanussi@linux.intel.com>
To: rostedt@goodmis.org
Cc: tglx@linutronix.de, mhiramat@kernel.org, namhyung@kernel.org,
vedang.patel@intel.com, bigeasy@linutronix.de,
joel.opensrc@gmail.com, joelaf@google.com,
mathieu.desnoyers@efficios.com, baohong.liu@intel.com,
rajvi.jingar@intel.com, julia@ni.com, fengguang.wu@intel.com,
linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
Tom Zanussi <tom.zanussi@linux.intel.com>
Subject: [PATCH 3/6] tracing: Save the last hist command's associated event name
Date: Thu, 12 Apr 2018 10:13:18 -0500 [thread overview]
Message-ID: <1b0ae2e2fb4275fa2ea47df816888c573a87526c.1523545519.git.tom.zanussi@linux.intel.com> (raw)
In-Reply-To: <cover.1523545519.git.tom.zanussi@linux.intel.com>
In-Reply-To: <cover.1523545519.git.tom.zanussi@linux.intel.com>
In preparation for making use of the new trace event error log, save
the subsystem and event name associated with the last hist command -
it will be passed as the location param in the event_log_err() calls.
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
kernel/trace/trace_events_hist.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 66c87be..4a42df4 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -354,14 +354,32 @@ struct action_data {
static char last_hist_cmd[MAX_FILTER_STR_VAL];
+static char last_hist_cmd_event[MAX_FILTER_STR_VAL];
static char hist_err_str[MAX_FILTER_STR_VAL];
-static void last_cmd_set(char *str)
+static void last_cmd_set(struct trace_event_file *file, char *str)
{
+ const char *system = NULL, *name = NULL;
+ struct trace_event_call *call;
+
if (!str)
return;
strncpy(last_hist_cmd, str, MAX_FILTER_STR_VAL - 1);
+
+ if (file) {
+ call = file->event_call;
+
+ system = call->class->system;
+ if (system) {
+ name = trace_event_name(call);
+ if (!name)
+ system = NULL;
+ }
+ }
+
+ if (system)
+ snprintf(last_hist_cmd_event, MAX_FILTER_STR_VAL, "%s:%s", system, name);
}
static void hist_err(char *str, char *var)
@@ -401,6 +419,8 @@ static void hist_err_event(char *str, char *system, char *event, char *var)
static void hist_err_clear(void)
{
hist_err_str[0] = '\0';
+ last_hist_cmd[0] = '\0';
+ last_hist_cmd_event[0] = '\0';
}
static bool have_hist_err(void)
@@ -5478,8 +5498,8 @@ static int event_hist_trigger_func(struct event_command *cmd_ops,
int ret = 0;
if (glob && strlen(glob)) {
- last_cmd_set(param);
hist_err_clear();
+ last_cmd_set(file, param);
}
if (!param)
--
1.9.3
next prev parent reply other threads:[~2018-04-12 15:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-12 15:13 [PATCH 0/6] tracing: trace event error_log and inter-event bugfixes Tom Zanussi
2018-04-12 15:13 ` [PATCH 1/6] tracing: Restore proper field flag printing when displaying triggers Tom Zanussi
2018-04-12 15:13 ` [PATCH 2/6] tracing: Add trace event error log Tom Zanussi
2018-04-12 22:20 ` Steven Rostedt
2018-04-12 23:52 ` Tom Zanussi
2018-04-13 13:45 ` Steven Rostedt
2018-04-13 14:24 ` Tom Zanussi
2018-04-13 14:44 ` Steven Rostedt
2018-04-18 9:34 ` Masami Hiramatsu
2018-04-18 13:49 ` Steven Rostedt
2018-04-19 0:40 ` Namhyung Kim
2018-04-19 14:36 ` Steven Rostedt
2018-04-14 6:31 ` Masami Hiramatsu
2018-04-12 15:13 ` Tom Zanussi [this message]
2018-04-12 15:13 ` [PATCH 4/6] tracing: Use trace event error_log with hist triggers Tom Zanussi
2018-04-12 15:13 ` [PATCH 5/6] tracing: Add field parsing trace event errors for " Tom Zanussi
2018-04-12 15:13 ` [PATCH 6/6] selftests: ftrace: Fix extended error support testcase Tom Zanussi
2019-01-16 3:31 ` [PATCH 0/6] tracing: trace event error_log and inter-event bugfixes Steven Rostedt
2019-01-16 15:42 ` Tom Zanussi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1b0ae2e2fb4275fa2ea47df816888c573a87526c.1523545519.git.tom.zanussi@linux.intel.com \
--to=tom.zanussi@linux.intel.com \
--cc=baohong.liu@intel.com \
--cc=bigeasy@linutronix.de \
--cc=fengguang.wu@intel.com \
--cc=joel.opensrc@gmail.com \
--cc=joelaf@google.com \
--cc=julia@ni.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=namhyung@kernel.org \
--cc=rajvi.jingar@intel.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=vedang.patel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®