From patchwork Thu Aug 14 20:58:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris J Arges X-Patchwork-Id: 4725371 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E5FD79F319 for ; Thu, 14 Aug 2014 20:59:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86E50201C8 for ; Thu, 14 Aug 2014 20:59:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 79174201BF for ; Thu, 14 Aug 2014 20:59:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753464AbaHNU7F (ORCPT ); Thu, 14 Aug 2014 16:59:05 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:50312 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752498AbaHNU7E (ORCPT ); Thu, 14 Aug 2014 16:59:04 -0400 Received: from c-24-13-127-84.hsd1.in.comcast.net ([24.13.127.84] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XI26w-0003Tb-2v; Thu, 14 Aug 2014 20:59:02 +0000 From: Chris J Arges To: kvm@vger.kernel.org Cc: Chris J Arges Subject: [PATCH] kvm-unit-tests: x86: pmu: call measure for every counter in check_counters_many Date: Thu, 14 Aug 2014 15:58:44 -0500 Message-Id: <1408049924-18848-1-git-send-email-chris.j.arges@canonical.com> X-Mailer: git-send-email 1.9.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the check_counters_many function measure was only being called on the last counter, causing the pmu test to fail. This ensures that measure is called for each counter in the array before calling verify_counter. Signed-off-by: Chris J Arges --- x86/pmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x86/pmu.c b/x86/pmu.c index 5c85146..3402d1e 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -287,11 +287,11 @@ static void check_counters_many(void) n++; } - measure(cnt, n); - - for (i = 0; i < n; i++) + for (i = 0; i < n; i++) { + measure(&cnt[i], 1); if (!verify_counter(&cnt[i])) break; + } report("all counters", i == n); }