From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027AbdGGOvS (ORCPT ); Fri, 7 Jul 2017 10:51:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:60732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbdGGOvQ (ORCPT ); Fri, 7 Jul 2017 10:51:16 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 598EE219AA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Fri, 7 Jul 2017 11:51:11 -0300 From: Arnaldo Carvalho de Melo To: Jin Yao Cc: Jiri Olsa , peterz@infradead.org, Ingo Molnar , alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com Subject: Re: [PATCH v4 2/2] perf report: Implement visual marker for macro fusion in annotate Message-ID: <20170707145111.GS27350@kernel.org> References: <1499403995-19857-1-git-send-email-yao.jin@linux.intel.com> <1499403995-19857-3-git-send-email-yao.jin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1499403995-19857-3-git-send-email-yao.jin@linux.intel.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jul 07, 2017 at 01:06:35PM +0800, Jin Yao escreveu: > For marking the fused instructions clearly, This patch adds a line > before the first instruction of pair and joins it with the arrow of the > jump. > > For example, when je is selected in annotate view, the line before cmpl > is displayed and joins the arrow of je. > > │ ┌──cmpl $0x0,argp_program_version_hook > 81.93 │ ├──je 20 > │ │ lock cmpxchg %esi,0x38a9a4(%rip) > │ │↓ jne 29 > │ │↓ jmp 43 > 11.47 │20:└─→cmpxch %esi,0x38a999(%rip) > > That means the cmpl+je is fused instruction pair and they should be > considered together. I applied this one, no unnecessary parsing of cpuid done at each jump->target arrow rendering, much better, thanks! One thing for a follow up patch: We have this when the cursor is at a jump instruction: │ ┌──test %ecx,%ecx -> │ ├──je 714cf │ │ mov LINES+0xb40,%edx │ │ test %edx,%edx │ │↓ je 71580 │714cf:└─→mov LINES+0x10c8,%eax But if we go up a line, to that "test" instruction, we get: -> │ test %ecx,%ecx │ ↓ je 714cf │ mov LINES+0xb40,%edx │ test %edx,%edx │ ↓ je 71580 │714cf: mov LINES+0x10c8,%eax I suggest that this be changed to: -> │ ┌─test %ecx,%ecx │ ↓ je 714cf │ mov LINES+0xb40,%edx │ test %edx,%edx │ ↓ je 71580 │714cf: mov LINES+0x10c8,%eax I.e. even before going to the jump instruction line with the cursor, we would see the fused instructions. To do that perhaps we should improve annotate_browser__draw_current_jump to improve that part that looks for is_valid_jump() to consider instructions that could be fused with jumps for the machine where the perf data came from, etc. But the current situation is better already, thanks for your work, applied! - Arnaldo