Commit cb24693
tracing: Use strim() to remove whitespace instead of doing it manually
The tracing_set_trace_write() function just removes the trailing whitespace
from the user supplied tracer name, but the leading whitespace should also
be removed.
In addition, if the user supplied tracer name contains only a few
whitespace characters, the first one will not be removed using the current
method, which results it a single whitespace character left in the buf.
To fix all of these issues, we use strim() to correctly remove both the
leading and trailing whitespace.
Link: https://lkml.kernel.org/r/20220121095623.1826679-1-ytcoode@gmail.com
Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent 2889c65 commit cb24693
1 file changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6461 | 6461 | | |
6462 | 6462 | | |
6463 | 6463 | | |
6464 | | - | |
| 6464 | + | |
6465 | 6465 | | |
6466 | 6466 | | |
6467 | 6467 | | |
| |||
6475 | 6475 | | |
6476 | 6476 | | |
6477 | 6477 | | |
6478 | | - | |
6479 | | - | |
6480 | | - | |
| 6478 | + | |
6481 | 6479 | | |
6482 | | - | |
| 6480 | + | |
6483 | 6481 | | |
6484 | 6482 | | |
6485 | 6483 | | |
| |||
0 commit comments