From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Milian Wolff <milian.wolff@kdab.com>
Cc: jolsa@kernel.org, namhyung@kernel.org,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Andi Kleen <andi@firstfloor.org>,
Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: Re: [PATCH v7 0/5] generate full callchain cursor entries for inlined frames
Date: Mon, 23 Oct 2017 11:29:35 -0300 [thread overview]
Message-ID: <20171023142935.GC21936@kernel.org> (raw)
In-Reply-To: <3662337.Ysj1km7A8r@agathebauer>
Em Fri, Oct 20, 2017 at 10:21:03PM +0200, Milian Wolff escreveu:
> On Freitag, 20. Oktober 2017 18:15:40 CEST Arnaldo Carvalho de Melo wrote:
> > Em Thu, Oct 19, 2017 at 01:38:31PM +0200, Milian Wolff escreveu:
> > > This series of patches completely reworks the way inline frames are
> > > handled. Instead of querying for the inline nodes on-demand in the
> > > individual tools, we now create proper callchain nodes for inlined
> > > frames. The advantages this approach brings are numerous:
> > >
> > > - less duplicated code in the individual browser
> > > - aggregated cost for inlined frames for the --children top-down list
> > > - various bug fixes that arose from querying for a srcline/symbol based on
> > >
> > > the IP of a sample, which will always point to the last inlined frame
> > > instead of the corresponding non-inlined frame
> > >
> > > - overall much better support for visualizing cost for heavily-inlined C++
> > >
> > > code, which simply was confusing and unreliably before
> > >
> > > - srcline honors the global setting as to whether full paths or basenames
> > >
> > > should be shown
> > >
> > > - caches for inlined frames and srcline information, which allow us to
> > >
> > > enable inline frame handling by default
> > >
> > > For comparison, below lists the output before and after for `perf script`
> >
> > > and `perf report`. The example file I used to generate the perf data is:
> >
> > So, please check my tmp.perf/core branch, it has this patchset + the fix
> > I proposed for the match_chain() to always use absolute addresses.
>
> OK, so I've looked at it. I think there are some style issues with the
> indentation in match_chain_addresses. Also, the unmap_ip lines are too long
> for checkpatch.pl
I don't pay too much attention to that part of checkpatch, will take a
look if in this case we should obey that rule.
> Additionally, we can now still run into the CCKEY_ADDRESS code path (when
> match_chain_strings for inlined symbols returns MATCH_ERROR, or when either
> cnode->ms.sym or node->sym is invalid), but won't unmap the IP properly then.
>
> Can we maybe instead use something like this on top of your patch?
I'll of course fix the identation problems and will analyse your patch
today.
- Arnaldo
> diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
> index 01fc95fdd1e0..92bca95be202 100644
> --- a/tools/perf/util/callchain.c
> +++ b/tools/perf/util/callchain.c
> @@ -669,11 +669,16 @@ static enum match_result match_chain_strings(const char
> *left,
> static enum match_result match_chain_addresses(u64 left_ip, u64 right_ip)
> {
> if (left_ip == right_ip)
> - return MATCH_EQ;
> - else if (left_ip < right_ip)
> - return MATCH_LT;
> - else
> - return MATCH_GT;
> + return MATCH_EQ;
> + else if (left_ip < right_ip)
> + return MATCH_LT;
> + else
> + return MATCH_GT;
> +}
> +
> +static u64 unmap_ip(struct map *map, u64 ip)
> +{
> + return map ? map->unmap_ip(map, ip) : ip;
> }
>
> static enum match_result match_chain(struct callchain_cursor_node *node,
> @@ -702,9 +707,10 @@ static enum match_result match_chain(struct
> callchain_cursor_node *node,
> if (match != MATCH_ERROR)
> break;
> } else {
> - u64 left = cnode->ms.map->unmap_ip(cnode->ms.map, cnode-
> >ms.sym->start),
> - right = node->map->unmap_ip(node->map, node->sym->start);
> -
> + u64 left = unmap_ip(cnode->ms.map,
> + cnode->ms.sym->start);
> + u64 right = unmap_ip(node->map,
> + node->sym->start);
> match = match_chain_addresses(left, right);
> break;
> }
> @@ -713,7 +719,9 @@ static enum match_result match_chain(struct
> callchain_cursor_node *node,
> __fallthrough;
> case CCKEY_ADDRESS:
> default:
> - match = match_chain_addresses(cnode->ip, node->ip);
> + match = match_chain_addresses(unmap_ip(cnode->ms.map,
> + cnode->ip),
> + unmap_ip(node->map, node->ip));
> break;
> }
>
> Cheers
> --
> Milian Wolff | milian.wolff@kdab.com | Senior Software Engineer
> KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
> Tel: +49-30-521325470
> KDAB - The Qt Experts
>
next prev parent reply other threads:[~2017-10-23 14:29 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 11:38 [PATCH v7 0/5] generate full callchain cursor entries for inlined frames Milian Wolff
2017-10-19 11:38 ` [PATCH v7 1/5] perf report: properly handle branch count in match_chain Milian Wolff
2017-10-19 11:42 ` Milian Wolff
2017-10-23 15:15 ` Andi Kleen
2017-10-23 18:39 ` Milian Wolff
2017-10-23 20:39 ` Andi Kleen
2017-10-19 11:38 ` [PATCH v7 2/5] perf report: cache failed lookups of inlined frames Milian Wolff
2017-10-25 17:20 ` [tip:perf/core] perf report: Cache " tip-bot for Milian Wolff
2017-10-19 11:38 ` [PATCH v7 3/5] perf report: cache srclines for callchain nodes Milian Wolff
2017-10-25 17:20 ` [tip:perf/core] perf report: Cache " tip-bot for Milian Wolff
2017-10-19 11:38 ` [PATCH v7 4/5] perf report: use srcline from callchain for hist entries Milian Wolff
2017-10-25 17:21 ` [tip:perf/core] perf report: Use " tip-bot for Milian Wolff
2017-10-19 11:38 ` [PATCH v7 5/5] perf util: enable handling of inlined frames by default Milian Wolff
2017-10-25 17:21 ` [tip:perf/core] perf util: Enable " tip-bot for Milian Wolff
2017-10-20 16:15 ` [PATCH v7 0/5] generate full callchain cursor entries for inlined frames Arnaldo Carvalho de Melo
2017-10-20 20:21 ` Milian Wolff
2017-10-23 14:29 ` Arnaldo Carvalho de Melo [this message]
2017-10-23 19:04 ` Milian Wolff
2017-10-23 19:04 ` Arnaldo Carvalho de Melo
2017-10-23 19:39 ` Milian Wolff
2017-10-23 22:43 ` Arnaldo Carvalho de Melo
2017-10-24 13:27 ` Arnaldo Carvalho de Melo
2017-10-25 2:09 ` Namhyung Kim
-- strict thread matches above, loose matches on Subject: below --
2017-10-18 18:53 [PATCH v6 0/6] " Milian Wolff
2017-10-18 18:53 ` [PATCH v6 1/6] perf report: properly handle branch count in match_chain Milian Wolff
2017-10-18 22:41 ` Andi Kleen
2017-10-19 10:59 ` Milian Wolff
2017-10-19 13:55 ` Andi Kleen
2017-10-19 15:01 ` Namhyung Kim
2017-10-20 10:21 ` Milian Wolff
2017-10-20 11:38 ` Milian Wolff
2017-10-20 13:39 ` Arnaldo Carvalho de Melo
2017-10-23 5:19 ` Namhyung Kim
2017-10-20 15:22 ` Arnaldo Carvalho de Melo
2017-10-20 19:52 ` Milian Wolff
2017-10-25 17:20 ` [tip:perf/core] perf report: Properly handle branch count in match_chain() tip-bot for Milian Wolff
2017-10-18 18:53 ` [PATCH v6 2/6] perf report: cache failed lookups of inlined frames Milian Wolff
2017-10-18 18:53 ` [PATCH v6 3/6] perf report: cache srclines for callchain nodes Milian Wolff
2017-10-18 18:53 ` [PATCH v6 4/6] perf report: use srcline from callchain for hist entries Milian Wolff
2017-10-18 18:53 ` [PATCH v6 5/6] perf util: enable handling of inlined frames by default Milian Wolff
2017-10-18 18:53 ` [PATCH v6 6/6] perf util: use correct IP mapping to find srcline for hist entry Milian Wolff
2017-10-19 10:54 ` Milian Wolff
2017-10-20 5:15 ` Namhyung Kim
2017-10-24 8:51 ` Milian Wolff
2017-10-25 1:46 ` Namhyung Kim
2017-10-30 20:03 ` Arnaldo Carvalho de Melo
2017-10-30 23:35 ` Namhyung Kim
2017-11-03 14:21 ` [tip:perf/core] perf callchain: Fix double mapping al->addr for children without self period tip-bot for Namhyung Kim
2017-10-18 22:43 ` [PATCH v6 0/6] generate full callchain cursor entries for inlined frames Andi Kleen
2017-10-20 15:43 ` 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=20171023142935.GC21936@kernel.org \
--to=acme@kernel.org \
--cc=andi@firstfloor.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=milian.wolff@kdab.com \
--cc=namhyung@kernel.org \
--cc=ravi.bangoria@linux.vnet.ibm.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 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.