From patchwork Wed Aug 20 21:21:54 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: 4754471 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 68C6CC0338 for ; Wed, 20 Aug 2014 21:22:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 82DA920136 for ; Wed, 20 Aug 2014 21:22:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D22C20123 for ; Wed, 20 Aug 2014 21:22:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752658AbaHTVV6 (ORCPT ); Wed, 20 Aug 2014 17:21:58 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:59256 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751610AbaHTVV5 (ORCPT ); Wed, 20 Aug 2014 17:21:57 -0400 Received: from cpe-173-174-67-34.austin.res.rr.com ([173.174.67.34] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XKDKO-0000Pv-9X for kvm@vger.kernel.org; Wed, 20 Aug 2014 21:21:56 +0000 From: Chris J Arges To: kvm@vger.kernel.org Subject: [RESEND][PATCH] kvm-unit-tests: x86: pmu: call measure for every counter in check_counters_many Date: Wed, 20 Aug 2014 16:21:54 -0500 Message-Id: <1408569714-18225-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); }