From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751417AbdDSELz (ORCPT ); Wed, 19 Apr 2017 00:11:55 -0400 Received: from mga07.intel.com ([134.134.136.100]:3267 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750791AbdDSELx (ORCPT ); Wed, 19 Apr 2017 00:11:53 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,219,1488873600"; d="scan'208";a="91530473" Subject: Re: [PATCH v4 4/5] perf report: Show branch type statistics for stdio mode From: "Jin, Yao" To: Jiri Olsa Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, linuxppc-dev@lists.ozlabs.org References: <1491949266-6835-1-git-send-email-yao.jin@linux.intel.com> <1491949266-6835-5-git-send-email-yao.jin@linux.intel.com> <20170418185331.GC15584@krava> <2cc8fa33-f0f8-d202-f663-d3b6cfef43d0@linux.intel.com> Message-ID: <8a75c7ac-5802-7e45-08d2-a83ec2e05f8e@linux.intel.com> Date: Wed, 19 Apr 2017 12:11:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <2cc8fa33-f0f8-d202-f663-d3b6cfef43d0@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/19/2017 8:53 AM, Jin, Yao wrote: > > > On 4/19/2017 2:53 AM, Jiri Olsa wrote: >> On Wed, Apr 12, 2017 at 06:21:05AM +0800, Jin Yao wrote: >> >> SNIP >> >>> +const char *branch_type_name(int type) >>> +{ >>> + const char *branch_names[PERF_BR_MAX] = { >>> + "N/A", >>> + "JCC", >>> + "JMP", >>> + "IND_JMP", >>> + "CALL", >>> + "IND_CALL", >>> + "RET", >>> + "SYSCALL", >>> + "SYSRET", >>> + "IRQ", >>> + "INT", >>> + "IRET", >>> + "FAR_BRANCH", >>> + }; >>> + >>> + if ((type >= 0) && (type < PERF_BR_MAX)) >>> + return branch_names[type]; >>> + >>> + return NULL; >> looks like we should add util/branch.c with above functions >> and merge it with util/parse-branch-options.c >> >> we create new file even for less code ;-) >> >> thanks, >> jirka > > Could we directly add branch_type_name() in util/parse-branch-options.c? > > I just feel it's a bit waste of creating a new file for less code. :) > > Thanks > Jin Yao After considering again, yes, creating util/branch.c should be better. I will do that. Thanks Jin Yao