From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754200AbeBLVVI (ORCPT ); Mon, 12 Feb 2018 16:21:08 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57058 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754117AbeBLVVE (ORCPT ); Mon, 12 Feb 2018 16:21:04 -0500 Date: Mon, 12 Feb 2018 22:21:01 +0100 From: Jiri Olsa To: Raghavendra Rao Ananta Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, psodagud@codeaurora.org, tsoni@codeaurora.org Subject: Re: [PATCH] perf: Add support for creating offline events Message-ID: <20180212212101.GA15817@krava> References: <1518217620-28458-1-git-send-email-rananta@codeaurora.org> <20180212094357.GD5821@krava> <53408020-8638-4947-90f6-87dbc4c2c4e5@codeaurora.org> <20180212210442.GA32093@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180212210442.GA32093@krava> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 12, 2018 at 10:04:42PM +0100, Jiri Olsa wrote: > On Mon, Feb 12, 2018 at 09:42:05AM -0800, Raghavendra Rao Ananta wrote: > > Hi Jiri, > > > > Thank you for the response. > > > > Does perf tool has its own check to see if the CPU was offline during the > > lifetime of an event? If so, it might ignore these type of events. > > nope, we don't check on that > > > > > Initially, I tested the same using perf tool and found similar results. > > Then I debugged further and found that the perf core was actually sending > > data to the userspace (copy_to_user()) and the corresponding count for the > > data. Hence, I tested this further by writing my own userspace application, > > and I was able to read the count through this, > > even when the CPU was made offline and back online. > > > > Do you think we also have to modify the perf tool accordingly? > > hum, I wonder what's wrong.. will check I think the user space needs to enable the event once the cpu gets online.. which we dont do and your app does..? maybe we could add perf_event_attr::enable_on_online ;-) I'll check what we can do in user space, I guess we can monitor the cpu state and enable event accordingly jirka