mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: rostedt@goodmis.org
Cc: linux-kernel@vger.kernel.org, oleg@redhat.com,
	Jiri Olsa <jolsa@redhat.com>
Subject: [PATCH] tracing - add indexes to the array values definitions
Date: Thu, 11 Nov 2010 10:49:25 +0100	[thread overview]
Message-ID: <1289468965-8166-1-git-send-email-jolsa@redhat.com> (raw)

Adding indexes to trace_options and err_text arrays definitions.
It helps the code readability.

wbr,
jirka


Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
 kernel/trace/trace.c               |   42 ++++++++++++++++++------------------
 kernel/trace/trace_events_filter.c |   25 +++++++++++----------
 2 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 82d9b81..cf2b0e5 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -405,27 +405,27 @@ unsigned long nsecs_to_usecs(unsigned long nsecs)
 
 /* These must match the bit postions in trace_iterator_flags */
 static const char *trace_options[] = {
-	"print-parent",
-	"sym-offset",
-	"sym-addr",
-	"verbose",
-	"raw",
-	"hex",
-	"bin",
-	"block",
-	"stacktrace",
-	"trace_printk",
-	"ftrace_preempt",
-	"branch",
-	"annotate",
-	"userstacktrace",
-	"sym-userobj",
-	"printk-msg-only",
-	"context-info",
-	"latency-format",
-	"sleep-time",
-	"graph-time",
-	"record-cmd",
+	[TRACE_ITER_PRINT_PARENT]   = "print-parent",
+	[TRACE_ITER_SYM_OFFSET]     = "sym-offset",
+	[TRACE_ITER_SYM_ADDR]       = "sym-addr",
+	[TRACE_ITER_VERBOSE]        = "verbose",
+	[TRACE_ITER_RAW]            = "raw",
+	[TRACE_ITER_HEX]            = "hex",
+	[TRACE_ITER_BIN]            = "bin",
+	[TRACE_ITER_BLOCK]          = "block",
+	[TRACE_ITER_STACKTRACE]     = "stacktrace",
+	[TRACE_ITER_PRINTK]         = "trace_printk",
+	[TRACE_ITER_PREEMPTONLY]    = "ftrace_preempt",
+	[TRACE_ITER_BRANCH]         = "branch",
+	[TRACE_ITER_ANNOTATE]       = "annotate",
+	[TRACE_ITER_USERSTACKTRACE] = "userstacktrace",
+	[TRACE_ITER_SYM_USEROBJ]    = "sym-userobj",
+	[TRACE_ITER_PRINTK_MSGONLY] = "printk-msg-only",
+	[TRACE_ITER_CONTEXT_INFO]   = "context-info",
+	[TRACE_ITER_LATENCY_FMT]    = "latency-format",
+	[TRACE_ITER_SLEEP_TIME]     = "sleep-time",
+	[TRACE_ITER_GRAPH_TIME]     = "graph-time",
+	[TRACE_ITER_RECORD_CMD]     = "record-cmd",
 	NULL
 };
 
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 36d4010..efb50eb 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -78,18 +78,19 @@ enum {
 };
 
 static char *err_text[] = {
-	"No error",
-	"Invalid operator",
-	"Unbalanced parens",
-	"Too many operands",
-	"Operand too long",
-	"Field not found",
-	"Illegal operation for field type",
-	"Illegal integer value",
-	"Couldn't find or set field in one of a subsystem's events",
-	"Too many terms in predicate expression",
-	"Missing field name and/or value",
-	"Meaningless filter expression",
+	[FILT_ERR_NONE]              = "No error",
+	[FILT_ERR_INVALID_OP]        = "Invalid operator",
+	[FILT_ERR_UNBALANCED_PAREN]  = "Unbalanced parens",
+	[FILT_ERR_TOO_MANY_OPERANDS] = "Too many operands",
+	[FILT_ERR_OPERAND_TOO_LONG]  = "Operand too long",
+	[FILT_ERR_FIELD_NOT_FOUND]   = "Field not found",
+	[FILT_ERR_ILLEGAL_FIELD_OP]  = "Illegal operation for field type",
+	[FILT_ERR_ILLEGAL_INTVAL]    = "Illegal integer value",
+	[FILT_ERR_BAD_SUBSYS_FILTER] = "Couldn't find or set field in one of"
+				       " a subsystem's events",
+	[FILT_ERR_TOO_MANY_PREDS]    = "Too many terms in predicate expression",
+	[FILT_ERR_MISSING_FIELD]     = "Missing field name and/or value",
+	[FILT_ERR_INVALID_FILTER]    = "Meaningless filter expression",
 };
 
 struct opstack_op {
-- 
1.7.1


             reply	other threads:[~2010-11-11  9:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11  9:49 Jiri Olsa [this message]
2010-11-11 12:17 ` Jiri Olsa

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=1289468965-8166-1-git-send-email-jolsa@redhat.com \
    --to=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=rostedt@goodmis.org \
    /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®