tracing: use newline separator for trace options list
Impact: clean up Instead of listing the trace options like: # cat /debug/tracing/trace_options print-parent nosym-offset nosym-addr noverbose noraw nohex nobin noblock nostacktrace nosched-tree ftrace_printk noftrace_preempt nobranch annotate nouserstacktrace nosym-userobj We now list them like: # cat /debug/tracing/trace_options print-parent nosym-offset nosym-addr noverbose noraw nohex nobin noblock nostacktrace nosched-tree ftrace_printk noftrace_preempt nobranch annotate nouserstacktrace nosym-userobj Signed-off-by: Steven Rostedt <srostedt@redhat.com>
This commit is contained in:
parent
85a2f9b46f
commit
5c6a3ae1b4
1 changed files with 6 additions and 7 deletions
|
@ -2037,7 +2037,7 @@ tracing_trace_options_read(struct file *filp, char __user *ubuf,
|
||||||
/* calculate max size */
|
/* calculate max size */
|
||||||
for (i = 0; trace_options[i]; i++) {
|
for (i = 0; trace_options[i]; i++) {
|
||||||
len += strlen(trace_options[i]);
|
len += strlen(trace_options[i]);
|
||||||
len += 3; /* "no" and space */
|
len += 3; /* "no" and newline */
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&trace_types_lock);
|
mutex_lock(&trace_types_lock);
|
||||||
|
@ -2050,7 +2050,7 @@ tracing_trace_options_read(struct file *filp, char __user *ubuf,
|
||||||
*/
|
*/
|
||||||
for (i = 0; trace_opts[i].name; i++) {
|
for (i = 0; trace_opts[i].name; i++) {
|
||||||
len += strlen(trace_opts[i].name);
|
len += strlen(trace_opts[i].name);
|
||||||
len += 3; /* "no" and space */
|
len += 3; /* "no" and newline */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* +2 for \n and \0 */
|
/* +2 for \n and \0 */
|
||||||
|
@ -2062,22 +2062,21 @@ tracing_trace_options_read(struct file *filp, char __user *ubuf,
|
||||||
|
|
||||||
for (i = 0; trace_options[i]; i++) {
|
for (i = 0; trace_options[i]; i++) {
|
||||||
if (trace_flags & (1 << i))
|
if (trace_flags & (1 << i))
|
||||||
r += sprintf(buf + r, "%s ", trace_options[i]);
|
r += sprintf(buf + r, "%s\n", trace_options[i]);
|
||||||
else
|
else
|
||||||
r += sprintf(buf + r, "no%s ", trace_options[i]);
|
r += sprintf(buf + r, "no%s\n", trace_options[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; trace_opts[i].name; i++) {
|
for (i = 0; trace_opts[i].name; i++) {
|
||||||
if (tracer_flags & trace_opts[i].bit)
|
if (tracer_flags & trace_opts[i].bit)
|
||||||
r += sprintf(buf + r, "%s ",
|
r += sprintf(buf + r, "%s\n",
|
||||||
trace_opts[i].name);
|
trace_opts[i].name);
|
||||||
else
|
else
|
||||||
r += sprintf(buf + r, "no%s ",
|
r += sprintf(buf + r, "no%s\n",
|
||||||
trace_opts[i].name);
|
trace_opts[i].name);
|
||||||
}
|
}
|
||||||
mutex_unlock(&trace_types_lock);
|
mutex_unlock(&trace_types_lock);
|
||||||
|
|
||||||
r += sprintf(buf + r, "\n");
|
|
||||||
WARN_ON(r >= len + 2);
|
WARN_ON(r >= len + 2);
|
||||||
|
|
||||||
r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
|
r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
|
||||||
|
|
Loading…
Add table
Reference in a new issue