Received: by 10.192.165.156 with SMTP id m28csp1147637imm; Mon, 16 Apr 2018 15:06:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/e24CWoh4CXRekNjICLQGOeAmpbTrBzG78UFbTesNnTqp3IOhLdMOAXdyuCT7fRdt8pDAZ X-Received: by 10.98.18.67 with SMTP id a64mr17380326pfj.153.1523916411878; Mon, 16 Apr 2018 15:06:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523916411; cv=none; d=google.com; s=arc-20160816; b=o6rWVKkiQ/hnazSLJK5iqAONPiduc9wqIeM/Zr3PRoTlwJykxDRWLx5lndZOO0VCIi iw28OyhT1uQ1MmokgiyDb+X3O3Na7Mr4qf2rKgDMjfoVSV+l+mquZdIp6KXaa01OFXAO PbUR0D04UXU3lXzskD7o23H7PgHPTciBmjX2g5mPa2AiV9NbrrhqRtKP8F+0FSMwxKT8 T+/RAJPgZ+IGX+scM3WuG7zzW7rRFFfTUNvNUmCky7tOSlC2kVoWuZIqVy5hsEWQZQRo DQahxyEhDQ8GZ4JQ1cijE6YCux3sHz88Rw+Sxz5X9PavP/K4EcFrQOE2LLDckGU8LJD0 hrKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature:arc-authentication-results; bh=xd3EAwBrPTHocbLsbjh06dh5JYA/Oc37Dh/l85aq67U=; b=0Mh6wEpQTTFFQGY5c/XO6hmioOSwk4EsMT1k5QihpaVobsC9aJUbu0uUq//qHg4IZZ Zu/5o/joEh1RNhbBM7w+MJziL+ZSkRnhAzLCbK9i+LYqjCYWunOrws/hyRkq6YmI7+y/ Bn9alRbYyGHK+l2ReuX/sIJR5Z823UC8v8dZ2Zj2hL3Swn8jILkI+v54lskXg3BeLqV5 mqU8bRnwuR0s0KKoOOezhnR4DIOFpp9xbdT1AQekOt3wLAneqXVaeYZHt8dtA8pTDEm7 7yqltQ3NdlkTqTzCSdjRA+LuKkefVZrrK843vZg4oC1Td0u+Y7ezSmWnrYlzRypZwyjR 6syA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Doy7v/1S; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w14si9116759pgo.154.2018.04.16.15.06.37; Mon, 16 Apr 2018 15:06:51 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=Doy7v/1S; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753166AbeDPWFZ (ORCPT + 99 others); Mon, 16 Apr 2018 18:05:25 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:43133 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753070AbeDPWFG (ORCPT ); Mon, 16 Apr 2018 18:05:06 -0400 Received: by mail-wr0-f176.google.com with SMTP id y7so30080508wrh.10 for ; Mon, 16 Apr 2018 15:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=xd3EAwBrPTHocbLsbjh06dh5JYA/Oc37Dh/l85aq67U=; b=Doy7v/1SKSq9xRlD2iwKzYTgcRzYTNdwjMrvMaq4FvT7uCoCqKRzA67bvk8ylY8AJN LsG2qccD+glP7QfcbjnYXBr0OrY2lXsgjZJMr+MKrarAoFMCDsTQJrwINhyWs2y+1bV+ AMMOTKq3wKmf+cQKGtg2+QDsU2cG25l4O14sdew4T2J+c+W3mZQ89iSHttLMwdNcI+wO oKJIHhAFIsHO4Ubx75yjujcEroow28i1ncZhGqgbHo1P8Pap0povAmCPUZfBK59kdQ1N bZSrnSzN7d4C9sySjHBuJQ+tznat6xEkKiD/G6+WvPN2fLhVA/bEj2RWqpbwZjhBt9ik yvrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=xd3EAwBrPTHocbLsbjh06dh5JYA/Oc37Dh/l85aq67U=; b=SLroomXnwWygegsyUhBCYgApMKAJZw2vM2N+5PUty8zhcCUaUYwZjcdtBZNam8ZvWK BrfNckE4LQd0RQXLuEYolqJ31KEuXUZ+GFREDiySlbL39z04E9lE4BZlpwsP/3yV5aoO Oz86ZubYqJgwPI19monapP8WQ6v5e1nYMi5WenWseOhVblY45KA5ZtwWmM34Tuy+oNsx 3IPmz/6K5Dau2RQun9B/ahKgyXwpnK+zfkzQEW0kKSB8nsSmQiUf3FXmP/oIQW0yzEGw Wql5xTl0WCkjVuBEB/E2ueP/OIM0fiWjAxs/hcyg1AkSDdIKmsL2dHqTholYmakLSHzz ej5g== X-Gm-Message-State: ALQs6tBCYrj1n5nK24eXXmPNj4Pyscn4YVBhilqvoRyiEuMwSWZtKmF6 0MwvATdaUn/EX3B0CumGRUxteR/bs9PHGgniSyt+xu+acKs= X-Received: by 10.223.172.236 with SMTP id o99mr11790969wrc.36.1523916305295; Mon, 16 Apr 2018 15:05:05 -0700 (PDT) MIME-Version: 1.0 From: Stephane Eranian Date: Mon, 16 Apr 2018 22:04:53 +0000 Message-ID: Subject: [RFC] perf/core: what is exclude_idle supposed to do To: LKML Cc: Peter Zijlstra , Jiri Olsa , Arnaldo Carvalho de Melo , mingo@elte.hu, Andi Kleen , Vince Weaver Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?