All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taeung Song <taeung@kosslab.kr>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Wang Nan <wangnan0@huawei.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>, Martin Liska <mliska@suse.cz>
Subject: Re: [PATCH v4] perf annotate: Fix missing number of samples for source_line_samples
Date: Wed, 29 Mar 2017 17:53:42 +0900	[thread overview]
Message-ID: <f4fd425d-22b7-4898-8592-e727147cbc4d@kosslab.kr> (raw)
In-Reply-To: <ffeb5567-dc30-ac99-50f0-686a3ebb64a0@gmail.com>

Arnaldo,

I think we had a little communication problem.
So would you mind if I finally sum up this situation ?

Currently there are the two calculation setting for 'number of samples'.
(At util/annotate.c, not TUI code ui/browsers/annotate.c)

   A) disasm__calc_percent() -> util/annotate.c:881~
   B) symbol__get_source_line() -> util/annotate.c:1634~

If testing them as the three cases,

   1) $ perf annotate --stdio -l --show-total-period
   2) $ perf annotate --stdio --show-total-period
   3) $ perf annotate # using 'k' on TUI

The result is,

   1) NG
   2) OK
   3) OK

The problem of '1)' is to just show '0' zero values for number of samples.
Because 'B)' has a bug missing 'nr' of source_line_samples.
So I fix it.

   the case '1)' uses 'B)' and 'A)'
   the case '2)' uses only 'A)'
   the case '3)' uses only 'A)'

I read and analyzed all about 'number of samples' of perf-anntoate.
with the cset 0c4a5bcea460 you gave me.
This is my conclusion. What do you think about it ?


Thanks,
Taeung


NOTE: 'A)'(i.e. disasm__calc_percent()) has two alternative logic
when using '-l' option or not as below.

  888         if (src_line) {
                      ...
  903         } else {
                      ...
  914         }


On 03/29/2017 01:15 AM, Taeung Song wrote:
>
>
> On 03/29/2017 12:28 AM, Arnaldo Carvalho de Melo wrote:
>> Em Tue, Mar 28, 2017 at 11:21:33PM +0900, Taeung Song escreveu:
>>>
>>>
>>> On 03/28/2017 10:48 PM, Arnaldo Carvalho de Melo wrote:
>>>> Em Tue, Mar 28, 2017 at 09:12:05PM +0900, Taeung Song escreveu:
>>>>> The option 'show-total-period' works fine without a option '-l'.
>>>>> But if running 'perf annotate --stdio -l --show-total-period',
>>>>> you can see a problem showing only zero '0' for number of samples.
>>>>
>>>> If you do that at that point, don't you have to change the TUI not
>>>> to do
>>>> it again?
>>>>
>>>> - Arnaldo
>>>>
>>>
>>> Yes, there isn't the same problem when using 't' on TUI of 'perf
>>> annotate'.
>>> (As you know, 't' is show-total-period option)
>>
>> Yeah, there is no problem on the TUI, but since you do it in a function
>> taht the TUI uses, it may not be needed to do this in
>
> No, TUI don't use the function I modified in this patch at all.
> (i.e. symbol__get_source_line())
>
> Only symbol__tty_annotate() use symbol__get_source_line().
>
> (As you know, annotate TUI use symbol__tui_annotate() )
>
>> tools/perf/util/annotate.c _and_ in tools/perf/ui/browsers/annotate.c,
>> right?
>>
>> - Arnaldo
>
>
> Are there something I missed or misunderstand ?
>
> Thanks,
> Taeung
>

SNIP

  reply	other threads:[~2017-03-29  8:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 12:12 [PATCH v4] perf annotate: Fix missing number of samples for source_line_samples Taeung Song
2017-03-28 13:48 ` Arnaldo Carvalho de Melo
2017-03-28 14:21   ` Taeung Song
2017-03-28 14:26     ` Taeung Song
2017-03-28 15:28     ` Arnaldo Carvalho de Melo
2017-03-28 16:15       ` Taeung Song
2017-03-29  8:53         ` Taeung Song [this message]
2017-04-05  5:52 ` [tip:perf/core] " tip-bot for 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=f4fd425d-22b7-4898-8592-e727147cbc4d@kosslab.kr \
    --to=taeung@kosslab.kr \
    --cc=arnaldo.melo@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=mliska@suse.cz \
    --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.