#include <ipxe/settings.h>
#include <ipxe/dhcp.h>
#include <ipxe/uri.h>
+#include <ipxe/profile.h>
#include <ipxe/tftp.h>
/** @file
/** Maximum number of MTFTP open requests before falling back to TFTP */
#define MTFTP_MAX_TIMEOUTS 3
+/** Client profiler */
+static struct profiler tftp_client_profiler __profiler =
+ { .name = "tftp.client" };
+
+/** Server profiler */
+static struct profiler tftp_server_profiler __profiler =
+ { .name = "tftp.server" };
+
/**
* Free TFTP request
*
}
block += ( ntohs ( data->block ) - 1 );
+ /* Stop profiling server turnaround if applicable */
+ if ( block )
+ profile_stop ( &tftp_server_profiler );
+
/* Extract data */
offset = ( block * tftp->blksize );
iob_pull ( iobuf, sizeof ( *data ) );
/* Acknowledge block */
tftp_send_packet ( tftp );
+ /* Stop profiling client turnaround */
+ profile_stop ( &tftp_client_profiler );
+
+ /* Start profiling server turnaround */
+ profile_start ( &tftp_server_profiler );
+
/* If all blocks have been received, finish. */
if ( bitmap_full ( &tftp->bitmap ) )
tftp_done ( tftp, 0 );
struct tftp_common *common = iobuf->data;
size_t len = iob_len ( iobuf );
int rc = -EINVAL;
-
+
+ /* Start profiling client turnaround */
+ profile_start ( &tftp_client_profiler );
+
/* Sanity checks */
if ( len < sizeof ( *common ) ) {
DBGC ( tftp, "TFTP %p received underlength packet length "