linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung.kim@lge.com>
To: Arun Sharma <asharma@fb.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>,
	Tom Zanussi <tzanussi@gmail.com>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 0/2] perf: add sort by inclusive time functionality (v2)
Date: Tue, 13 Mar 2012 10:11:18 +0900	[thread overview]
Message-ID: <4F5E9EB6.6050302@lge.com> (raw)
In-Reply-To: <4F5E3ADC.5090200@fb.com>

2012-03-13 3:05 AM, Arun Sharma wrote:
> On 3/12/12 12:15 AM, Namhyung Kim wrote:
>> I think it's because of the shared hist_entry. If a callchain is a
>> subset of another, it will be marked as inclusive so that it cannot be
>> contributed to total period. Say, there're two chains - X (a -> b -> c)
>> and Y (a -> b), once __hists__add_entry_inclusive() was called on X, we
>> have:
>>
>> a -> b -> c
>> a -> b (inclusive)
>> a (inclusive)
>>
>> And then, calling the function on Y should make:
>>
>> a -> b
>> a (inclusive)
>>
>> However, since both callchains are in tree already they'll be shared and
>> marked *inclusive*. Thus the total period will not increased at all for
>> Y. Also I guess the reverse case - add Y first, and then X - will have
>> the same result.
>
> Thanks for figuring this out. Looks like using a single bit (he->inclusive) is
> insufficient. How about:
>
> struct hist_entry {
> 	u64 	period;
> 	u64 	period_self;
> 	..
> };
>
> Normal mode: period_self == period.
> Inclusive mode: period_self will be zero for inclusive hist_entries.
> Shared entries: we sum up both period and period_self.
>
> We can then compute total_period by summing up period_self.
>

Yeah, I agree that we need that kind of code to handle total_period properly. 
Looking forward to your v3 :).

Thanks,
Namhyung

  reply	other threads:[~2012-03-13  1:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 22:41 [PATCH 0/2] perf: add sort by inclusive time functionality (v2) Arun Sharma
2012-03-07 22:41 ` [PATCH 1/2] perf: refactor add_hist_entry() code paths Arun Sharma
2012-03-07 22:41 ` [PATCH 2/2] perf: Add a new sort order: SORT_INCLUSIVE Arun Sharma
2012-03-07 23:13   ` Arun Sharma
2012-03-08  7:22   ` Ingo Molnar
2012-03-12 19:35     ` Arun Sharma
2012-03-08 15:39   ` Frederic Weisbecker
2012-03-08 18:22     ` Arun Sharma
2012-03-13 13:44       ` Frederic Weisbecker
2012-03-08  7:29 ` [PATCH 0/2] perf: add sort by inclusive time functionality (v2) Ingo Molnar
2012-03-08 15:31   ` Frederic Weisbecker
2012-03-08 18:49     ` Arun Sharma
2012-03-12  7:15       ` Namhyung Kim
2012-03-12 18:05         ` Arun Sharma
2012-03-13  1:11           ` Namhyung Kim [this message]
2012-03-12  7:43 ` Namhyung Kim
2012-03-12 18:21   ` Arun Sharma
2012-03-12 19:58     ` Arun Sharma
2012-03-13  1:36       ` Namhyung Kim
2012-03-15 14:50         ` Frederic Weisbecker
2012-03-15 17:41           ` Arun Sharma
2012-03-13  1:16     ` Namhyung Kim
2012-03-13 18:45       ` Arun Sharma

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=4F5E9EB6.6050302@lge.com \
    --to=namhyung.kim@lge.com \
    --cc=acme@redhat.com \
    --cc=asharma@fb.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tzanussi@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).