From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031911AbbKECnM (ORCPT ); Wed, 4 Nov 2015 21:43:12 -0500 Received: from one.firstfloor.org ([193.170.194.197]:50860 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031689AbbKECnK (ORCPT ); Wed, 4 Nov 2015 21:43:10 -0500 Date: Thu, 5 Nov 2015 03:43:07 +0100 From: Andi Kleen To: Jiri Olsa Cc: Andi Kleen , jolsa@kernel.org, acme@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 3/9] perf, tools, stat: Abstract stat metrics printing Message-ID: <20151105024307.GA3533@two.firstfloor.org> References: <1446515428-7450-1-git-send-email-andi@firstfloor.org> <1446515428-7450-4-git-send-email-andi@firstfloor.org> <20151104084248.GF29671@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151104084248.GF29671@krava.brq.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 04, 2015 at 09:42:48AM +0100, Jiri Olsa wrote: > On Mon, Nov 02, 2015 at 05:50:22PM -0800, Andi Kleen wrote: > > SNIP > > > evsel->attr.type == PERF_TYPE_HW_CACHE && > > evsel->attr.config == ( PERF_COUNT_HW_CACHE_L1D | > > ((PERF_COUNT_HW_CACHE_OP_READ) << 8) | > > - ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16)) && > > - runtime_l1_dcache_stats[ctx][cpu].n != 0) { > > - print_l1_dcache_misses(out, cpu, evsel, avg); > > + ((PERF_COUNT_HW_CACHE_RESULT_MISS) << 16))) { > > + if (runtime_l1_dcache_stats[ctx][cpu].n != 0) > > + print_l1_dcache_misses(cpu, evsel, avg, out); > > + else > > + print_metric(ctxp, NULL, NULL, "of all L1-dcache hits", 0); > > hum, what's the reason for all those else cases > ending up printing nothing? > > we have one metric per line anyway right? There can be stuff after the metric, need to print spaces then to get the correct indentation. Also it's needed for the metrics only patch (posted separately) so that it can catch all column headers, even if some are missing initially. -Andi -- ak@linux.intel.com -- Speaking for myself only.