From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753316AbbCSNUy (ORCPT ); Thu, 19 Mar 2015 09:20:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54979 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751314AbbCSNUx (ORCPT ); Thu, 19 Mar 2015 09:20:53 -0400 Date: Thu, 19 Mar 2015 09:20:48 -0400 From: Don Zickus To: David Ahern Cc: Arnaldo Carvalho de Melo , Jiri Olsa , LKML Subject: Re: perf: thread is its own parent Message-ID: <20150319132048.GB162412@redhat.com> References: <550A10B1.9080701@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <550A10B1.9080701@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 18, 2015 at 05:56:33PM -0600, David Ahern wrote: > Don: > > In this commit: > > commit 363b785f3805a2632eb09a8b430842461c21a640 > Author: Don Zickus > 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/, 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