From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758450AbcFAOuy (ORCPT ); Wed, 1 Jun 2016 10:50:54 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:36502 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758259AbcFAOux (ORCPT ); Wed, 1 Jun 2016 10:50:53 -0400 MIME-Version: 1.0 In-Reply-To: <1464119559-17203-2-git-send-email-andi@firstfloor.org> References: <1464119559-17203-1-git-send-email-andi@firstfloor.org> <1464119559-17203-2-git-send-email-andi@firstfloor.org> From: Nilay Vaish Date: Wed, 1 Jun 2016 09:50:07 -0500 Message-ID: Subject: Re: [PATCH 2/4] perf stat: Add computation of TopDown formulas To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, Linux Kernel list , Andi Kleen Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24 May 2016 at 14:52, Andi Kleen wrote: > +static double td_be_bound(int ctx, int cpu) > +{ > + double sum = (td_fe_bound(ctx, cpu) + > + td_bad_spec(ctx, cpu) + > + td_retiring(ctx, cpu)); > + if (sum == 0) > + return 0; > + return sanitize_val(1.0 - sum); > +} > + Can you explain why we need the check on sum? -- Nilay