From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753156AbbEZNN2 (ORCPT ); Tue, 26 May 2015 09:13:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48855 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753313AbbEZNNQ (ORCPT ); Tue, 26 May 2015 09:13:16 -0400 Date: Tue, 26 May 2015 12:08:45 +0200 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, linux-kernel@vger.kernel.org, namhyung@kernel.org, eranian@google.com Subject: Re: Cycles annotation support for perf tools Message-ID: <20150526100845.GB6555@krava.brq.redhat.com> References: <1431265926-4766-1-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1431265926-4766-1-git-send-email-andi@firstfloor.org> 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 Sun, May 10, 2015 at 06:51:56AM -0700, Andi Kleen wrote: > The upcoming Skylake CPU has a new timed branch stack feature, > that reports cycle counts for individual branches in the > last branch record. > > This allows to get fine grained cost information for code, and also allows > to compute fine grained IPC. > > This patchkit adds support for this in the perf tools: > - Basic support for the cycles field like other branch fields > - Show cycles in the standard branch sort view (no IPC here, > as IPC needs the instruction counts from annotation) > - Annotate cycles and IPC in the assembler annotate view > - Add branch support to top, so we can do live annotation. > - Misc support, like dumping it in perf report -D > > The kernel support has been posted separately. I included a test patch > to generate fake data for testing on existing systems. > > Example output for annotate (with made up numbers): > > The second column is the IPC and third average cycles for the basic block. > > │ static int hex(char ch) ▒ > │ { ▒ > 8.20 │ push %rbp ◆ > 8.20 │ mov %rsp,%rbp ▒ > 8.20 │ sub $0x20,%rsp ▒ > 8.20 │ mov %edi,%eax ▒ > 8.20 │ mov %al,-0x14(%rbp) ▒ > 8.20 │ mov %fs:0x28,%rax ▒ > 8.20 │ mov %rax,-0x8(%rbp) ▒ > 8.20 │ xor %eax,%eax ▒ > │ if ((ch >= '0') && (ch <= '9')) ▒ > 8.20 │ cmpb $0x2f,-0x14(%rbp) ▒ > 66.67 8.20 123 │ ↓ jle 31 ▒ > 8.20 │ cmpb $0x39,-0x14(%rbp) ▒ > 8.20 123 │ ↓ jg 31 ▒ > │ return ch - '0'; ▒ > 22.22 8.20 │ movsbl -0x14(%rbp),%eax ▒ > 8.20 │ sub $0x30,%eax ▒ > 8.20 123 │ ↓ jmp 60 ▒ > │ if ((ch >= 'a') && (ch <= 'f')) ▒ > 17.57 │31: cmpb $0x60,-0x14(%rbp) ▒ > 17.57 123 │ ↓ jle 46 ▒ > 17.57 │ cmpb $0x66,-0x14(%rbp) ▒ > 17.57 │ ↓ jg 46 ▒ > │ return ch - 'a' + 10; ▒ > 17.57 │ movsbl -0x14(%rbp),%eax heya, columns are displayed fine, but the current highlighted line disappeared and also and standard annotation (without LBR) is broken.. it looks like the collor management is screwed, because keeps changing background colors all over the place when I hit arrow keys please test your patchset with standard use cases thanks, jirka