Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3205288ybh; Mon, 5 Aug 2019 14:03:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8iDlWI+8BufmEqsfvz1uWLGWp+ms4/LzFNF0s3qaCCYmnC+gzzkPm/4HQ++9vkzukwCvf X-Received: by 2002:a17:90a:bf92:: with SMTP id d18mr20630090pjs.128.1565039032054; Mon, 05 Aug 2019 14:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565039032; cv=none; d=google.com; s=arc-20160816; b=LBB13PpykQaphz9N3Wqs/WsxOTOxomDg7VQ122U4uM4hmGesfErB3M7dQwEopfm4GB R3Lu0GgEDSvCnVkc57UW8GIbDgDVvS3boQ3VxnffljWt2PPUmd1mCkOJ8qz7N/r6C2bH 8jCvypVIAtgYEsrYHk1b/Ltsgkho5fePFB4j5Ioc98O8ytNz33fHu1p0RLateTl1/T8E fAGq8nUSuzoTZQmGtJA1T6k8sJJNjDr0czUdjgbNz5oN4l492hHUyYJtPOKsZTg9k6WX CE523wP6Fg5u+5CIBLusGTaYlCmpqwAcivlWkBCYrvbLQs+3QMH1vs3qEZ6rPzZCvxtb HkrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :message-id:dkim-signature; bh=uMVmeu4mdexdqU41liFV6boDUEQu0SlMK35Wx76U6rQ=; b=iHTNj1Xq6CeXZ9/Bv/fo6Jl2HSfgX/TUovb+WKqv3LYIxG/ixJHDJjRo8t13eoYBmq LiIZtfAOCMoL8yWHN9gPrE2WgrIIfO7qXKX1BpNLkJx1E1/ZWfVkv4ffJ1VDlT07cdfC XowdMBlk12GXn8N3Nwn5Ag8KLnE86Kk0jzjf0D6gBTZ2+o7fI1RdqOnVOn9aca4A2nmG JB1zAlksPkwZeHwwN2m1g8Ljzef1gc0P+6NMcpwOSKtM7+h8Kv1p+sE75+oM6NX5+4My HH14lbe10XwDyTNaEyy/ocuClJGHW6MBSLGa6YveBtg2oVx2gU/4EnPbOVuoAZ18vaOi tYXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fWEhDH71; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si5419151plb.106.2019.08.05.14.03.35; Mon, 05 Aug 2019 14:03:52 -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=@chromium.org header.s=google header.b=fWEhDH71; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730589AbfHEVCv (ORCPT + 99 others); Mon, 5 Aug 2019 17:02:51 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:37602 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730099AbfHEVCv (ORCPT ); Mon, 5 Aug 2019 17:02:51 -0400 Received: by mail-pg1-f195.google.com with SMTP id d1so7530061pgp.4 for ; Mon, 05 Aug 2019 14:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=message-id:mime-version:content-transfer-encoding:in-reply-to :references:subject:from:cc:to:user-agent:date; bh=uMVmeu4mdexdqU41liFV6boDUEQu0SlMK35Wx76U6rQ=; b=fWEhDH71W06T3024ETGhhgrpXzwlOn9eSdQr0TzByAtVcHPr5TVTvBfe3MLFjn8JNr fptB9Za0YySQe54L+mGjMUAaYQUicXz48Ta4el70D9SHQhbLW8zXoQj5+Cnrqv/XVgVh biPY1LDvezl01zVWbBeV8IZ3lhX34QANjm7Ao= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version :content-transfer-encoding:in-reply-to:references:subject:from:cc:to :user-agent:date; bh=uMVmeu4mdexdqU41liFV6boDUEQu0SlMK35Wx76U6rQ=; b=PcPjXA7MEPgEDgr+4Vr34c0BHEooE27sXkV4gUm6abGUgTT67LIYvSn9YEw00zmac9 DeFPlZMCGPMNWQ5O93KT6IL2H53T0DrVzVqhV0jy0EbY48p4UVq7UyaXbka4G6CEgkAS UfE+rGyB9TSJqI16o4/C/83jDelLfYOzaEh/WIPtn+7LF2VmFrSMU+2dJXBXc8enBbbC JE+Zg1X31nCXR/AqHWWCcY1a5jfH/BsmU8dMKfA8qIzZNjsOgqocFZyWg3f1Ftixz1qO z6RGZ7pdRvt2E8NFrFY5UfWyUPyQMFRwOPiF7XuTwNyOYMDeFUEXX/6l/edGBsFJxdIZ q4bw== X-Gm-Message-State: APjAAAW4A5uxX6iAfXz2Hfg4tfK192brfFi76ipjotCJmUqOZ16R6PQB NOyFJ4LMrYbXJgeL8zqNJ2pMNw== X-Received: by 2002:a17:90a:2247:: with SMTP id c65mr19374065pje.24.1565038970368; Mon, 05 Aug 2019 14:02:50 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id x9sm59934438pgp.75.2019.08.05.14.02.49 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 14:02:49 -0700 (PDT) Message-ID: <5d489979.1c69fb81.9480d.fd19@mx.google.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190805175848.163558-4-trong@android.com> References: <20190805175848.163558-1-trong@android.com> <20190805175848.163558-4-trong@android.com> Subject: Re: [PATCH v7 3/3] PM / wakeup: Show wakeup sources stats in sysfs From: Stephen Boyd Cc: rafael@kernel.org, hridya@google.com, sspatil@google.com, kaleshsingh@google.com, ravisadineni@chromium.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, kernel-team@android.com, Tri Vo To: Tri Vo , gregkh@linuxfoundation.org, rjw@rjwysocki.net, viresh.kumar@linaro.org User-Agent: alot/0.8.1 Date: Mon, 05 Aug 2019 14:02:48 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Tri Vo (2019-08-05 10:58:48) > diff --git a/drivers/base/power/wakeup_stats.c b/drivers/base/power/wakeu= p_stats.c > new file mode 100644 > index 000000000000..3a4f55028e27 > --- /dev/null > +++ b/drivers/base/power/wakeup_stats.c > @@ -0,0 +1,161 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Wakeup statistics in sysfs > + * > + * Copyright (c) 2019 Linux Foundation > + * Copyright (c) 2019 Greg Kroah-Hartman > + * Copyright (c) 2019 Google Inc. > + */ > + > +#include > +#include > +#include > +#include Can you include init.h, device.h, timekeeping.h, and kernel. here? This file calls functions exported in those headers. > + > +#include "power.h" > + > +static struct class *wakeup_class; > + > +#define wakeup_attr(_name) \ > +static ssize_t _name##_show(struct device *dev, = \ > + struct device_attribute *attr, char *buf) \ > +{ \ > + struct wakeup_source *ws =3D dev_get_drvdata(dev); = \ > + \ > + return sprintf(buf, "%lu\n", ws->_name); \ > +} \ > +static DEVICE_ATTR_RO(_name) > + > +wakeup_attr(active_count); > +wakeup_attr(event_count); > +wakeup_attr(wakeup_count);