From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751375AbbESTzG (ORCPT ); Tue, 19 May 2015 15:55:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59173 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750837AbbESTzE (ORCPT ); Tue, 19 May 2015 15:55:04 -0400 Date: Tue, 19 May 2015 21:49:03 +0200 From: Jiri Olsa To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , LKML , David Ahern , Adrian Hunter , Andi Kleen , Frederic Weisbecker , Stephane Eranian Subject: Re: [PATCH 35/40] perf record: Synthesize COMM event for a command line workload Message-ID: <20150519191826.GA26714@krava.redhat.com> References: <1431909055-21442-1-git-send-email-namhyung@kernel.org> <1431909055-21442-36-git-send-email-namhyung@kernel.org> <20150518124535.GD15972@kernel.org> <20150519074643.GM21663@sejong> <20150519140220.GH13946@kernel.org> <20150519151245.GC29162@danjae.kornet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150519151245.GC29162@danjae.kornet> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 20, 2015 at 12:12:45AM +0900, Namhyung Kim wrote: SNIP > > > > > > > > This looks reasonable, but I think it probably needs to be done > > > > somewhere in perf_evlist__prepare_workload() or > > > > perf_evlist__start_workload(), as this affects other tools as well, like > > > > 'top', 'trace' and any other that may want to do this start-workload use > > > > case. > > > > > > Hmm.. I need to look at this again as it only affects on processing > > > indexed data files which used to have a separate missing threads tree. > > > > Humm, you're thinking about where you managed to reproduce the problem, > > I am thinking outside indexing, etc, i.e. by definition we either enable > > the event before we fork, so that we get the PERF_RECORD_FORK/COMM or we > > synthesize it either from /proc or directly (preferred) if we decide to > > do it after the fork/exec, right? > > But as I said before, later COMM event will override thread->comm to a > proper string as long as it can find a matching thread. So I think it > has no problem in the current code. I can see the issue in the current script code and the patch cured it ;-) before: [jolsa@krava perf]$ ./perf record -o - true | ./perf script [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] :29236 29236 350869.479255: 1 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy :29236 29236 350869.479260: 1 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy :29236 29236 350869.479261: 7 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy :29236 29236 350869.479263: 122 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy :29236 29236 350869.479264: 2303 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy :29236 29236 350869.479266: 49582 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy true 29236 350869.479283: 1041734 cycles: ffffffff81190a4a perf_output_begin ([kernel.kallsyms]) after: [jolsa@krava perf]$ ./perf record -o - true | ./perf script [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] perf 28041 350801.438466: 1 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy perf 28041 350801.438471: 1 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy perf 28041 350801.438472: 7 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy perf 28041 350801.438473: 140 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy perf 28041 350801.438475: 3721 cycles: ffffffff8105e8aa native_write_msr_safe ([kernel.kallsy perf 28041 350801.438476: 94744 cycles: ffffffff8118e270 perf_event_comm ([kernel.kallsyms]) true 28041 350801.438508: 1604677 cycles: ffffffff811d0781 do_mmap_pgoff ([kernel.kallsyms]) jirka