Re: PATCH: Create new LED trigger for CPU activity (ledtrig-cpu) (UPDATED)

Andrew Morton
2006-07-06T04:39:05Z

On Wed, 5 Jul 2006 22:48:17 -0400
"Thomas Tuttle" <thinkinginbinary@gmail.com> wrote:

> Here is a new version of the patch, incorporating code style tips from
> Randy Dunlap <rdunlap@xenotime.net>, and based on 2.6.17-git25, rather
> than 2.6.17.1.
>
> I noticed that there's a Heartbeat LED trigger in the git version. I
> hope this isn't too similar.
>

> --- linux-2.6.17-git25/drivers/leds/Kconfig 2006-07-05 22:11:45.000000000 -0400
> +++ linux-2.6.17-git25-mine/drivers/leds/Kconfig 2006-07-05 22:42:58.000000000 -0400
> @@ -93,6 +93,41 @@
> This allows LEDs to be controlled by IDE disk activity.
> If unsure, say Y.
>
> +config LEDS_TRIGGER_CPU
> + tristate "LED CPU Trigger"
> + depends LEDS_TRIGGERS
> + help
> + This allows LEDs to be controlled by CPU activity.
> + If unsure, say Y.
> +
> +config LEDS_TRIGGER_CPU_INCLUDE_USER
> + bool "Include user time in CPU trigger"
> + depends LEDS_TRIGGER_CPU
> + default y
> + help
> + This option makes user CPU time cause the CPU trigger to activate.
> +
> +config LEDS_TRIGGER_CPU_INCLUDE_NICE
> + bool "Include nice time in CPU trigger"
> + depends LEDS_TRIGGER_CPU
> + default n
> + help
> + This option makes nice CPU time cause the CPU trigger to activate.
> +
> +config LEDS_TRIGGER_CPU_INCLUDE_SYSTEM
> + bool "Include system time in CPU trigger"
> + depends LEDS_TRIGGER_CPU
> + default y
> + help
> + This option makes system CPU time cause the CPU trigger to activate.
> +
> +config LEDS_TRIGGER_CPU_INCLUDE_IOWAIT
> + bool "Include iowait time in CPU trigger"
> + depends LEDS_TRIGGER_CPU
> + default n
> + help
> + This option makes iowait CPU time cause the CPU trigger to activate.

waaaaaaaaaaay too many config options. Make up your mind, man ;)

> +cputime64_t last_cputime;

static.

> +static void __exit ledtrig_cpu_exit(void)
> +{
> + del_timer(&ledtrig_cpu_timer);

del_timer_sync().