From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764170AbdDSOPP (ORCPT ); Wed, 19 Apr 2017 10:15:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36620 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764155AbdDSOPO (ORCPT ); Wed, 19 Apr 2017 10:15:14 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 678F561BB4 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 678F561BB4 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 Content-Disposition: inline In-Reply-To: <1492616894-3635-8-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]); Wed, 19 Apr 2017 14:15:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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