Received: by 10.223.185.116 with SMTP id b49csp2078586wrg; Mon, 12 Feb 2018 04:02:56 -0800 (PST) X-Google-Smtp-Source: AH8x225DOILIozAp3avOCy/cqjHfVqn6ma7VrFXK+ptwtUyaB/WQOF0BK3kkHILsseC6RNuRN6ON X-Received: by 10.101.101.84 with SMTP id a20mr9245436pgw.163.1518436976167; Mon, 12 Feb 2018 04:02:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518436976; cv=none; d=google.com; s=arc-20160816; b=JrnwBD6VDNXhcBtMZEJO6VC5E4sHgMWBv/8b3rVCw/UYPKvqpEdz3IWZdn00PyrxoX hJeibzKntdeWxHlQ3OOu6ojymm6gpiCeMFwIEJq2rg4u1vex19qbpKyFs3TKu69XMM2p zFvNbZo5uSL93T+OZdv00Pa2yxjQWcH/rsfZFu4FwF2OJQRpihELx4/qCH1O6R0magic 4zTXHKF/dNBqgsfbcZuN+NBM58Pdi++bVaqZQUhqeSMgMhoVETV1hvcnfDQHUlD810U1 tOCQbeo5XDBj/rifFH713nuwOjvAjR3RQMzeivp5ixd1mdbxAeKtGocNE0wfltp9nRt+ WV3Q== 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=AwNgxJBZZwocROaOVDNuEiC/GtSUF3PtSZBjJpYjxSM=; b=o9w9z/wc9ktd4R5I1Zqlj9SusM/qk9ArnDmXnor8GDN8gVG6cs2nWyPrS5mxw4sQIQ zHUGOZM3cntH+cmLTnRlSGWhGHtbdj6tEK4WbX2XRBVknjEtdggPAp7HdLiO+k0gZ8kS wljNSkUxFSAAy8bybWV3RrvXVSw4TR5x25QQkTTd3i2EBidp1o7L/3vwVkk1a6w5ZV3C 9J/a1j4sgrkWCH8+ivVSWUIk76qRfN1cMa2LRGcStFMC3PtS4/9x/t7RZmVUx7XGJBUn hhcEOkZTZFBI0GW7T8z4nwMciWRdGkNsfRhqMgVxfEPHaYvWjKCN0pjgl1iCTLnG9I+r wFRw== 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 f3-v6si5687084pld.374.2018.02.12.04.02.41; Mon, 12 Feb 2018 04:02:56 -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 S933343AbeBLJoB (ORCPT + 99 others); Mon, 12 Feb 2018 04:44:01 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58702 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933099AbeBLJoA (ORCPT ); Mon, 12 Feb 2018 04:44:00 -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 9A7F98182D37; Mon, 12 Feb 2018 09:43:59 +0000 (UTC) Received: from krava (unknown [10.43.17.235]) by smtp.corp.redhat.com (Postfix) with SMTP id 3A53B2026DFD; Mon, 12 Feb 2018 09:43:58 +0000 (UTC) Date: Mon, 12 Feb 2018 10:43:57 +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: <20180212094357.GD5821@krava> References: <1518217620-28458-1-git-send-email-rananta@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1518217620-28458-1-git-send-email-rananta@codeaurora.org> 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.8]); Mon, 12 Feb 2018 09:43:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 12 Feb 2018 09:43:59 +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 Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote: > Perf framework doesn't allow creation of hardware events if > the requested CPU is offline. However, creation of an event > is achievable if the event is attached to the PMU as soon > as the CPU is online again. > > So, introducing a feature that could allow to create events > even when the CPU is offline and return a success to the caller. > If, during the time of event creation, the CPU is found offline, > the event is moved to a new state (PERF_EVENT_STATE_DORMANT). As > and when the CPU is know to be woken up (through hotplug notifiers), > all the dormant events would be attached to the PMU (by > perf_install_in_context()). If during the life time of the event, > the CPU hasn't come online, the dormant event would just be freed. > > Signed-off-by: Raghavendra Rao Ananta hum, I tried and for some reason I'm getting zero counts/times when the cpu 1 is set back online (in 9.second) [root@ibm-x3650m4-02 perf]# ./perf stat -C 1 -e sched:sched_switch -v -I 1000 failed to read counter sched:sched_switch # time counts unit events 1.000921624 sched:sched_switch failed to read counter sched:sched_switch 2.001725364 sched:sched_switch failed to read counter sched:sched_switch 3.002685350 sched:sched_switch failed to read counter sched:sched_switch 4.003463851 sched:sched_switch failed to read counter sched:sched_switch 5.004651601 sched:sched_switch failed to read counter sched:sched_switch 6.005338294 sched:sched_switch failed to read counter sched:sched_switch 7.006351155 sched:sched_switch failed to read counter sched:sched_switch 8.007239698 sched:sched_switch sched:sched_switch: 0 0 0 9.008665621 sched:sched_switch sched:sched_switch: 0 0 0 10.009570492 sched:sched_switch sched:sched_switch: 0 0 0 11.010811591 sched:sched_switch sched:sched_switch: 0 0 0 12.011614182 sched:sched_switch sched:sched_switch: 0 0 0 13.012299851 sched:sched_switch looks like the dormant event wasn't scheduled in properly also while at it, could we also handle cpu going offline case, so the event would survive until it's back online jirka