From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNKU8-0002Dl-QW for qemu-devel@nongnu.org; Thu, 06 Aug 2015 08:41:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNKU8-0008RH-20 for qemu-devel@nongnu.org; Thu, 06 Aug 2015 08:41:24 -0400 Received: from mail-qg0-x230.google.com ([2607:f8b0:400d:c04::230]:33168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNKU7-0008R9-Tm for qemu-devel@nongnu.org; Thu, 06 Aug 2015 08:41:23 -0400 Received: by qged69 with SMTP id d69so51471120qge.0 for ; Thu, 06 Aug 2015 05:41:23 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: marcandre.lureau@redhat.com Date: Thu, 6 Aug 2015 14:40:46 +0200 Message-Id: <1438864852-4939-11-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1438864852-4939-1-git-send-email-marcandre.lureau@redhat.com> References: <1438864852-4939-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v3 10/16] net: add trace_vhost_user_event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: haifeng.lin@huawei.com, mst@redhat.com, thibaut.collet@6wind.com, jasowang@redhat.com, pbonzini@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-André Lureau Replace error_report() and use tracing instead. Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 5 +++-- trace-events | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index dc0aa4c..5657992 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -14,6 +14,7 @@ #include "sysemu/char.h" #include "qemu/config-file.h" #include "qemu/error-report.h" +#include "trace.h" typedef struct VhostUserState { NetClientState nc; @@ -123,16 +124,16 @@ static void net_vhost_user_event(void *opaque, int event) { VhostUserState *s = opaque; + trace_vhost_user_event(s->chr->label, event); + switch (event) { case CHR_EVENT_OPENED: vhost_user_start(s); net_vhost_link_down(s, false); - error_report("chardev \"%s\" went up", s->chr->label); break; case CHR_EVENT_CLOSED: net_vhost_link_down(s, true); vhost_user_stop(s); - error_report("chardev \"%s\" went down", s->chr->label); break; } } diff --git a/trace-events b/trace-events index 94bf3bb..a07b715 100644 --- a/trace-events +++ b/trace-events @@ -1654,3 +1654,6 @@ alsa_no_frames(int state) "No frames available and ALSA state is %d" # audio/ossaudio.c oss_version(int version) "OSS version = %#x" oss_invalid_available_size(int size, int bufsize) "Invalid available size, size=%d bufsize=%d" + +# net/vhost-user.c +vhost_user_event(const char *chr, int event) "chr: %s got event: %d" -- 2.4.3