Przeglądaj źródła

[pxe] Profile UNDI transmit datapath

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 lat temu
rodzic
commit
90caf71051
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8
    0
      src/arch/i386/interface/pxe/pxe_undi.c

+ 8
- 0
src/arch/i386/interface/pxe/pxe_undi.c Wyświetl plik

@@ -38,6 +38,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
38 38
 #include <ipxe/ip.h>
39 39
 #include <ipxe/arp.h>
40 40
 #include <ipxe/rarp.h>
41
+#include <ipxe/profile.h>
41 42
 #include "pxe.h"
42 43
 
43 44
 /**
@@ -53,6 +54,9 @@ static int undi_tx_count = 0;
53 54
 
54 55
 struct net_device *pxe_netdev = NULL;
55 56
 
57
+/** Transmit profiler */
58
+static struct profiler undi_tx_profiler __profiler = { .name = "undi.tx" };
59
+
56 60
 /**
57 61
  * Set network device as current PXE network device
58 62
  *
@@ -309,6 +313,9 @@ pxenv_undi_transmit ( struct s_PXENV_UNDI_TRANSMIT *undi_transmit ) {
309 313
 	unsigned int i;
310 314
 	int rc;
311 315
 
316
+	/* Start profiling */
317
+	profile_start ( &undi_tx_profiler );
318
+
312 319
 	/* Sanity check */
313 320
 	if ( ! pxe_netdev ) {
314 321
 		DBGC ( &pxe_netdev, "PXENV_UNDI_TRANSMIT called with no "
@@ -422,6 +429,7 @@ pxenv_undi_transmit ( struct s_PXENV_UNDI_TRANSMIT *undi_transmit ) {
422 429
 		return PXENV_EXIT_FAILURE;
423 430
 	}
424 431
 
432
+	profile_stop ( &undi_tx_profiler );
425 433
 	undi_transmit->Status = PXENV_STATUS_SUCCESS;
426 434
 	return PXENV_EXIT_SUCCESS;
427 435
 }

Ładowanie…
Anuluj
Zapisz