From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757424AbdDRSx4 (ORCPT ); Tue, 18 Apr 2017 14:53:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45188 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757289AbdDRSxo (ORCPT ); Tue, 18 Apr 2017 14:53:44 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C4F29E613 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4C4F29E613 Date: Tue, 18 Apr 2017 20:53:31 +0200 From: Jiri Olsa To: Jin Yao 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 Subject: Re: [PATCH v4 4/5] perf report: Show branch type statistics for stdio mode Message-ID: <20170418185331.GC15584@krava> References: <1491949266-6835-1-git-send-email-yao.jin@linux.intel.com> <1491949266-6835-5-git-send-email-yao.jin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1491949266-6835-5-git-send-email-yao.jin@linux.intel.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 18 Apr 2017 18:53:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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