Skip to contentSkip to conversation

posix timers: Expand exitsting info in proc file

PATCH In review Pavel Tikhomirov 4 participants 7 messages May 16, 2013 – May 28, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover posix timers: Expand exitsting info in proc file

Hi.

I'm working on the checkpoint-restore project (http://criu.org), on realisation of posix-timers. To compleatly checkpoint and restore these timers we need to know which clock they are using. So I d'like to add this information to existing syscall which shows posix-timers info.

Pavel Tikhomirov (1):
posix-timers: Show clock ID in proc file

 fs/proc/base.c |    1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 posix-timers: Show clock ID in proc file

Expand information about posix-timers in /proc/<pid>/timers by adding info about clock, with which the timer was created. I.e. in the forth line of timer info after "notify:" line go "ClockID: <clock_id>".

---
 fs/proc/base.c |    1 +
 1 file changed, 1 insertion(+)
fs/proc/base.c +1 -0
index 2dad4a9..8a38eef 100644
@@ -2079,6 +2079,7 @@ static int show_timer(struct seq_file *m, void *v)
 		nstr[notify & ~SIGEV_THREAD_ID],
 		(notify & SIGEV_THREAD_ID) ? "tid" : "pid",
 		pid_nr_ns(timer->it_pid, tp->ns));
+	seq_printf(m, "ClockID: %d\n", timer->it_clock);
 
 	return 0;
 }
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH 1/1] posix-timers: Show clock ID in proc file

Quoted 14 lines · Pavel Tikhomirov

Expand information about posix-timers in /proc/<pid>/timers by adding info about clock, with which the timer was created. I.e. in the forth line of timer info after "notify:" line go "ClockID: <clock_id>".

---
 fs/proc/base.c |    1 +
 1 file changed, 1 insertion(+)
fs/proc/base.c +0 -0
index 2dad4a9..8a38eef 100644

fs/proc/base.c static int show_timer(struct seq_file *m, void *v) · line 2082

Quoted 4 lines
fs/proc/base.c +1 -0
@@ -2079,6 +2079,7 @@ static int show_timer(struct seq_file *m, void *v)
 		nstr[notify & ~SIGEV_THREAD_ID],
 		(notify & SIGEV_THREAD_ID) ? "tid" : "pid",
 		pid_nr_ns(timer->it_pid, tp->ns));
+	seq_printf(m, "ClockID: %d\n", timer->it_clock);

What userspace tool just broke by adding a new field to this file?

thanks,

greg k-h

#3 lore raw

Re: [PATCH 1/1] posix-timers: Show clock ID in proc file

Quoted 10 lines · Greg KH
Quoted 9 lines · Pavel Tikhomirov

Expand information about posix-timers in /proc/<pid>/timers by adding info about clock, with which the timer was created. I.e. in the forth line of timer info after "notify:" line go "ClockID: <clock_id>".

---
 fs/proc/base.c |    1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

fs/proc/base.c static int show_timer(struct seq_file *m, void *v) · line 2082

Quoted 9 lines
fs/proc/base.c +1 -0
index 2dad4a9..8a38eef 100644
@@ -2079,6 +2079,7 @@ static int show_timer(struct seq_file *m, void *v)
 		nstr[notify & ~SIGEV_THREAD_ID],
 		(notify & SIGEV_THREAD_ID) ? "tid" : "pid",
 		pid_nr_ns(timer->it_pid, tp->ns));
+	seq_printf(m, "ClockID: %d\n", timer->it_clock);

What userspace tool just broke by adding a new field to this file?

Zero for two reasons:

1. this proc file appeared this merge window
2. this file format is

<name>: <value>

and should be parsed line-by-line by applications like e.g. /proc/pid/status or /proc/pid/smaps. Both these files were extended with fields in the past with no worries to tools, so should be this new one.

Quoted 5 lines

thanks,

greg k-h
.

Thanks,
Pavel

#4 lore raw

Re: [PATCH 1/1] posix-timers: Show clock ID in proc file

Quoted 25 lines · Pavel Emelyanov
Quoted 10 lines · Greg KH
Quoted 9 lines · Pavel Tikhomirov

Expand information about posix-timers in /proc/<pid>/timers by adding info about clock, with which the timer was created. I.e. in the forth line of timer info after "notify:" line go "ClockID: <clock_id>".

---
 fs/proc/base.c |    1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

fs/proc/base.c static int show_timer(struct seq_file *m, void *v) · line 2082

Quoted 9 lines
fs/proc/base.c +1 -0
index 2dad4a9..8a38eef 100644
@@ -2079,6 +2079,7 @@ static int show_timer(struct seq_file *m, void *v)
 		nstr[notify & ~SIGEV_THREAD_ID],
 		(notify & SIGEV_THREAD_ID) ? "tid" : "pid",
 		pid_nr_ns(timer->it_pid, tp->ns));
+	seq_printf(m, "ClockID: %d\n", timer->it_clock);

What userspace tool just broke by adding a new field to this file?

Zero for two reasons:

Quoted 8 lines

1. this proc file appeared this merge window
2. this file format is

<name>: <value>

and should be parsed line-by-line by applications like e.g. /proc/pid/status or /proc/pid/smaps. Both these files were extended with fields in the past with no worries to tools, so should be this new one.

Ok, just making sure :)

Acked-by on v1 1/1
#5 lore raw

Re: [PATCH 1/1] posix-timers: Show clock ID in proc file

In reply to Pavel Tikhomirov
Quoted 5 lines · Pavel Tikhomirov

Expand information about posix-timers in /proc/<pid>/timers by adding info about clock, with which the timer was created. I.e. in the forth line of timer info after "notify:" line go "ClockID: <clock_id>".

Quoted 17 lines
---
 fs/proc/base.c |    1 +
 1 file changed, 1 insertion(+)
fs/proc/base.c +1 -0
index 2dad4a9..8a38eef 100644
@@ -2079,6 +2079,7 @@ static int show_timer(struct seq_file *m, void *v)
 		nstr[notify & ~SIGEV_THREAD_ID],
 		(notify & SIGEV_THREAD_ID) ? "tid" : "pid",
 		pid_nr_ns(timer->it_pid, tp->ns));
+	seq_printf(m, "ClockID: %d\n", timer->it_clock);
 
 	return 0;
 }
#6 lore raw

[tip:timers/urgent] posix-timers: Show clock ID in proc file

In reply to Pavel Tikhomirov
posix-timers: Show clock ID in proc file
Commit-ID:  15ef0298deb3929eb6ad6d2334fd2059fd53807c
Gitweb:     http://git.kernel.org/tip/15ef0298deb3929eb6ad6d2334fd2059fd53807c
Author:     Pavel Tikhomirov <[email protected]>
AuthorDate: Fri, 17 May 2013 02:12:03 +0400
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 28 May 2013 11:41:14 +0200

posix-timers: Show clock ID in proc file

Expand information about posix-timers in /proc/<pid>/timers by adding info about clock, with which the timer was created. I.e. in the forth line of timer info after "notify:" line go "ClockID: <clock_id>".

---
 fs/proc/base.c | 1 +
 1 file changed, 1 insertion(+)
fs/proc/base.c +1 -0
index dd51e50..c3834da 100644
@@ -2118,6 +2118,7 @@ static int show_timer(struct seq_file *m, void *v)
 		nstr[notify & ~SIGEV_THREAD_ID],
 		(notify & SIGEV_THREAD_ID) ? "tid" : "pid",
 		pid_nr_ns(timer->it_pid, tp->ns));
+	seq_printf(m, "ClockID: %d\n", timer->it_clock);
 
 	return 0;
 }