From: Dave Hansen <dave@linux.vnet.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: containers <containers@lists.linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Serge E. Hallyn" <serue@us.ibm.com>,
Oren Laadan <orenl@cs.columbia.edu>,
Alexey Dobriyan <adobriyan@gmail.com>,
Dave Hansen <dave@linux.vnet.ibm.com>
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@linux.vnet.ibm.com>
---
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:22 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
2009-02-24 0:30 ` Dave Hansen
2009-02-24 1:10 ` Serge E. Hallyn
2009-02-24 1:20 ` Dave Hansen
2009-02-24 19:43 ` Serge E. Hallyn
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
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@linux.vnet.ibm.com \
--cc=adobriyan@gmail.com \
--cc=containers@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=orenl@cs.columbia.edu \
--cc=serue@us.ibm.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