All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jiebin Sun" <jiebin.sun@intel.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 3/4] perf c2c: Add stdio support for the function view
Date: Fri, 21 Aug 2026 05:58:43 +0000	[thread overview]
Message-ID: <20260821055844.389E41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <c53d3eb3a036c250702af363b6e7ce3307aa1571.1787283281.git.jiebin.sun@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [Medium] Memory leak: L2 and L3 function-view child entries are not freed on cleanup because `perf c2c` does not set `symbol_conf.report_hierarchy`, bypassing the recursive deletion in `hist_entry__delete()`.
--

--- Patch [3]: [PATCH 3/4] perf c2c: Add stdio support for the function view ---
commit e1f0ed49bafb9da749fbfa14e02ab8497ae9d5d4
Author: Jiebin Sun <jiebin.sun@intel.com>

perf c2c: Add stdio support for the function view

This commit adds a --function option to perf c2c to print the fully expanded
three-level hierarchy to stdout, allowing its use without SLANG support,
when piped, or in scripts. It reuses the common function-view model while
preserving the boundary between utilities and the UI.

> diff --git a/tools/perf/util/c2c-function.c b/tools/perf/util/c2c-function.c
> --- a/tools/perf/util/c2c-function.c
> +++ b/tools/perf/util/c2c-function.c

[ ... ]

> @@ -1519,7 +1516,7 @@ void c2c_function__reset(void)
>  	symbol_conf.use_callchain = saved_use_callchain;
>  }

[Severity: Medium]
This is a pre-existing issue, but does this teardown logic in
c2c_function__reset() leak the L2 and L3 function-view child entries?

When cleaning up the hierarchy, hists__delete_all_entries() relies on
hist_entry__delete() for each node. However, in tools/perf/util/hist.c,
hist_entry__delete() only recursively deletes the child entries in hroot_out
if the hierarchy flag is set:

tools/perf/util/hist.c:hist_entry__delete() {
    ...
    if (symbol_conf.report_hierarchy) {
        struct rb_root *root = &he->hroot_out.rb_root;
        struct hist_entry *child, *tmp;

        rbtree_postorder_for_each_entry_safe(child, tmp, root, rb_node)
            hist_entry__delete(child);

        *root = RB_ROOT;
    }
    ...
}

Since perf c2c does not appear to set symbol_conf.report_hierarchy, won't
these child entries be orphaned and skipped during cleanup?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787283281.git.jiebin.sun@intel.com?part=3

  reply	other threads:[~2026-08-21  5:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  5:56 [PATCH 0/4] perf c2c: Add function-view stdio support and coverage Jiebin Sun
2026-08-21  5:56 ` [PATCH 1/4] perf c2c: Fix documented default coalesce fields Jiebin Sun
2026-08-21  5:57   ` sashiko-bot
2026-08-21  5:56 ` [PATCH 2/4] perf tests c2c: Report skip when the workload fails Jiebin Sun
2026-08-21  5:52   ` sashiko-bot
2026-08-21  5:56 ` [PATCH 3/4] perf c2c: Add stdio support for the function view Jiebin Sun
2026-08-21  5:58   ` sashiko-bot [this message]
2026-08-21  5:56 ` [PATCH 4/4] perf tests c2c: Add function view stdio coverage Jiebin Sun
2026-08-21  5:58   ` sashiko-bot

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=20260821055844.389E41F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jiebin.sun@intel.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.