From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UufNK-0006S5-Oa for qemu-devel@nongnu.org; Thu, 04 Jul 2013 04:58:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UufNJ-0005p3-8u for qemu-devel@nongnu.org; Thu, 04 Jul 2013 04:58:50 -0400 Received: from mail-ea0-x231.google.com ([2a00:1450:4013:c01::231]:33283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UufNJ-0005ow-1N for qemu-devel@nongnu.org; Thu, 04 Jul 2013 04:58:49 -0400 Received: by mail-ea0-f177.google.com with SMTP id j14so621488eak.22 for ; Thu, 04 Jul 2013 01:58:48 -0700 (PDT) Date: Thu, 4 Jul 2013 10:58:45 +0200 From: Stefan Hajnoczi Message-ID: <20130704085845.GE2945@stefanha-thinkpad.redhat.com> References: <51D4E5D6.6050404@hds.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51D4E5D6.6050404@hds.com> Subject: Re: [Qemu-devel] [PATCH v6] add timestamp to error_report() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Seiji Aguchi Cc: kwolf@redhat.com, aliguori@us.ibm.com, mtosatti@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, dle-develop@lists.sourceforge.net, tomoki.sekiyama@hds.com, pbonzini@redhat.com, lcapitulino@redhat.com, lersek@redhat.com On Wed, Jul 03, 2013 at 11:02:46PM -0400, Seiji Aguchi wrote: > [Issue] > When we offer a customer support service and a problem happens > in a customer's system, we try to understand the problem by > comparing what the customer reports with message logs of the > customer's system. > > In this case, we often need to know when the problem happens. > > But, currently, there is no timestamp in qemu's error messages. > Therefore, we may not be able to understand the problem based on > error messages. > > [Solution] > Add a timestamp to qemu's error message logged by > error_report() with g_time_val_to_iso8601(). > > Signed-off-by: Seiji Aguchi > --- > Changelog > v5 -> v6 > - Remove include/qemu/time.h and utils/qemu-time.c. > - Fix a syntax and indent of messages in msg option's DEF(). > - Change explanation of the msg option. > > v4 -> v5 > - Fix descriptions of msg option. > - Rename TIME_H to QEMU_TIME_H. (avoiding double inclusion of qemu/time.h) > - Change argument of qemu_get_timestamp_str to "char *" and "size_t". > - Confirmed msg option is displayed by query-command-line-options. > > v3 -> v4 > - Correct email address of Signed-off-by. > > v2 -> v3 > - Use g_time_val_to_iso8601() to get timestamp instead of > copying libvirt's time-handling functions. > > According to discussion below, qemu doesn't need to take care > if timestamp functions are async-signal safe or not. > > http://marc.info/?l=qemu-devel&m=136741841921265&w=2 > > Also, In the review of v2 patch, strftime() are recommended to > format string. But it is not a suitable function to handle msec. > > Then, simply call g_time_val_to_iso8601(). > > - Intoroduce a common time-handling function to util/qemu-time.c. > (Suggested by Daniel P. Berrange) > > - Add testing for g_time_val_to_iso8601() to tests/test-time.c. > The test cases are copied from libvirt's virtimetest. > (Suggested by Daniel P. Berrange) > > v1 -> v2 > > - add an option, -msg timestamp={on|off}, to enable output message with timestamp > --- > include/qemu/error-report.h | 2 ++ > qemu-options.hx | 11 +++++++++++ > util/qemu-error.c | 10 ++++++++++ > vl.c | 26 ++++++++++++++++++++++++++ > 4 files changed, 49 insertions(+), 0 deletions(-) Reviewed-by: Stefan Hajnoczi