From: Kevin Hilman <khilman@deeprootsystems.com>
To: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 1/3] Power off on state counter debugging
Date: Thu, 04 Sep 2008 22:20:44 +0300 [thread overview]
Message-ID: <48C0350C.6080005@deeprootsystems.com> (raw)
In-Reply-To: <1216904434-7545-2-git-send-email-peter.de-schrijver@nokia.com>
Peter 'p2' De Schrijver wrote:
> Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
> ---
> arch/arm/mach-omap2/Makefile | 2 +-
> arch/arm/mach-omap2/off-state-counter-debug.c | 50 +++++++++++++++++++++++++
> 2 files changed, 51 insertions(+), 1 deletions(-)
> create mode 100644 arch/arm/mach-omap2/off-state-counter-debug.c
How about calling this powerdomain-debug.c and conditionally compiling
based on CONFIG_PM_DEBUG.
There will probably be some other things besides off-mode counters to
add here down the road.
Kevin
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 0d8507c..a48f832 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -5,7 +5,7 @@
> # Common support
> obj-y := irq.o id.o io.o memory.o control.o prcm.o clock.o mux.o \
> devices.o serial.o gpmc.o timer-gp.o powerdomain.o \
> - clockdomain.o
> + clockdomain.o off-state-counter-debug.o
>
> obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
>
> diff --git a/arch/arm/mach-omap2/off-state-counter-debug.c b/arch/arm/mach-omap2/off-state-counter-debug.c
> new file mode 100644
> index 0000000..7db54b6
> --- /dev/null
> +++ b/arch/arm/mach-omap2/off-state-counter-debug.c
> @@ -0,0 +1,50 @@
> +#include <linux/debugfs.h>
> +#include <linux/seq_file.h>
> +#include <asm/arch/powerdomain.h>
> +
> +
> +int show_off_mode_count(struct powerdomain *pwrdm, void *user)
> +{
> + struct seq_file *s = (struct seq_file *)user;
> +
> + if (strcmp(pwrdm->name, "emu_pwrdm") &&
> + strcmp(pwrdm->name, "wkup_pwrdm"))
> + seq_printf(s, "%s : %d\n", pwrdm->name, pwrdm->offstate_count);
> +
> + return 0;
> +}
> +
> +int show_off_mode_counters(struct seq_file *s, void *unused)
> +{
> + pwrdm_for_each(show_off_mode_count, s);
> +
> + return 0;
> +}
> +
> +static int off_mode_counter_open(struct inode *inode, struct file *file)
> +{
> + return single_open(file, show_off_mode_counters, &inode->i_private);
> +}
> +
> +static const struct file_operations debug_fops = {
> + .open = off_mode_counter_open,
> + .read = seq_read,
> + .llseek = seq_lseek,
> + .release = single_release,
> +};
> +
> +static int __init off_mode_counter_debug(void)
> +{
> + struct dentry *d;
> +
> + d = debugfs_create_dir("off_mode_counters", NULL);
> + if (IS_ERR(d))
> + return PTR_ERR(d);
> +
> + debugfs_create_file("count", S_IRUGO,
> + d, NULL, &debug_fops);
> +
> + return 0;
> +}
> +
> +late_initcall(off_mode_counter_debug);
next prev parent reply other threads:[~2008-09-04 19:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-24 13:00 [PATCH 0/3] Implement powerdomain off on state counters Peter 'p2' De Schrijver
2008-07-24 13:00 ` [PATCH 1/3] Power off on state counter debugging Peter 'p2' De Schrijver
2008-07-24 13:00 ` [PATCH 2/3] power off on state counter infrastructure Peter 'p2' De Schrijver
2008-07-24 13:00 ` [PATCH 3/3] Add hooks for counting off on power transitions Peter 'p2' De Schrijver
2008-09-04 16:54 ` [PATCH 2/3] power off on state counter infrastructure Paul Walmsley
2008-09-04 19:20 ` Kevin Hilman [this message]
2008-07-24 13:04 ` [PATCH 0/3] Implement powerdomain off on state counters Peter 'p2' De Schrijver
2008-08-05 14:20 ` Tony Lindgren
2008-08-05 14:28 ` Igor Stoppa
2008-08-05 15:30 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48C0350C.6080005@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--cc=peter.de-schrijver@nokia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.