From patchwork Tue Dec 18 23:03:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1015694 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43KDHN1Y3Vz9s6w for ; Wed, 19 Dec 2018 10:09:20 +1100 (AEDT) Received: from localhost ([::1]:56669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZOUH-0002bF-P3 for incoming@patchwork.ozlabs.org; Tue, 18 Dec 2018 18:09:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZOQG-0007xF-6q for qemu-devel@nongnu.org; Tue, 18 Dec 2018 18:05:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZOQD-0004CU-Gw for qemu-devel@nongnu.org; Tue, 18 Dec 2018 18:05:07 -0500 Received: from hera.aquilenet.fr ([2a0c:e300::1]:57432) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZOQC-00044b-17 for qemu-devel@nongnu.org; Tue, 18 Dec 2018 18:05:05 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 0216427AB; Wed, 19 Dec 2018 00:04:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JhfoiE367ISN; Wed, 19 Dec 2018 00:04:54 +0100 (CET) Received: from function.home (unknown [IPv6:2a01:cb19:181:c200:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 3835427E5; Wed, 19 Dec 2018 00:04:44 +0100 (CET) Received: from samy by function.home with local (Exim 4.91) (envelope-from ) id 1gZOPq-0007Hu-OX; Wed, 19 Dec 2018 00:04:42 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Wed, 19 Dec 2018 00:03:50 +0100 Message-Id: <20181218230442.27887-13-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181218230442.27887-1-samuel.thibault@ens-lyon.org> References: <20181218230442.27887-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a0c:e300::1 Subject: [Qemu-devel] [PULL 12/64] slirp: add tftp tracing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jan.kiszka@siemens.com, Gerd Hoffmann , stefanha@redhat.com, Samuel Thibault Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Useful when debugging pxeboot, to see what the guest tries to do. Signed-off-by: Gerd Hoffmann Reviewed-by: Liam Merwick Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Samuel Thibault --- Makefile.objs | 1 + slirp/tftp.c | 3 +++ slirp/trace-events | 5 +++++ 3 files changed, 9 insertions(+) create mode 100644 slirp/trace-events diff --git a/Makefile.objs b/Makefile.objs index 56af0347d3..7f777a4908 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -190,6 +190,7 @@ trace-events-subdirs += net trace-events-subdirs += qapi trace-events-subdirs += qom trace-events-subdirs += scsi +trace-events-subdirs += slirp trace-events-subdirs += target/arm trace-events-subdirs += target/i386 trace-events-subdirs += target/mips diff --git a/slirp/tftp.c b/slirp/tftp.c index a9bc4bb1b6..735b57aa55 100644 --- a/slirp/tftp.c +++ b/slirp/tftp.c @@ -26,6 +26,7 @@ #include "slirp.h" #include "qemu-common.h" #include "qemu/cutils.h" +#include "trace.h" static inline int tftp_session_in_use(struct tftp_session *spt) { @@ -204,6 +205,7 @@ static void tftp_send_error(struct tftp_session *spt, struct mbuf *m; struct tftp_t *tp; + trace_slirp_tftp_error(msg); m = m_get(spt->slirp); if (!m) { @@ -323,6 +325,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas, break; } } + trace_slirp_tftp_rrq(req_fname); /* check mode */ if ((pktlen - k) < 6) { diff --git a/slirp/trace-events b/slirp/trace-events new file mode 100644 index 0000000000..ff8f656e8c --- /dev/null +++ b/slirp/trace-events @@ -0,0 +1,5 @@ +# See docs/devel/tracing.txt for syntax documentation. + +# slirp/tftp.c +slirp_tftp_rrq(const char *file) "file: %s" +slirp_tftp_error(const char *file) "msg: %s"