Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
To: serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH 01/12] define a new set of functions for error and debug logging
Date: Tue, 03 Nov 2009 11:58:35 -0500	[thread overview]
Message-ID: <4AF0613B.2030804@librato.com> (raw)
In-Reply-To: <1257200620-15499-2-git-send-email-serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>



serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org wrote:
> From: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> 
> The checkpoint context now includes buffers for an expanded
> format and for messages to be written out.  A mutex protects
> these buffers as they are being built up and written out.
> ckpt_msg() will write general informative (debug) messages to
> syslog and an optional user-provided logfile.  ckpt_err() will
> write errors to the same places, and, if it is a checkpoint
> operation, also to the checkpoint image.
> 
> (This is intended to implement Oren's suggestion verbatim)
> 
> Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

[...]

> +void _ckpt_msg_complete(struct ckpt_ctx *ctx)
> +{
> +	int ret;
> +
> +	if (ctx->kflags & CKPT_CTX_CHECKPOINT) {
> +		ret = ckpt_write_obj_type(ctx, NULL, 0, CKPT_HDR_ERROR);

The _ckpt_msg_... interface is (will be?) used also for non-errors.
So writing and error record should also depend on ctx->errno, to be
set by someone before (ckpt_err ?)

> +		if (!ret)
> +			ret = ckpt_write_string(ctx, ctx->msg, ctx->msglen);
> +		if (ret < 0)
> +			printk(KERN_NOTICE "c/r: error string unsaved (%d): %s\n",
> +			       ret, ctx->msg+1);
> +	}
> +#if 0
> +	if (ctx->logfile) {
> +		mm_segment_t fs = get_fs();
> +		set_fs(KERNEL_DS);
> +		ret = _ckpt_kwrite(ctx->logfile, ctx->msg+1, ctx->msglen-1);
> +		set_fs(fs);
> +	}
> +#endif

This piece perhaps belongs to another patch ?

[...]

Oren.

  parent reply	other threads:[~2009-11-03 16:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 22:23 [PATCH 00/12] Standardize c/r error reporting (v3) serue-r/Jw6+rmf7HQT0dZR+AlfA
     [not found] ` <1257200620-15499-1-git-send-email-serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-11-02 22:23   ` [PATCH 01/12] define a new set of functions for error and debug logging serue-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]     ` <1257200620-15499-2-git-send-email-serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-11-02 23:24       ` Matt Helsley
     [not found]         ` <20091102232439.GK14023-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2009-11-03  2:39           ` Serge E. Hallyn
     [not found]             ` <20091103023959.GA19697-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-11-03  7:24               ` Matt Helsley
2009-11-03 16:58       ` Oren Laadan [this message]
2009-11-02 22:23   ` [PATCH 02/12] switch ckpt_write_err callers to ckpt_err serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-02 22:23   ` [PATCH 03/12] checkpoint/files.c ckpt_write_err->ckpt_err serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-02 22:23   ` [PATCH 04/12] checkpoint/memory.c ckpt_write_err->ckpt_err serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-02 22:23   ` [PATCH 05/12] checkpoint/objhash.c ckpt_write_err->ckpt_err serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-02 22:23   ` [PATCH 06/12] checkpoint/process.c ckpt_write_err->ckpt_err serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-02 22:23   ` [PATCH 07/12] checkpoint/signal.c ckpt_write_err->ckpt_err serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-02 22:23   ` [PATCH 08/12] drivers/char/tty_io.c ckpt_write_err->ckpt_err serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-02 22:23   ` [PATCH 09/12] fs/eventpoll.c ckpt_write_err->ckpt_err serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-02 22:23   ` [PATCH 10/12] net/{,unix}/checkpoint.c ckpt_write_err->ckpt_err serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-02 22:23   ` [PATCH 11/12] remove ckpt_write_err serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-02 22:23   ` [PATCH 12/12] add logfd to c/r api serue-r/Jw6+rmf7HQT0dZR+AlfA
2009-11-03 16:51   ` [PATCH 00/12] Standardize c/r error reporting (v3) Oren Laadan

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=4AF0613B.2030804@librato.com \
    --to=orenl-rdfvbdnroixbdgjk7y7tuq@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@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