From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751894AbcDOLKk (ORCPT ); Fri, 15 Apr 2016 07:10:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60177 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbcDOLKC (ORCPT ); Fri, 15 Apr 2016 07:10:02 -0400 Subject: Re: ping Re: [PATCH] perf script: Add stackcollapse.py script To: Jiri Olsa References: <1460467573-22989-1-git-send-email-pbonzini@redhat.com> <57107A30.7090809@redhat.com> <20160415105739.GA8595@krava.redhat.com> Cc: linux-kernel@vger.kernel.org, Jiri Olsa , Arnaldo Carvalho de Melo , Brendan Gregg From: Paolo Bonzini Message-ID: <5710CC02.9020303@redhat.com> Date: Fri, 15 Apr 2016 13:09:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160415105739.GA8595@krava.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 15 Apr 2016 11:10:02 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/04/2016 12:57, Jiri Olsa wrote: >>> > > +# Input may be created and processed using: >>> > > +# >>> > > +# perf record -a -g -F 99 sleep 60 >>> > > +# perf script report stackcollapse > out.stacks-folded >>> > > +# >>> > > +# (perf script record stackcollapse works too). > IIRC Namhyung added -g folded option recently for report > so you could do: > > perf report -g folded --stdio > > however we dont seem to have it for perf script, so this might > be useful until we add the --call-graph support into perf script Thanks for the pointer. I think the output of "perf script -g folded" would still be a bit different from what the flamegraph tool expects. Something like perf 13675 51165.817380: 1921 cycles:pp: native_write_cr2; do_nmi; end_repeat_nmi; ... rather than this perf;native_write_cr2;do_nmi;end_repeat_nmi;... 1921 which this script produces. The format that flamegraph expects is very simple so that they can have converters for perf, stap, dtrace and others. I'd be just as happy if perf looked for scripts into $HOME/.local. :) But since it doesn't, this script can also be useful to demonstrate script access to callchains. Thanks, Paolo