aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2013-03-11 05:13:08 -0400
committerThomas Gleixner <tglx@linutronix.de>2013-04-17 14:51:01 -0400
commit57b8015e07a70301e9ec9f324db1a8b73b5a1e2b (patch)
treefb2b5bae45c3c9f437b57379a8fa1279e220d6d0 /fs/proc
parent48f6a7a511ef8823fdff39afee0320092d43a8a0 (diff)
posix-timers: Show sigevent info in proc file
Previous patch added proc file to list posix timers created by task. Expand the information provided in this file by adding info about notification method, with which timers were created. I.e. after the "ID:" line there go 1. "signal:" line, that shows signal number and sigval bits; 2. "notify:" line, that shows the timer notification method. Thus the timer entry would looke like this: ID: 123 signal: 14/0000000000b005d0 notify: signal/pid.732 This information is enough to understand how timer_create() was called for each particular timer. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Matthew Helsley <matt.helsley@gmail.com> Link: http://lkml.kernel.org/r/513DA024.80404@parallels.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 01def9f8aa74..a19308604145 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2018,6 +2018,7 @@ struct timers_private {
2018 struct pid *pid; 2018 struct pid *pid;
2019 struct task_struct *task; 2019 struct task_struct *task;
2020 struct sighand_struct *sighand; 2020 struct sighand_struct *sighand;
2021 struct pid_namespace *ns;
2021 unsigned long flags; 2022 unsigned long flags;
2022}; 2023};
2023 2024
@@ -2060,9 +2061,24 @@ static void timers_stop(struct seq_file *m, void *v)
2060static int show_timer(struct seq_file *m, void *v) 2061static int show_timer(struct seq_file *m, void *v)
2061{ 2062{
2062 struct k_itimer *timer; 2063 struct k_itimer *timer;
2064 struct timers_private *tp = m->private;
2065 int notify;
2066 static char *nstr[] = {
2067 [SIGEV_SIGNAL] = "signal",
2068 [SIGEV_NONE] = "none",
2069 [SIGEV_THREAD] = "thread",
2070 };
2063 2071
2064 timer = list_entry((struct list_head *)v, struct k_itimer, list); 2072 timer = list_entry((struct list_head *)v, struct k_itimer, list);
2073 notify = timer->it_sigev_notify;
2074
2065 seq_printf(m, "ID: %d\n", timer->it_id); 2075 seq_printf(m, "ID: %d\n", timer->it_id);
2076 seq_printf(m, "signal: %d/%p\n", timer->sigq->info.si_signo,
2077 timer->sigq->info.si_value.sival_ptr);
2078 seq_printf(m, "notify: %s/%s.%d\n",
2079 nstr[notify & ~SIGEV_THREAD_ID],
2080 (notify & SIGEV_THREAD_ID) ? "tid" : "pid",
2081 pid_nr_ns(timer->it_pid, tp->ns));
2066 2082
2067 return 0; 2083 return 0;
2068} 2084}
@@ -2084,6 +2100,7 @@ static int proc_timers_open(struct inode *inode, struct file *file)
2084 return -ENOMEM; 2100 return -ENOMEM;
2085 2101
2086 tp->pid = proc_pid(inode); 2102 tp->pid = proc_pid(inode);
2103 tp->ns = inode->i_sb->s_fs_info;
2087 return 0; 2104 return 0;
2088} 2105}
2089 2106