tracing - add indexes to the array values definitions
PATCH 1/1 tracing - add indexes to the array values definitions
Adding indexes to trace_options and err_text arrays definitions. It helps the code readability.
wbr,
jirka
Signed-off-by Jiri Olsa <[email protected]>
--- kernel/trace/trace.c | 42 ++++++++++++++++++------------------ kernel/trace/trace_events_filter.c | 25 +++++++++++---------- 2 files changed, 34 insertions(+), 33 deletions(-)
kernel/trace/trace.c +21 -21
@@ -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 };
kernel/trace/trace_events_filter.c +13 -12
@@ -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 {
Signature · 1 line
1.7.1
oops, I got confused.. please ignore this one :)
wbr,
jirka
Quoted 110 lines · Jiri Olsa
Adding indexes to
trace_optionsanderr_textarrays definitions. It helps the code readability.wbr,
jirkaSigned-off-by Jiri Olsa <[email protected]>--- kernel/trace/trace.c | 42 ++++++++++++++++++------------------ kernel/trace/trace_events_filter.c | 25 +++++++++++---------- 2 files changed, 34 insertions(+), 33 deletions(-)kernel/trace/trace.c +21
-21@@ -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 };kernel/trace/trace_events_filter.c +13
-12@@ -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 {Signature · 7 lines
1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/