From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940535AbdDTAhP (ORCPT ); Wed, 19 Apr 2017 20:37:15 -0400 Received: from mga02.intel.com ([134.134.136.20]:57460 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S939210AbdDTAhB (ORCPT ); Wed, 19 Apr 2017 20:37:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,222,1488873600"; d="scan'208";a="91580659" Subject: Re: [PATCH v5 7/7] perf report: Show branch type in callchain entry 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: <1492616894-3635-1-git-send-email-yao.jin@linux.intel.com> <1492616894-3635-8-git-send-email-yao.jin@linux.intel.com> <20170419141510.GA19643@krava> From: "Jin, Yao" Message-ID: <1757edc6-4737-e30f-bd5d-3d1334c5b9b7@linux.intel.com> Date: Thu, 20 Apr 2017 08:36:57 +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: <20170419141510.GA19643@krava> 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 10:15 PM, Jiri Olsa wrote: > On Wed, Apr 19, 2017 at 11:48:14PM +0800, Jin Yao wrote: > > SNIP > >> +static int branch_type_str(struct branch_type_stat *stat, >> + char *bf, int bfsize) >> +{ >> + int i, j = 0, printed = 0; >> + u64 total = 0; >> + >> + for (i = 0; i < PERF_BR_MAX; i++) >> + total += stat->counts[i]; >> + >> + if (total == 0) >> + return 0; >> + >> + if (stat->jcc_fwd > 0) >> + printed += count_str_printf(j++, "JCC forward", >> + bf + printed, bfsize - printed); >> + >> + if (stat->jcc_bwd > 0) >> + printed += count_str_printf(j++, "JCC backward", >> + bf + printed, bfsize - printed); > please move that multiline conditional code inside {} brackets > > thanks, > jirka Thanks so much for all of your review comments. I will add the fix to v6. Thanks Jin Yao