slirp: add tftp tracing
PATCH 1/1 slirp: add tftp tracing
Useful when debugging pxeboot, to see what the guest tries to do.
Signed-off-by Gerd Hoffmann <[email protected]>
--- Makefile.objs | 1 + slirp/tftp.c | 3 +++ slirp/trace-events | 5 +++++ 3 files changed, 9 insertions(+) create mode 100644 slirp/trace-events
Makefile.objs +1 -0
@@ -251,6 +251,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
slirp/tftp.c +3 -0
@@ -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 ) {
slirp/trace-events new file +5 -0
@@ -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"
Signature · 1 line
2.9.3
Quoted 3 lines · Gerd Hoffmann
Useful when debugging pxeboot, to see what the guest tries to do.
Signed-off-by Gerd Hoffmann <[email protected]>
Reviewed-by Liam Merwick <[email protected]>
Quoted 59 lines
--- Makefile.objs | 1 + slirp/tftp.c | 3 +++ slirp/trace-events | 5 +++++ 3 files changed, 9 insertions(+)create mode 100644 slirp/trace-events
Makefile.objs +1
-0@@ -251,6 +251,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/mipsslirp/tftp.c +3
-0@@ -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 ) {slirp/trace-events new file +5
-0@@ -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"
Quoted 1 line · Gerd Hoffmann
Useful when debugging pxeboot, to see what the guest tries to do.
Good idea!
Quoted 2 lines
Signed-off-by Gerd Hoffmann <[email protected]>
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Quoted 59 lines
--- Makefile.objs | 1 + slirp/tftp.c | 3 +++ slirp/trace-events | 5 +++++ 3 files changed, 9 insertions(+)create mode 100644 slirp/trace-events
Makefile.objs +1
-0@@ -251,6 +251,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/mipsslirp/tftp.c +3
-0@@ -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 ) {slirp/trace-events new file +5
-0@@ -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"
Samuel Thibault
AppliedGerd Hoffmann, le mar. 13 nov. 2018 08:03:20 +0100, a ecrit:
Quoted 1 line
Useful when debugging pxeboot, to see what the guest tries to do.
Applied to my tree, thanks!
Samuel