[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1516093350-12045-3-git-send-email-changbin.du@intel.com>
Date: Tue, 16 Jan 2018 17:02:29 +0800
From: changbin.du@...el.com
To: rostedt@...dmis.org
Cc: jolsa@...hat.com, peterz@...radead.org, mingo@...hat.com,
alexander.shishkin@...ux.intel.com, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org,
Changbin Du <changbin.du@...el.com>
Subject: [PATCH v3 2/3] tracing: clear parser->idx if parser gets nothing
From: Changbin Du <changbin.du@...el.com>
If only spaces was got in that cycle, we should clear parser->idx to make
trace_parser_loaded() return false.
Signed-off-by: Changbin Du <changbin.du@...el.com>
---
kernel/trace/trace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 144d08e..b44926e 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1236,14 +1236,14 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
cnt--;
}
+ parser->idx = 0;
+
/* only spaces were written */
if (isspace(ch) || !ch) {
*ppos += read;
ret = read;
goto out;
}
-
- parser->idx = 0;
}
/* read the non-space input */
--
2.7.4
Powered by blists - more mailing lists