All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taeung Song <treeze.taeung@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
	Ingo Molnar <mingo@kernel.org>, Wang Nan <wangnan0@huawei.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>,
	kernel-team@lge.com
Subject: Re: [PATCH v2 2/3] perf annotate: Introduce the new source code view
Date: Thu, 2 Mar 2017 00:52:48 +0900	[thread overview]
Message-ID: <677243ef-4ddf-6d65-8a95-45da915d4e5d@gmail.com> (raw)
In-Reply-To: <20170301150746.GJ6515@twins.programming.kicks-ass.net>

Hi, Peter

On 03/02/2017 12:07 AM, Peter Zijlstra wrote:
> On Wed, Mar 01, 2017 at 11:56:39PM +0900, Namhyung Kim wrote:
>
>> It's a kind of user experience issue.  We provide the asm-only and
>> asm+source annotation, and I think it'd be nice to add source-only
>> option.  And I remember that it was requested some time ago..
>
> Thing is, an optimizing compiler -- that same beast that ensures your
> objdump -S output is such a garbled mess -- can generate code that
> becomes very hard to relate to the original source code.
>
> I'm really sceptical the source line only view is very useful; maybe if
> you build with -O0, but then, if you do that you're not bothered with
> performance.
>

I think there is a fundamental difference between the two points of view.

   1) Based on assembly code view, we can show parts of actual source code.
   2) Based on source code view, we can show parts of assembly code for 
a particular source code line.

I think current compilers have some limitations about the optimization.
what they can't optimize is the logic or process.
So, many developers should optimize the logic or process.
And to do that, I think we need to the source code view with overhead.

And I think we can show asm lines for a particular in the source view,
when the user press ENTER key at a source code line.

For example,
If a current line is line 47 and
the user press ENTER key, we can show asm per the source code line.

            │46   void pack_knapsack(struct jewelry *jewelry)
            │47   {
            │      push   %rbp
            │      mov    %rsp,%rbp
            │      sub    $0x18,%rsp
            │      mov    %rdi,-0x18(%rbp)
            │48      /* Case by case pack knapsack following maximum
...

And I think we don't need to only show actual source code.
But we can show assembly code based on source code view.

Thanks,
Taeung

  reply	other threads:[~2017-03-01 15:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28 19:59 [PATCH v2 0/3] perf annotate: Introduce the new source code view Taeung Song
2017-02-28 19:59 ` [PATCH v2 1/3] perf annotate: Get correct line numbers matched with addr Taeung Song
2017-03-01 13:17   ` Namhyung Kim
2017-03-02  6:05     ` Taeung Song
2017-03-03  2:40       ` Namhyung Kim
2017-03-03  3:25         ` Taeung Song
2017-02-28 19:59 ` [PATCH v2 2/3] perf annotate: Introduce the new source code view Taeung Song
2017-03-01 13:58   ` Namhyung Kim
2017-03-01 14:08     ` Peter Zijlstra
2017-03-01 14:21       ` Namhyung Kim
2017-03-01 14:30         ` Peter Zijlstra
2017-03-01 14:56           ` Namhyung Kim
2017-03-01 15:07             ` Peter Zijlstra
2017-03-01 15:52               ` Taeung Song [this message]
2017-03-03  5:09               ` Namhyung Kim
2017-02-28 19:59 ` [PATCH v2 3/3] perf annotate: Support the new source code view for TUI Taeung Song

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=677243ef-4ddf-6d65-8a95-45da915d4e5d@gmail.com \
    --to=treeze.taeung@gmail.com \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kernel-team@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=wangnan0@huawei.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.