Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1718339

Re: [PATCH v5 3/4] perf, tools: Add support for printing new mem_info encodings

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 3/4] perf, tools: Add support for printing new mem_info encodings
Date 2017-08-23 15:10 +0200
Message-ID <uhDzY-WD-17@gated-at.bofh.it> (permalink)
References <ufeZ4-4rP-5@gated-at.bofh.it> <ufeZ4-4rP-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 16, 2017 at 03:21:55PM -0700, Andi Kleen wrote:

SNIP

>  int perf_mem__lvl_scnprintf(char *out, size_t sz, struct mem_info *mem_info)
>  {
>  	size_t i, l = 0;
>  	u64 m =  PERF_MEM_LVL_NA;
>  	u64 hit, miss;
> +	int printed;
>  
>  	if (mem_info)
>  		m  = mem_info->data_src.mem_lvl;
> @@ -184,17 +193,37 @@ int perf_mem__lvl_scnprintf(char *out, size_t sz, struct mem_info *mem_info)
>  	/* already taken care of */
>  	m &= ~(PERF_MEM_LVL_HIT|PERF_MEM_LVL_MISS);
>  
> +
> +	if (mem_info && mem_info->data_src.mem_remote) {
> +		strcat(out, "Remote ");
> +		l += 7;
> +	}

Andi,
how is this 'Remote' different from the remote levels in mem_lvl?

        "Remote RAM (1 hop)",
        "Remote RAM (2 hops)",
        "Remote Cache (1 hop)",
        "Remote Cache (2 hops)",

thanks,
jirka

> +
> +	printed = 0;
>  	for (i = 0; m && i < ARRAY_SIZE(mem_lvl); i++, m >>= 1) {
>  		if (!(m & 0x1))
>  			continue;
> -		if (l) {
> +		if (printed++) {
>  			strcat(out, " or ");
>  			l += 4;
>  		}
>  		l += scnprintf(out + l, sz - l, mem_lvl[i]);
>  	}
> -	if (*out == '\0')
> -		l += scnprintf(out, sz - l, "N/A");
> +
> +	if (mem_info && mem_info->data_src.mem_lvl_num) {
> +		int lvl = mem_info->data_src.mem_lvl_num;
> +		if (printed++) {
> +			strcat(out, " or ");
> +			l += 4;
> +		}
> +		if (mem_lvlnum[lvl])
> +			l += scnprintf(out + l, sz - l, mem_lvlnum[lvl]);
> +		else
> +			l += scnprintf(out + l, sz - l, "L%d", lvl);
> +	}

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Fix Skylake PEBS data source for perf v5 Andi Kleen <andi@firstfloor.org> - 2017-08-17 00:30 +0200
  [PATCH v5 1/4] perf/x86: Move Nehalem PEBS code to flag Andi Kleen <andi@firstfloor.org> - 2017-08-17 00:30 +0200
  [PATCH v5 3/4] perf, tools: Add support for printing new mem_info encodings Andi Kleen <andi@firstfloor.org> - 2017-08-17 00:30 +0200
    Re: [PATCH v5 3/4] perf, tools: Add support for printing new  mem_info encodings Jiri Olsa <jolsa@redhat.com> - 2017-08-23 15:10 +0200
      Re: [PATCH v5 3/4] perf, tools: Add support for printing new  mem_info encodings Andi Kleen <ak@linux.intel.com> - 2017-08-23 16:10 +0200
        Re: [PATCH v5 3/4] perf, tools: Add support for printing new  mem_info encodings Jiri Olsa <jolsa@redhat.com> - 2017-08-23 16:20 +0200
          Re: [PATCH v5 3/4] perf, tools: Add support for printing new  mem_info encodings Andi Kleen <andi@firstfloor.org> - 2017-08-23 18:00 +0200
            Re: [PATCH v5 3/4] perf, tools: Add support for printing new  mem_info encodings Jiri Olsa <jolsa@redhat.com> - 2017-08-24 10:30 +0200
    [tip:perf/core] perf tools: Add support for printing new mem_info  encodings tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-08-24 10:30 +0200
  [PATCH v5 2/4] perf/x86: Fix data source decoding for Skylake Andi Kleen <andi@firstfloor.org> - 2017-08-17 00:30 +0200
  [PATCH v5 4/4] perf, tools: Add test cases for new data source encoding Andi Kleen <andi@firstfloor.org> - 2017-08-17 00:30 +0200
    [tip:perf/core] perf test: Add test cases for new data source  encoding tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-08-24 10:30 +0200
  Re: Fix Skylake PEBS data source for perf v5 Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-08-22 17:40 +0200

csiph-web