Received: by 10.192.165.156 with SMTP id m28csp68758imm; Tue, 17 Apr 2018 06:43:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/RZgZfxhO47l41dcFyDf5VpX6LBvYwYo3djdJx5E/QI4uKxrs14bQQwlLdXgI3OUdqhjee X-Received: by 10.101.89.65 with SMTP id g1mr1832931pgu.185.1523972582758; Tue, 17 Apr 2018 06:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523972582; cv=none; d=google.com; s=arc-20160816; b=b0LSVGHdk6tD2RPr1BVwpnGvs2PjXs7T/G1U2G7C+7HpvJIimeYVwbzcZiEC2IgETC F4JMBxO4ttGlgLjtAkfUFzWQSf1mCudDWnsTLL+VbFPdaO4IcOB9jaWh37kWiWLlAkuL h9DgL2AxvNOT/6/GsGbIBVqIVmX2R40hlOcocBj1eLagjMSw1juVSHhrp+s/FNBxwKGF IKas3mQFgZK9OQMfl107NZQsMfX0CojKkYPvM+w9duUCyqJli8pVVErXrSuZDV4bm9NL mDUdSTyKAmNYOxg7tBQNbLmkVZYHRqf//We+E+1tyNOKDJfojSvuMFSWr5+Q7gcMtX1i 7WWQ== 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=IR+tBLPAeGNrRDmpy3vbN6FRfTAgLY2Ccbm7PCp0Zus=; b=lmA+H9EqoDJn0jB14HOGFQjKzHQEufMMte9kPoD6oy7m2yBxWc11il6Rnfyon2IFwx F1369utgfPPYd8SG3tqu4uOT/WNCQTcZ1IzoFPvqaE+V0At484YTEe/X2KYObkclk/0Y 0J5t/Z3qrShNFTcnfEId0jCo8kSJw7oULvCEMM2pK2IKQMF24wG7GedCiIK/oeHa71Ns MkhqdEPwjeFkJGyASPQSzLoMWSmjRz9RhFecIAOHs7QtHGByFWiOhutmQrvNpPBMFl2v Ivm58HSH5Itu5Fnv4AFXuqhGPOEuCRNuyLIQwqfhEitLZc/cCCihYY6CxsfJ7crvs523 RvMA== 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 b184si10266289pgc.25.2018.04.17.06.42.48; Tue, 17 Apr 2018 06:43:02 -0700 (PDT) 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 S1753841AbeDQNkR (ORCPT + 99 others); Tue, 17 Apr 2018 09:40:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55036 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753813AbeDQNkM (ORCPT ); Tue, 17 Apr 2018 09:40:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0DE11406E970; Tue, 17 Apr 2018 13:40:12 +0000 (UTC) Received: from sandy.ghostprotocols.net (ovpn-112-4.gru2.redhat.com [10.97.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 665F82166BAE; Tue, 17 Apr 2018 13:40:11 +0000 (UTC) Received: by sandy.ghostprotocols.net (Postfix, from userid 1000) id A6BAD4BFF; Tue, 17 Apr 2018 10:40:08 -0300 (BRT) Date: Tue, 17 Apr 2018 10:40:08 -0300 From: Arnaldo Carvalho de Melo To: Stephane Eranian Cc: LKML , Peter Zijlstra , Jiri Olsa , Ingo Molnar , Andi Kleen , Vince Weaver , acme@kernel.org Subject: Re: [RFC] perf/core: what is exclude_idle supposed to do Message-ID: <20180417134008.GA2350@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 17 Apr 2018 13:40:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 17 Apr 2018 13:40:12 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'acme@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Apr 16, 2018 at 10:04:53PM +0000, Stephane Eranian escreveu: > Hi, > > I am trying to understand what the exclude_idle event attribute is supposed > to accomplish. > As per the definition in the header file: > > exclude_idle : 1, /* don't count when idle */ > > Naively, I thought it would simply stop the event when running in the > context of the idle task (swapper, pid 0) on any CPU. That would seem to > match the succinct description. > > However, running a simple: > > $ perf record -a -e cycles:I sleep 5 > perf_event_attr: > sample_type IP|TID|TIME|CPU|PERIOD > read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING|ID > exclude_idle 1 > > on an idle machine, showed me that this is not what is actually happening: > $ perf script > swapper 0 [000] 1132634.287442: 1 cycles:I: > ffffffff8100b1fb __intel_pmu_enable_all.isra.17 ([kernel.kallsyms]) > swapper 0 [001] 1132634.287498: 1 cycles:I: > ffffffff8100b1fb __intel_pmu_enable_all.isra.17 ([kernel.kallsyms]) > > > After looking at the code, it all made sense, it seems to current > implementation is only relevant for sw events. I don't understand why. > > I am left wondering what is the goal of exclude_idle? To do something it is not doing, i.e. to do what you expected it to do. There were messages exchanged recently where PeterZ said that this is just that needs fixing. - Arnaldo