Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1419454

Re: [PATCH 1/2] perf annotate: generalize handling of ret instructions

From "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] perf annotate: generalize handling of ret instructions
Date 2016-06-10 16:10 +0200
Message-ID <rIvih-5yi-19@gated-at.bofh.it> (permalink)
References <rIume-4YI-23@gated-at.bofh.it> <rIuPg-58O-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016/06/10 10:30AM, Arnaldo Carvalho de Melo wrote:
> Em Fri, Jun 10, 2016 at 06:32:50PM +0530, Naveen N. Rao escreveu:
> > Introduce helper to detect ret instructions and use the same in the tui.

Hi Arnaldo,
Thanks for the review.

> 
> Humm, I think this is simpler and equivalent, since so far we didn't had
> any need for special handling of "retq"/"ret" instructions:
> 
> diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
> index 4fc208e82c6f..29cef599a091 100644
> --- a/tools/perf/ui/browsers/annotate.c
> +++ b/tools/perf/ui/browsers/annotate.c
> @@ -226,11 +226,11 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
>  				ui_browser__write_nstring(browser, " ", 2);
>  			}
>  		} else {
> -			if (strcmp(dl->name, "retq")) {
> -				ui_browser__write_nstring(browser, " ", 2);
> -			} else {
> +			if (strcmp(dl->name, "retq") == 0 || strcmp(dl->name, "ret") == 0) {

This won't work on powerpc since we don't have a "ret" instruction.  
Returning from a function is *usually* done through some variant of a 
branch to LR (Link Register) instruction. This logic is encoded in the 
powerpc-specific ins__find() in the next patch.

That was the motivation in introducing a helper for handling return 
instructions in the tui.

- Naveen

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] perf annotate: generalize handling of ret instructions "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-06-10 15:10 +0200
  Re: [PATCH 1/2] perf annotate: generalize handling of ret  instructions Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-10 15:40 +0200
    Re: [PATCH 1/2] perf annotate: generalize handling of ret  instructions "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-06-10 16:10 +0200

csiph-web