From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752020AbdGMMdS (ORCPT ); Thu, 13 Jul 2017 08:33:18 -0400 Received: from mga05.intel.com ([192.55.52.43]:55600 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbdGMMdR (ORCPT ); Thu, 13 Jul 2017 08:33:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,354,1496127600"; d="scan'208";a="1194942979" Subject: Re: [PATCH v8 1/7] perf/core: Define the common branch type classification To: Michael Ellerman , acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com Cc: Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com References: <1499947459-4527-1-git-send-email-yao.jin@linux.intel.com> <1499947459-4527-2-git-send-email-yao.jin@linux.intel.com> <87fue0k0gd.fsf@concordia.ellerman.id.au> From: "Jin, Yao" Message-ID: <2a4934ab-4add-46b8-49da-83bbb5ecce93@linux.intel.com> Date: Thu, 13 Jul 2017 20:33:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <87fue0k0gd.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sure, thanks so much! On 7/13/2017 8:04 PM, Michael Ellerman wrote: > Jin Yao writes: > >> It is often useful to know the branch types while analyzing branch >> data. For example, a call is very different from a conditional branch. >> >> Currently we have to look it up in binary while the binary may later >> not be available and even the binary is available but user has to take >> some time. It is very useful for user to check it directly in perf >> report. >> >> Perf already has support for disassembling the branch instruction >> to get the x86 branch type. >> >> To keep consistent on kernel and userspace and make the classification >> more common, the patch adds the common branch type classification >> in perf_event.h. >> >> The patch only defines a minimum but most common set of branch types. >> >> PERF_BR_UNKNOWN : unknown >> PERF_BR_COND :conditional >> PERF_BR_UNCOND : unconditional >> PERF_BR_IND : indirect >> PERF_BR_CALL : function call >> PERF_BR_IND_CALL : indirect function call >> PERF_BR_RET : function return >> PERF_BR_SYSCALL : syscall >> PERF_BR_SYSRET : syscall return >> PERF_BR_COND_CALL : conditional function call >> PERF_BR_COND_RET : conditional function return >> >> The patch also adds a new field type (4 bits) in perf_branch_entry >> to record the branch type. >> >> Since the disassembling of branch instruction needs some overhead, >> a new PERF_SAMPLE_BRANCH_TYPE_SAVE is introduced to indicate if it >> needs to disassemble the branch instruction and record the branch >> type. > Acked-by: Michael Ellerman (powerpc) > > If you like. > > cheers