From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: peterz@infradead.org, acme@kernel.org, jolsa@kernel.org,
linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
Joe Mario <jmario@redhat.com>
Subject: Re: [PATCH v5 3/4] perf, tools: Add support for printing new mem_info encodings
Date: Wed, 23 Aug 2017 15:01:48 +0200 [thread overview]
Message-ID: <20170823130148.GA7736@krava> (raw)
In-Reply-To: <20170816222156.19953-4-andi@firstfloor.org>
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);
> + }
next prev parent reply other threads:[~2017-08-23 13:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 22:21 Fix Skylake PEBS data source for perf v5 Andi Kleen
2017-08-16 22:21 ` [PATCH v5 1/4] perf/x86: Move Nehalem PEBS code to flag Andi Kleen
2017-08-25 11:53 ` [tip:perf/core] " tip-bot for Andi Kleen
2017-08-16 22:21 ` [PATCH v5 2/4] perf/x86: Fix data source decoding for Skylake Andi Kleen
2017-08-25 11:53 ` [tip:perf/core] " tip-bot for Andi Kleen
2017-08-16 22:21 ` [PATCH v5 3/4] perf, tools: Add support for printing new mem_info encodings Andi Kleen
2017-08-23 13:01 ` Jiri Olsa [this message]
2017-08-23 14:00 ` Andi Kleen
2017-08-23 14:14 ` Jiri Olsa
2017-08-23 15:59 ` Andi Kleen
2017-08-24 8:23 ` Jiri Olsa
2017-08-24 8:23 ` [tip:perf/core] perf " tip-bot for Andi Kleen
2017-08-16 22:21 ` [PATCH v5 4/4] perf, tools: Add test cases for new data source encoding Andi Kleen
2017-08-24 8:23 ` [tip:perf/core] perf test: " tip-bot for Andi Kleen
2017-08-22 15:37 ` Fix Skylake PEBS data source for perf v5 Arnaldo Carvalho de Melo
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=20170823130148.GA7736@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=jmario@redhat.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox