slirp: add tftp tracing

Useful when debugging pxeboot, to see what the guest tries to do.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
Gerd Hoffmann 2018-11-13 08:03:20 +01:00 committed by Samuel Thibault
parent 8d05f09922
commit 9a50b0e0b8
3 changed files with 9 additions and 0 deletions

View File

@ -193,6 +193,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

View File

@ -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) {

5
slirp/trace-events Normal file
View File

@ -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"