All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andreas Hollmann <hollmann@in.tum.de>,
	Milian Wolff <milian.wolff@kdab.com>
Subject: Re: [PATCH 1/3] perf tools: Introduce trim function
Date: Thu, 7 Apr 2016 10:50:47 -0300	[thread overview]
Message-ID: <20160407135047.GF5945@kernel.org> (raw)
In-Reply-To: <1460013073-18444-1-git-send-email-jolsa@kernel.org>

Em Thu, Apr 07, 2016 at 09:11:11AM +0200, Jiri Olsa escreveu:
> To be used in cases for both sides trim.
> 
> Link: http://lkml.kernel.org/n/tip-7fuk01zwjefo0aoqo42co0vy@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>

Thanks, applied.

Will try Milian's 'perf trace' callchain patch soon, any updates on that one?

- Arnaldo

>  tools/perf/ui/browsers/hists.c | 3 +--
>  tools/perf/ui/stdio/hist.c     | 3 +--
>  tools/perf/util/util.h         | 5 +++++
>  3 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> index 2a83414159a6..e70df2e54d66 100644
> --- a/tools/perf/ui/browsers/hists.c
> +++ b/tools/perf/ui/browsers/hists.c
> @@ -1607,9 +1607,8 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
>  
>  			ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
>  			dummy_hpp.buf[ret] = '\0';
> -			rtrim(dummy_hpp.buf);
>  
> -			start = ltrim(dummy_hpp.buf);
> +			start = trim(dummy_hpp.buf);
>  			ret = strlen(start);
>  
>  			if (start != dummy_hpp.buf)
> diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
> index 7aff5acf3265..560eb47d56f9 100644
> --- a/tools/perf/ui/stdio/hist.c
> +++ b/tools/perf/ui/stdio/hist.c
> @@ -569,9 +569,8 @@ static int print_hierarchy_header(struct hists *hists, struct perf_hpp *hpp,
>  			first_col = false;
>  
>  			fmt->header(fmt, hpp, hists_to_evsel(hists));
> -			rtrim(hpp->buf);
>  
> -			header_width += fprintf(fp, "%s", ltrim(hpp->buf));
> +			header_width += fprintf(fp, "%s", trim(hpp->buf));
>  		}
>  	}
>  
> diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
> index 8298d607c738..3bf3de86d429 100644
> --- a/tools/perf/util/util.h
> +++ b/tools/perf/util/util.h
> @@ -254,6 +254,11 @@ int hex2u64(const char *ptr, u64 *val);
>  char *ltrim(char *s);
>  char *rtrim(char *s);
>  
> +static inline char *trim(char *s)
> +{
> +	return ltrim(rtrim(s));
> +}
> +
>  void dump_stack(void);
>  void sighandler_dump_stack(int sig);
>  
> -- 
> 2.4.11

  parent reply	other threads:[~2016-04-07 13:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07  7:11 [PATCH 1/3] perf tools: Introduce trim function Jiri Olsa
2016-04-07  7:11 ` [PATCH 2/3] perf tools: Add dedicated unwind addr_space member into thread struct Jiri Olsa
2016-04-13  7:17   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-04-07  7:11 ` [PATCH 3/3] perf script: Process event update events Jiri Olsa
2016-04-13  7:17   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-04-07 13:50 ` Arnaldo Carvalho de Melo [this message]
2016-04-07 14:03   ` [PATCH 1/3] perf tools: Introduce trim function Jiri Olsa
2016-04-07 15:45     ` Milian Wolff
2016-04-13  7:16 ` [tip:perf/core] " tip-bot for Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160407135047.GF5945@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=dsahern@gmail.com \
    --cc=hollmann@in.tum.de \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=milian.wolff@kdab.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.