From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754305AbbHXUUq (ORCPT ); Mon, 24 Aug 2015 16:20:46 -0400 Received: from mail.kernel.org ([198.145.29.136]:34569 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbbHXUUo (ORCPT ); Mon, 24 Aug 2015 16:20:44 -0400 Date: Mon, 24 Aug 2015 17:20:40 -0300 From: Arnaldo Carvalho de Melo To: Adrian Hunter Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Jiri Olsa Subject: Re: [PATCH V8 10/25] perf tools: Add example call-graph script Message-ID: <20150824202040.GE19203@kernel.org> References: <1437150840-31811-1-git-send-email-adrian.hunter@intel.com> <1437150840-31811-11-git-send-email-adrian.hunter@intel.com> <20150821150013.GB30343@kernel.org> <20150821151133.GC30343@kernel.org> <20150821152125.GD30343@kernel.org> <20150821152813.GE30343@kernel.org> <55DAC101.5090007@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55DAC101.5090007@intel.com> X-Url: http://acmel.wordpress.com 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 Em Mon, Aug 24, 2015 at 10:00:17AM +0300, Adrian Hunter escreveu: > On 21/08/15 18:28, Arnaldo Carvalho de Melo wrote: > > Em Fri, Aug 21, 2015 at 12:21:25PM -0300, Arnaldo Carvalho de Melo escreveu: > >> Em Fri, Aug 21, 2015 at 12:11:33PM -0300, Arnaldo Carvalho de Melo escreveu: > >>> [acme@zoo ~]$ perf script -s ~/libexec/perf-core/scripts/python/export-to-postgresql.py bts_example branches calls > >>> 2015-08-21 12:10:00.504126 Creating database... > >>> QSqlDatabase: QPSQL driver not loaded > >>> QSqlDatabase: available drivers: QSQLITE > >>> QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins > >>> QSqlQuery::exec: database not open > >>> Traceback (most recent call last): > >>> File "/home/acme/libexec/perf-core/scripts/python/export-to-postgresql.py", line 87, in > >>> do_query(query, 'CREATE DATABASE ' + dbname) > >>> File "/home/acme/libexec/perf-core/scripts/python/export-to-postgresql.py", line 78, in do_query > >>> raise Exception("Query failed: " + q.lastError().text()) > >>> Exception: Query failed: Driver not loaded Driver not loaded > >>> Error running python script /home/acme/libexec/perf-core/scripts/python/export-to-postgresql.py > >>> [acme@zoo ~]$ > >> > >> A-ha, this was missing: > >> > >> [root@zoo ~]# rpm -ql qt-postgresql > >> /usr/lib64/qt4/plugins/sqldrivers/libqsqlpsql.so > >> [root@zoo ~]# > >> > >> [acme@zoo ~]$ perf script -s ~/libexec/perf-core/scripts/python/export-to-postgresql.py bts_example branches calls > >> 2015-08-21 12:20:01.841677 Creating database... > >> 2015-08-21 12:20:02.556853 Writing to intermediate files... > >> 2015-08-21 12:20:03.262814 Copying to database... > >> 2015-08-21 12:20:03.783109 Removing intermediate files... > >> 2015-08-21 12:20:03.790282 Adding primary keys > >> 2015-08-21 12:20:04.294342 Adding foreign keys > >> 2015-08-21 12:20:04.718238 Done > >> [acme@zoo ~]$ > >> > >> Now to the next steps... Lets see how this looks like with BTS... > > > > So, after running: > > > > [acme@zoo linux]$ python > > tools/perf/scripts/python/call-graph-from-postgresql.py bts_example > > > > I got a GUI and after expanding some callchains I took this screenshot: > > > > http://vger.kernel.org/~acme/perf/call_graph_example_intel_bts.png > > > > Cool stuff! But it seems the COMM got messed up? I.e. that "1380:1380" > > first level after "ls". > > That is, in fact, correct. The top-level is the process (comm). The next > level is the threads (pid/tid) for that process. Currently, each thread is > reported separately. Ok, understood. > For the future, there ought to be an option to combine the data for all > threads of a process, or all processes with the same comm. Also presently > it is not tracking if a thread sets it's own comm (e.g. some multi-threaded > applications name each thread). And in that case it would be nice to have both the comms and pid/tid. - Arnaldo