From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3w7PCl3KghzDq9m for ; Thu, 20 Apr 2017 00:15:15 +1000 (AEST) Date: Wed, 19 Apr 2017 16:15:10 +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 v5 7/7] perf report: Show branch type in callchain entry Message-ID: <20170419141510.GA19643@krava> References: <1492616894-3635-1-git-send-email-yao.jin@linux.intel.com> <1492616894-3635-8-git-send-email-yao.jin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1492616894-3635-8-git-send-email-yao.jin@linux.intel.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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