linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf: thread is its own parent
@ 2015-03-18 23:56 David Ahern
  2015-03-19 13:20 ` Don Zickus
  0 siblings, 1 reply; 4+ messages in thread
From: David Ahern @ 2015-03-18 23:56 UTC (permalink / raw)
  To: Don Zickus, Arnaldo Carvalho de Melo, Jiri Olsa, LKML

Don:

In this commit:

commit 363b785f3805a2632eb09a8b430842461c21a640
Author: Don Zickus <dzickus@redhat.com>
Date:   Fri Mar 14 10:43:44 2014 -0400

     perf tools: Speed up thread map generation

you made a thread its own parent when synthesizing fork events:

static int perf_event__synthesize_fork(struct perf_tool *tool,
                                        union perf_event *event, pid_t pid,
                                        pid_t tgid, 
perf_event__handler_t process,
                                        struct machine *machine)
{
         memset(&event->fork, 0, sizeof(event->fork) + 
machine->id_hdr_size);

         event->fork.ppid = tgid;
         event->fork.ptid = tgid;
         event->fork.pid  = tgid;
         event->fork.tid  = pid;
         event->fork.header.type = PERF_RECORD_FORK;


Any particular reason or just an oversight?

David

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: perf: thread is its own parent
  2015-03-18 23:56 perf: thread is its own parent David Ahern
@ 2015-03-19 13:20 ` Don Zickus
  2015-03-19 13:56   ` David Ahern
  0 siblings, 1 reply; 4+ messages in thread
From: Don Zickus @ 2015-03-19 13:20 UTC (permalink / raw)
  To: David Ahern; +Cc: Arnaldo Carvalho de Melo, Jiri Olsa, LKML

On Wed, Mar 18, 2015 at 05:56:33PM -0600, David Ahern wrote:
> Don:
> 
> In this commit:
> 
> commit 363b785f3805a2632eb09a8b430842461c21a640
> Author: Don Zickus <dzickus@redhat.com>
> Date:   Fri Mar 14 10:43:44 2014 -0400
> 
>     perf tools: Speed up thread map generation
> 
> you made a thread its own parent when synthesizing fork events:
> 
> static int perf_event__synthesize_fork(struct perf_tool *tool,
>                                        union perf_event *event, pid_t pid,
>                                        pid_t tgid,
> perf_event__handler_t process,
>                                        struct machine *machine)
> {
>         memset(&event->fork, 0, sizeof(event->fork) +
> machine->id_hdr_size);
> 
>         event->fork.ppid = tgid;
>         event->fork.ptid = tgid;
>         event->fork.pid  = tgid;
>         event->fork.tid  = pid;
>         event->fork.header.type = PERF_RECORD_FORK;
> 
> 
> Any particular reason or just an oversight?

Hi David,

Honestly I don't recall.   The commit log tells you the problem I was trying
to solve.  Instead of parsing text strings from /proc/maps/<pid>, I believe
it was waaaay faster to copy the thread maps.

This could have been an oversight.  I might have falsely assumed tgid ==
ppid?

Are you finding a problem with it?

Cheers,
Don

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: perf: thread is its own parent
  2015-03-19 13:20 ` Don Zickus
@ 2015-03-19 13:56   ` David Ahern
  2015-03-19 14:27     ` Don Zickus
  0 siblings, 1 reply; 4+ messages in thread
From: David Ahern @ 2015-03-19 13:56 UTC (permalink / raw)
  To: Don Zickus; +Cc: Arnaldo Carvalho de Melo, Jiri Olsa, LKML

On 3/19/15 7:20 AM, Don Zickus wrote:
> Honestly I don't recall.   The commit log tells you the problem I was trying
> to solve.  Instead of parsing text strings from/proc/maps/<pid>, I believe
> it was waaaay faster to copy the thread maps.
>
> This could have been an oversight.  I might have falsely assumed tgid ==
> ppid?
>
> Are you finding a problem with it?


rebasing my scheduling timehist command to 4.0 and this change breaks 
one of the options. If there are no objections I'll send a patch along 
with others to set ptid and ppid to -1 (that's what it is in 3.12).

Thanks,
David

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: perf: thread is its own parent
  2015-03-19 13:56   ` David Ahern
@ 2015-03-19 14:27     ` Don Zickus
  0 siblings, 0 replies; 4+ messages in thread
From: Don Zickus @ 2015-03-19 14:27 UTC (permalink / raw)
  To: David Ahern; +Cc: Arnaldo Carvalho de Melo, Jiri Olsa, LKML

On Thu, Mar 19, 2015 at 07:56:32AM -0600, David Ahern wrote:
> On 3/19/15 7:20 AM, Don Zickus wrote:
> >Honestly I don't recall.   The commit log tells you the problem I was trying
> >to solve.  Instead of parsing text strings from/proc/maps/<pid>, I believe
> >it was waaaay faster to copy the thread maps.
> >
> >This could have been an oversight.  I might have falsely assumed tgid ==
> >ppid?
> >
> >Are you finding a problem with it?
> 
> 
> rebasing my scheduling timehist command to 4.0 and this change
> breaks one of the options. If there are no objections I'll send a
> patch along with others to set ptid and ppid to -1 (that's what it
> is in 3.12).

Hmm, I wonder if this is going to break our threading example.  Perhaps not,
now that Jiri made some other changes later.  Feel free to post a patch, cc
me please.  I will patch our perf over here and have Joe Mario run some
tests to see if we lose any data or not and let you know.

Cheers,
Don

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-19 14:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-18 23:56 perf: thread is its own parent David Ahern
2015-03-19 13:20 ` Don Zickus
2015-03-19 13:56   ` David Ahern
2015-03-19 14:27     ` Don Zickus

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).