From: Namhyung Kim <namhyung@kernel.org>
To: Jiebin Sun <jiebin.sun@intel.com>
Cc: acme@kernel.org, mingo@redhat.com, peterz@infradead.org,
adrian.hunter@intel.com, alexander.shishkin@linux.intel.com,
irogers@google.com, james.clark@linaro.org, jolsa@kernel.org,
mark.rutland@arm.com, dapeng1.mi@linux.intel.com,
thomas.falcon@intel.com, tianyou.li@intel.com,
wangyang.guo@intel.com, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 3/9] perf c2c: add column rendering for function view
Date: Wed, 12 Aug 2026 17:43:32 +0900 [thread overview]
Message-ID: <anwyNEKi0wSHEuOI@google.com> (raw)
In-Reply-To: <20260810052647.588867-4-jiebin.sun@intel.com>
On Mon, Aug 10, 2026 at 01:26:41PM +0800, Jiebin Sun wrote:
> Add renderers for the function view's Cycles %, Store count, and
> hierarchy identity columns. The identity column renders the read-side
> function, contending writer, or cacheline, with indentation for the
> hierarchy level. Also add width and header helpers, estimated-cycle
> calculation, comparators, and the dimension table that ties them together.
>
> Clamp the identity renderer's returned length to its local buffer before
> using it for pointer and padding calculations. This handles snprintf-style
> would-have-been lengths without changing normal output.
>
> The next patch connects these dimensions to the view's HPP lists, so the
> symbols used only there are temporarily marked __maybe_unused.
>
> Signed-off-by: Jiebin Sun <jiebin.sun@intel.com>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: James Clark <james.clark@linaro.org>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Falcon <thomas.falcon@intel.com>
> Reviewed-by: Tianyou Li <tianyou.li@intel.com>
> Reviewed-by: Wangyang Guo <wangyang.guo@intel.com>
> ---
[SNIP]
> +/*
> + * Store count shown in the column: a level-3 cacheline leaf shows its parent
> + * level-2 writer's stores on that line, not all stores on the line. A level-2
> + * writer shows the sum across its level-3 cachelines. A level-1 reader shows
> + * the sum across all included writers on the cachelines it reads; this is not
> + * the reader function's own store count and is not additive across readers.
> + */
> +static u64 hist_entry__displayed_stores(struct hist_entry *he)
> +{
> + struct c2c_hist_entry *c2c_he = container_of(he, struct c2c_hist_entry, he);
> + struct rb_node *nd;
> + u64 stores = 0;
> +
> + /* Level-2/3 entries already aggregate the stores they represent. */
> + if (he->parent_he)
> + return c2c_he->stats.store;
> +
> + for (nd = rb_first_cached(&he->hroot_out); nd; nd = rb_next(nd)) {
> + struct hist_entry *child = rb_entry(nd, struct hist_entry, rb_node);
> + struct c2c_hist_entry *child_c2c;
> +
> + child_c2c = container_of(child, struct c2c_hist_entry, he);
Can it be simplified like this?
struct c2c_hist_entry *child_c2c = rb_entry(nd, struct c2c_hist_entry, he.rb_node);
Thanks,
Namhyung
> + stores += child_c2c->stats.store;
> + }
> + return stores;
> +}
next prev parent reply other threads:[~2026-08-12 8:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 5:26 [PATCH v8 0/9] perf c2c: add a function view Jiebin Sun
2026-08-10 5:26 ` [PATCH v8 1/9] perf c2c: extract shared data structures into util/c2c.h Jiebin Sun
2026-08-10 5:26 ` [PATCH v8 2/9] perf c2c: add function view browser skeleton Jiebin Sun
2026-08-12 8:26 ` Namhyung Kim
2026-08-10 5:26 ` [PATCH v8 3/9] perf c2c: add column rendering for function view Jiebin Sun
2026-08-12 8:43 ` Namhyung Kim [this message]
2026-08-10 5:26 ` [PATCH v8 4/9] perf c2c: add HPP list parsing for function view columns Jiebin Sun
2026-08-10 5:26 ` [PATCH v8 5/9] perf c2c: add function view stats merge and memory management Jiebin Sun
2026-08-10 5:26 ` [PATCH v8 6/9] perf c2c: add function view hierarchy entry creation Jiebin Sun
2026-08-10 5:49 ` sashiko-bot
2026-08-12 1:47 ` Namhyung Kim
2026-08-12 13:01 ` Namhyung Kim
2026-08-12 13:03 ` Namhyung Kim
2026-08-10 5:26 ` [PATCH v8 7/9] perf c2c: build and finalize the function view hierarchy Jiebin Sun
2026-08-10 5:26 ` [PATCH v8 8/9] perf c2c: add function view browser UI and cacheline detail Jiebin Sun
2026-08-10 5:26 ` [PATCH v8 9/9] perf c2c: document function view in perf-c2c man page Jiebin Sun
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=anwyNEKi0wSHEuOI@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=jiebin.sun@intel.com \
--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 \
--cc=tianyou.li@intel.com \
--cc=wangyang.guo@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