Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751105AbdCODlQ (ORCPT ); Tue, 14 Mar 2017 23:41:16 -0400 Received: from mail-it0-f52.google.com ([209.85.214.52]:36977 "EHLO mail-it0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750876AbdCODlP (ORCPT ); Tue, 14 Mar 2017 23:41:15 -0400 From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Tue, 14 Mar 2017 23:41:10 -0400 (EDT) X-X-Sender: vince@macbook-air To: "linux-kernel@vger.kernel.org" cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo Subject: perf: rdpmc mmap page time_enabled issue Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 811 Lines: 24 So another obscure rdpmc problem, turned up by the PAPI regression tests. If you use rdpmc, and your event is attached measuring another process, and then you ENABLE/DISABLE/ENABLE/rdpmc the event somehow the userpg->time_enabled field gets a weird value and that completely confuses code expecting enabled!=running to mean multiplexing is happening. Example: Trying attach: * RDPMC 1 Event 0 -- count: 1058381 enabled ffe6935332c70240 running: 9d14f * RDPMC 1 Event 1 -- count: 623980 enabled ffe6935332c829b3 running: 9d350 the rdpmc count and running values are expected, but the enabled value is way off, it should match the running value. If you want to test this out, I have a test case in perf_event_tests, (github.com/deater/perf_event_tests.git) tests/rdpmc/rdpmc_multiattach_papi Vince