From: Dave Hansen <dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>
Cc: containers
<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Dave Hansen
<dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
Alexey Dobriyan
<adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [RFC][PATCH 5/5] add c/r info to fdinfo
Date: Thu, 19 Feb 2009 10:20:13 -0800 [thread overview]
Message-ID: <20090219182013.28FF8F42@kernel> (raw)
In-Reply-To: <20090219182007.B4B47C1F@kernel>
Use the new checkpoint/restart file functions to query
and report on each fd in the /proc/$$/fdinfo/X file.
This should provide an easy way to examine processes
at runtime to see what exactly is causing their inability
to checkpoint.
Signed-off-by: Dave Hansen <dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
linux-2.6.git-dave/fs/proc/base.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff -puN fs/proc/base.c~add-cr-part-to-fdinfo fs/proc/base.c
--- linux-2.6.git/fs/proc/base.c~add-cr-part-to-fdinfo 2009-02-19 10:17:26.000000000 -0800
+++ linux-2.6.git-dave/fs/proc/base.c 2009-02-19 10:17:26.000000000 -0800
@@ -79,6 +79,7 @@
#include <linux/oom.h>
#include <linux/elf.h>
#include <linux/pid_namespace.h>
+#include <linux/checkpoint.h>
#include "internal.h"
/* NOTE:
@@ -1601,6 +1602,7 @@ out:
static void proc_fd_write_info(struct file *file, char *info)
{
+ int checkpointable;
int max = PROC_FDINFO_MAX;
int p = 0;
if (!info)
@@ -1608,6 +1610,12 @@ static void proc_fd_write_info(struct fi
p += snprintf(info+p, max-p, "pos:\t%lli\n", (long long) file->f_pos);
p += snprintf(info+p, max-p, "flags:\t0%o\n", file->f_flags);
+
+ checkpointable = cr_file_supported(file);
+ p += snprintf(info+p, max-p, "checkpointable:\t%d", checkpointable);
+ if (!checkpointable)
+ p += cr_explain_file(file, info+p, max-p);
+ p += snprintf(info+p, max-p, "\n");
}
static int proc_fd_info(struct inode *inode, struct path *path, char *info)
_
next prev parent reply other threads:[~2009-02-19 18:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-19 18:20 [RFC][PATCH 1/5] create fs flag to mark c/r supported fs's Dave Hansen
2009-02-19 18:20 ` [RFC][PATCH 2/5] file c/r: expose functions to query fs support Dave Hansen
2009-02-19 18:20 ` [RFC][PATCH 3/5] check files for checkpointability Dave Hansen
2009-02-23 23:49 ` Serge E. Hallyn
[not found] ` <20090223234911.GB2590@us.ibm.com>
[not found] ` <20090223234911.GB2590-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-02-24 0:30 ` Dave Hansen
[not found] ` <1235435430.26788.212.camel@nimitz>
2009-02-24 1:10 ` Serge E. Hallyn
[not found] ` <20090224011037.GB4797@us.ibm.com>
[not found] ` <20090224011037.GB4797-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-02-24 1:20 ` Dave Hansen
[not found] ` <1235438459.26788.222.camel@nimitz>
2009-02-24 19:43 ` Serge E. Hallyn
[not found] ` <20090224194329.GC24007@us.ibm.com>
[not found] ` <20090224194329.GC24007-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-02-24 19:47 ` Dave Hansen
2009-02-19 18:20 ` [RFC][PATCH 4/5] breakout fdinfo sprintf() into its own function Dave Hansen
2009-02-19 18:20 ` Dave Hansen [this message]
2009-02-19 18:23 ` [RFC][PATCH 1/5] create fs flag to mark c/r supported fs's Dave Hansen
2009-02-19 19:00 ` Christoph Hellwig
[not found] ` <20090219190009.GC28490-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2009-02-19 19:24 ` Dave Hansen
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=20090219182013.28FF8F42@kernel \
--to=dave-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
--cc=adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mingo-X9Un+BFzKDI@public.gmane.org \
/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