Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758833Ab1ENUYv (ORCPT ); Sat, 14 May 2011 16:24:51 -0400 Received: from mail-qy0-f181.google.com ([209.85.216.181]:45472 "EHLO mail-qy0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754152Ab1ENUYu convert rfc822-to-8bit (ORCPT ); Sat, 14 May 2011 16:24:50 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=i9eE+rK5XUb7XtV5l/+RGC/CjE8heBK2By8bAHSlhbakRafBWwLf6ZEQ9gj2KLnAfd OwAesApJnDZtn3/GRo5RHxOrd93sK1rbnJzvD65GJu0yxxCraG8GrCLLtYJjGU74pHHl IhU18VgMYh5wP52UxAU3re4kOYco1JEcQRBhk= MIME-Version: 1.0 In-Reply-To: References: <4DCD4FC5.8020608@gmail.com> <20110513154410.GA6373@elte.hu> <20110513204530.GF8950@ghostprotocols.net> From: Wim Heirman Date: Sat, 14 May 2011 22:24:27 +0200 X-Google-Sender-Auth: nv7zDou4tIsrwtpnSjVhJd-fteA Message-ID: Subject: Re: perf-stat per thread results To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , David Ahern , linux-kernel@vger.kernel.org, Peter Zijlstra , Thomas Gleixner , =?ISO-8859-1?Q?Fr=E9d=E9ric_Weisbecker?= , Brice Goglin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2379 Lines: 60 On 14 May 2011 14:45, Wim Heirman wrote: > On 13 May 2011 22:45, Arnaldo Carvalho de Melo wrote: >> Em Fri, May 13, 2011 at 10:32:58PM +0200, Wim Heirman escreveu: >>> > It's supposed to do that if --stat is specified, and it used to work - see this >>> > commit: >> >>> > ?8d51327090ac: perf report: Fix and improve the displaying of per-thread event counters >> >>> > and the output there: >>> > >>> > ? ? # ?PID ? TID ?cache-misses ?cache-references >>> > ? ? ? 4658 ?4659 ? ? ? ?495581 ? ? ? ? ? 3238779 >>> > ? ? ? 4658 ?4662 ? ? ? ?498246 ? ? ? ? ? 3236823 >>> > ? ? ? 4658 ?4663 ? ? ? ?499531 ? ? ? ? ? 3243162 >> >>> > which appears to be roughly what Wim is asking for, AFAICT. >> >>> Thanks, this is exactly what I'm looking for. In 2.6.32 (Ubuntu 10.04) >>> it works, although if I use --pid rather than the -- variant >>> the first thread seams to be missing. In 2.6.38 (Ubuntu 11.04) the >>> first thread is missing in both use cases, and I get one column per >>> processor (which in itself is fine). >> >> Can you try after applying the patches in this message: >> >> http://marc.info/?l=linux-kernel&m=130385067430510&w=2 >> >> and report your results? > > Sorry, no improvement. > > $ ./perf record -e cycles --stat -- ./fft -p4 -m24 && ./perf report > --thread | tail > [ perf record: Woken up 5 times to write data ] > [ perf record: Captured and wrote 1.198 MB perf.data (~52331 samples) ] > # PID ?TID ? cpu-clock > ?954 ?958 ?8067423322 > ?954 ?957 ?6761317556 > ?954 ?956 ?6006327147 > > $ ls /proc/$(pidof fft)/task > 954 ?956 ?957 ?958 Looks like perf-report --thread is reading PERF_RECORD_READ events from perf.data. But these are only emitted by the kernel for child threads: in kernel/events/core.c, the only call to perf_event_read_event() is in sync_child_event(). Should perf-record then be adapted to do something like perf-stat does and use __perf_evsel__read to read the parent counter's final values and add them to perf.data ? That way perf-report can subtract all children from the final value and get the main thread's counter values. Regards, Wim -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/