Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755968AbbGUWKx (ORCPT ); Tue, 21 Jul 2015 18:10:53 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:46833 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755199AbbGUWKw (ORCPT ); Tue, 21 Jul 2015 18:10:52 -0400 Date: Wed, 22 Jul 2015 00:10:43 +0200 From: Peter Zijlstra To: Vince Weaver Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Arnaldo Carvalho de Melo Subject: Re: perf: multiplexing broken on amd fam16h? Message-ID: <20150721221043.GA19282@twins.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3336 Lines: 63 On Tue, Jul 21, 2015 at 02:14:54PM -0400, Vince Weaver wrote: > I tried to replicate the problem using perf, but for some reason I can't > get perf to multiplex on any of my machines. That used to transparently > work didn't it? > > here's the result on the haswell machine > > perf stat -e cycles,instructions,cycles,instructions,cycles,instructions,cycles,instructions > sleep 5 > > Performance counter stats for 'sleep 5': > > 1,354,527 cycles > 1,934,694 instructions # 1.76 insns per cycle > 1,521,148 cycles > 1,934,694 instructions # 1.76 insns per cycle > 1,521,148 cycles > 1,223,321 instructions # 1.11 insns per cycle [13.61%] > cycles > instructions > > 5.003651781 seconds time elapsed This is because sleep 5 is idle, and an task that's scheduled-out doesn't have a rotation timer programmed. If you use cpu-wide events, or a busy task it works: # perf stat -ae cycles,instructions,cycles,instructions,cycles,instructions,cycles,instructions -- sleep 5 Performance counter stats for 'system wide': 15,460,117,724 cycles (62.79%) 4,276,675,617 instructions # 0.28 insns per cycle (62.77%) 15,475,455,605 cycles (62.75%) 4,284,683,187 instructions # 0.28 insns per cycle (62.74%) 15,483,305,807 cycles (62.74%) 4,286,820,811 instructions # 0.28 insns per cycle (62.63%) 15,410,655,866 cycles (62.59%) 4,257,624,307 instructions # 0.28 insns per cycle (62.60%) 5.002916366 seconds time elapsed # perf stat -e cycles,instructions,cycles,instructions,cycles,instructions,cycles,instructions -- ./spin5.sh Performance counter stats for './spin5.sh': 16,195,427,921 cycles (62.45%) 35,544,317,856 instructions # 2.20 insns per cycle (62.43%) 16,181,167,756 cycles (62.49%) 35,484,446,997 instructions # 2.19 insns per cycle (62.54%) 16,167,563,501 cycles (62.58%) 35,486,346,040 instructions # 2.19 insns per cycle (62.57%) 16,177,845,357 cycles (62.56%) 35,532,260,091 instructions # 2.20 insns per cycle (62.48%) 5.009328353 seconds time elapsed -- 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/