The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Thomas Falcon <thomas.falcon@intel.com>
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	Dapeng Mi <dapeng1.mi@linux.intel.com>
Subject: Re: [PATCH v2 6/6] perf c2c: print memory region data with stdio output
Date: Tue, 28 Jul 2026 10:34:31 -0700	[thread overview]
Message-ID: <amjoJwZSS_aM8T47@google.com> (raw)
In-Reply-To: <20260714004359.179451-7-thomas.falcon@intel.com>

On Mon, Jul 13, 2026 at 07:43:59PM -0500, Thomas Falcon wrote:
> Print memory range data in perf-c2c subcommand. Only available in stdio
> mode currently. If memory ranges are not supported or present, print
> nothing.

Can you please add an example output?

Thanks,
Namhyung

> 
> Assisted-by: Sashiko:gemini-3.1-pro-preview
> Signed-off-by: Thomas Falcon <thomas.falcon@intel.com>
> ---
>  tools/perf/builtin-c2c.c | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
> index cba2e9f21ae7..68348a93bd33 100644
> --- a/tools/perf/builtin-c2c.c
> +++ b/tools/perf/builtin-c2c.c
> @@ -2634,6 +2634,34 @@ static void print_c2c_info(FILE *out, struct perf_session *session)
>  	fprintf(out, "  Cacheline data grouping           : %s\n", c2c.cl_sort);
>  }
>  
> +
> +static void print_memory_ranges_info(FILE *out, struct perf_session *session)
> +{
> +	struct perf_env *env = perf_session__env(session);
> +	int nr_ranges = 0;
> +
> +	if (!perf_header__has_feat(&session->header, HEADER_MEMORY_RANGES))
> +		return;
> +	nr_ranges = env->nr_memory_ranges;
> +	if (nr_ranges == 0) {
> +		pr_debug("No memory ranges found, skipping\n");
> +		return;
> +	}
> +
> +	fprintf(out, "\n");
> +	fprintf(out, "=================================================\n");
> +	fprintf(out, "                  Memory Ranges                  \n");
> +	fprintf(out, "=================================================\n");
> +
> +	for (int i = 0; i < nr_ranges; i++) {
> +		struct memory_range *r = &env->memory_ranges[i];
> +
> +		fprintf(out, "Range %d: [0x%016" PRIx64 "-0x%016" PRIx64 "] Node %d, local region id %u, remote region id %u\n",
> +			i, r->base, r->base + r->length - 1, r->node,
> +			r->local_region_id, r->remote_region_id);
> +	}
> +}
> +
>  static void perf_c2c__hists_fprintf(FILE *out, struct perf_session *session)
>  {
>  	setup_pager();
> @@ -2647,6 +2675,8 @@ static void perf_c2c__hists_fprintf(FILE *out, struct perf_session *session)
>  	if (c2c.stats_only)
>  		return;
>  
> +	print_memory_ranges_info(out, session);
> +
>  	fprintf(out, "\n");
>  	fprintf(out, "=================================================\n");
>  	fprintf(out, "           Shared Data Cache Line Table          \n");
> -- 
> 2.43.0
> 

      reply	other threads:[~2026-07-28 17:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  0:43 [PATCH v2 0/6] perf: Add support for memory region/range reporting Thomas Falcon
2026-07-14  0:43 ` [PATCH v2 1/6] perf mem: Fix size tracking for mem_lvl's in perf_script__meminfo_scnprintf() Thomas Falcon
2026-07-15  6:59   ` Mi, Dapeng
2026-07-14  0:43 ` [PATCH v2 2/6] perf mem: Add support for printing PERF_MEM_LVLNUM_L0 Thomas Falcon
2026-07-15  7:11   ` Mi, Dapeng
2026-07-28 17:13   ` Namhyung Kim
2026-07-14  0:43 ` [PATCH v2 3/6] perf tools: Show memory region in perf-c2c subcommand Thomas Falcon
2026-07-28 17:17   ` Namhyung Kim
2026-07-14  0:43 ` [PATCH v2 4/6] perf tools: Show memory region in perf-script subcommand Thomas Falcon
2026-07-28 17:18   ` Namhyung Kim
2026-07-14  0:43 ` [PATCH v2 5/6] perf header: Support memory ranges Thomas Falcon
2026-07-28 17:33   ` Namhyung Kim
2026-07-14  0:43 ` [PATCH v2 6/6] perf c2c: print memory region data with stdio output Thomas Falcon
2026-07-28 17:34   ` Namhyung Kim [this message]

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=amjoJwZSS_aM8T47@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=thomas.falcon@intel.com \
    /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