Skip to contentSkip to conversation

slirp: add tftp tracing

PATCH Applied Gerd Hoffmann 4 participants 4 messages Nov 13, 2018 – Nov 14, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 slirp: add tftp tracing

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

---
 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
index 1e1ff387d7..31852eaf8f 100644
@@ -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
index a9bc4bb1b6..735b57aa55 100644
@@ -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
new file mode 100644
index 0000000000..ff8f656e8c
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Gerd Hoffmann

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

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
index 1e1ff387d7..31852eaf8f 100644
@@ -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
index a9bc4bb1b6..735b57aa55 100644
@@ -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
new file mode 100644
index 0000000000..ff8f656e8c
@@ -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"
Reviewed-by Tested-by on v1 1/1
#2 lore raw
In reply to Gerd Hoffmann
Quoted 1 line · Gerd Hoffmann

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

Good idea!

Quoted 2 lines
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
index 1e1ff387d7..31852eaf8f 100644
@@ -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
index a9bc4bb1b6..735b57aa55 100644
@@ -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
new file mode 100644
index 0000000000..ff8f656e8c
@@ -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"
#3 lore raw
In reply to Gerd Hoffmann

Gerd 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