mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Joe Korty <joe.korty@ccur.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>
Subject: Re: [PATCH] Display active jiffie timers in /proc/timer_list
Date: Tue, 25 Nov 2008 22:36:48 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.0811252224430.3235@localhost.localdomain> (raw)
In-Reply-To: <20081125185740.GA21806@tsunami.ccur.com>

Joe,

On Tue, 25 Nov 2008, Joe Korty wrote:
> Add to /proc/timer_list a display of the active jiffie timers.
> 
> Tested on i386 and x86_64, with 'less /proc/timer_list' and
> through SysRq-Q.
> 
> Signed-off-by: Joe Korty <joe.korty@ccur.com>
> 
> Index: 2.6.28-rc6/kernel/timer.c
> ===================================================================
> --- 2.6.28-rc6.orig/kernel/timer.c	2008-11-25 11:59:07.000000000 -0500
> +++ 2.6.28-rc6/kernel/timer.c	2008-11-25 13:49:05.000000000 -0500
> @@ -36,6 +36,8 @@
>  #include <linux/syscalls.h>
>  #include <linux/delay.h>
>  #include <linux/tick.h>
> +#include <linux/proc_fs.h>
> +#include <linux/seq_file.h>
>  #include <linux/kallsyms.h>
>  
>  #include <asm/uaccess.h>
> @@ -1568,6 +1570,87 @@
>  	open_softirq(TIMER_SOFTIRQ, run_timer_softirq);
>  }
>  
> +#if defined(CONFIG_PROC_FS) || defined(CONFIG_MAGIC_SYSRQ)

This belongs into kernel/time/timer_list.c and there is no need to
copy that code around.

> +void print_cpu_jtimers(struct seq_file *m, int cpu)
> +{
> +	int i;
> +	struct tvec_base *base = per_cpu(tvec_bases, cpu);
> +
> +	SEQ_printf(m, "active jiffie timers:\n");
> +	spin_lock_irq(&base->lock);

Yuck. We really do _NOT_ stop everything just to print timers. Check
the hrtimer print code in timer_list.c

> Index: 2.6.28-rc6/kernel/time/timer_list.c
> ===================================================================
> --- 2.6.28-rc6.orig/kernel/time/timer_list.c	2008-11-25 11:59:07.000000000 -0500
> +++ 2.6.28-rc6/kernel/time/timer_list.c	2008-11-25 13:47:30.000000000 -0500
> @@ -17,6 +17,7 @@
>  #include <linux/seq_file.h>
>  #include <linux/kallsyms.h>
>  #include <linux/tick.h>
> +#include <linux/jiffies.h>
>  
>  #include <asm/uaccess.h>
>  
> @@ -139,6 +140,7 @@
>  		SEQ_printf(m, " clock %d:\n", i);
>  		print_base(m, cpu_base->clock_base + i, now);
>  	}
> +

random whitespace change

>  #define P(x) \
>  	SEQ_printf(m, "  .%-15s: %Lu\n", #x, \
>  		   (unsigned long long)(cpu_base->x))
> @@ -176,9 +178,11 @@
>  		P(last_jiffies);
>  		P(next_jiffies);
>  		P_ns(idle_expires);
> -		SEQ_printf(m, "jiffies: %Lu\n",
> +		SEQ_printf(m, "jiffies: %llu (0x%llx)\n",
> +			   (unsigned long long)jiffies,
>  			   (unsigned long long)jiffies);

The exact purpose of this change ?

> @@ -286,7 +290,7 @@
>  {
>  	struct proc_dir_entry *pe;
>  
> -	pe = proc_create("timer_list", 0644, NULL, &timer_list_fops);
> +	pe = proc_create("timer_list", 0444, NULL, &timer_list_fops);
>  	if (!pe)
>  		return -ENOMEM;
>  	return 0;

Correct, but unrelated $subject. Separate patch please. 

Thanks,

	tglx

  reply	other threads:[~2008-11-25 21:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-21 22:11 [PATCH] create /proc/timer-wheel-list Joe Korty
2008-11-22 17:34 ` Alexey Dobriyan
2008-11-23  1:59   ` Joe Korty
2008-11-23 10:04     ` Ingo Molnar
2008-11-24 19:11       ` Joe Korty
2008-11-25 16:06 ` Michael Kerrisk
2008-11-25 18:57   ` [PATCH] Display active jiffie timers in /proc/timer_list Joe Korty
2008-11-25 21:36     ` Thomas Gleixner [this message]
2008-11-25 22:23       ` Joe Korty
2008-11-25 22:53         ` Thomas Gleixner
2008-11-26 16:48     ` [PATCH] Display active jiffie timers in /proc/timer_list, v2 Joe Korty
2008-11-26 17:07       ` Greg KH
2008-11-26 17:34         ` Joe Korty
2008-11-26 17:39           ` Greg KH
2008-11-26 21:06             ` [PATCH] ABI Documentation for /proc/timer_list Joe Korty
2008-11-28 21:37               ` Michael Kerrisk
2008-12-01 18:11                 ` [PATCH] ABI Documentation for /proc/timer_list, v2 Joe Korty
2008-12-05 17:12                   ` Randy Dunlap
2008-12-05 19:01                     ` Joe Korty

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=alpine.LFD.2.00.0811252224430.3235@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=joe.korty@ccur.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mtk.manpages@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®