Received: by 10.223.185.116 with SMTP id b49csp2650899wrg; Mon, 12 Feb 2018 13:22:04 -0800 (PST) X-Google-Smtp-Source: AH8x225pl79jQSUUfQ0A/M/QKdNbupnsbnoMtEBWkBzcA+wLh8U7/U6ODKH8FkE1VgNnkn84cz5R X-Received: by 10.98.209.8 with SMTP id z8mr12880435pfg.240.1518470524676; Mon, 12 Feb 2018 13:22:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518470524; cv=none; d=google.com; s=arc-20160816; b=cLNeq+vQQNo7cS4NaohVmTj3JMloUgr/pRKT4aB8/sDerNgqxW6lamO8rLkq1E3o6d M/L4/qoQnkOLLpHgMb9dEXMKoaQqxXFkEuWLBAjDWIYeasoBjINAFrjBwsEEZJgwJ6r5 M2iVHGgzNQQPGSBjH4wknsf2AqEQjVVvZ2e87uNJaBYI9ZKd7jqOFcB5fkVEu5gA/udC CCos4V2ENHk/Or7KcTYD4BZ5zYyW210V5p40yi1P1w80aLSMojwaQBk4QYDBPi6pHsP7 ufwF+44FTOSDpCkRh9Mb5aASDvx5vaKImWWFNbOIu5OcvxgT+KSXrUeR/a2R2CbKoJOK xEHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=LiL5ShL0sw7gzVVTCb38nOI0p1iSE7pCXnHD/LvDP+8=; b=h2TTJx5QDj7/NHU6Fu+/R7ncLyn1a2hOT46Mz8xU+cfeSKAcsXa7R6hIyYrRam08fs cL031+M9nrs+DPV6RohMLQgSo90DgioGD/hOkfZbZCac3Y6SqMeQkk7uqjrCHpbBuFM0 8nsGGhXYiPUKSBLavDT9aL6oKWwZjQYsEhMDZ0yOC/Pup15KlfhPmYz0uiv6uhcAJpeO BprtKTtmKrOrXZIysuzH1iKneKLdmnUSLO84q25CdMry37BlzulSk7429Eqk4Nme0wqv 5rEDPt4FrBjxgWRPmeiEHq5p7AVadHANbh3f9vIetJz87m2q6proQSQ3TzofC0FJ7Vqw zE/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7si3208779pgr.71.2018.02.12.13.21.50; Mon, 12 Feb 2018 13:22:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754195AbeBLVVI (ORCPT + 99 others); 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 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5166B40201A0; Mon, 12 Feb 2018 21:21:04 +0000 (UTC) Received: from krava (ovpn-204-43.brq.redhat.com [10.40.204.43]) by smtp.corp.redhat.com (Postfix) with SMTP id 10C072024CA4; Mon, 12 Feb 2018 21:21:01 +0000 (UTC) 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) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 12 Feb 2018 21:21:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 12 Feb 2018 21:21:04 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk 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