From 328584804edc950fb4608c9a38e396ac71ef22b6 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Wed, 26 Jun 2019 11:42:03 -0300 Subject: perf tools: Ditch rtrim(), use skip_spaces() to get closer to the kernel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No change in behaviour, just using the same kernel idiom for such operation. Cc: Adrian Hunter Cc: André Goddard Rosa Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-a85lkptkt0ru40irpga8yf54@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/event.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tools/perf/util/event.c') diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index d8f8a20543c5..e1d0c5ba1f92 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -158,9 +158,7 @@ static int perf_event__get_comm_ids(pid_t pid, char *comm, size_t len, if (name) { char *nl; - name += 5; /* strlen("Name:") */ - name = ltrim(name); - + name = skip_spaces(name + 5); /* strlen("Name:") */ nl = strchr(name, '\n'); if (nl) *nl = '\0'; -- cgit v1.2.1