]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Fix the code to strip command name
authorJiri Olsa <jolsa@kernel.org>
Thu, 20 Apr 2017 09:24:30 +0000 (11:24 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 24 Apr 2017 16:43:37 +0000 (13:43 -0300)
commitde635784272f19d61bebd2f35673a11cab6573f1
tree3564d53e2242beb9616ad050a6142de689cf814a
parentb53a17fbc98ec6a0662daa9531eccf608e448afd
perf tools: Fix the code to strip command name

Recent commit broke command name strip in perf_event__get_comm_ids
function. It replaced left to right search for '\n' with rtrim, which
actually does right to left search. It occasionally caught earlier '\n'
and kept trash in the command name.

Keeping the ltrim, but moving back the left to right '\n' search
instead of the rtrim.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Taeung Song <treeze.taeung@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Yao Jin <yao.jin@linux.intel.com>
Fixes: e8677d9b33c6 ("perf tools: Refactor the code to strip command name with {l,r}trim()")
Link: http://lkml.kernel.org/r/20170420092430.29657-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/event.c