From 63c4bab4d14146de7864f06019e6750cf627eb63 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 1 Mar 2017 20:57:47 -0800 Subject: [PATCH] Add a debug log entry in DHCP before fetching the bootspec. Adding this line lets us time the bootspec retrieval by comparing the timestamps of "Got valid request..." and "Offering to boot..." --- pixiecore/dhcp.go | 2 ++ pixiecore/pixiecore.go | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/pixiecore/dhcp.go b/pixiecore/dhcp.go index 27c6450..0a8251c 100644 --- a/pixiecore/dhcp.go +++ b/pixiecore/dhcp.go @@ -42,6 +42,8 @@ func (s *Server) serveDHCP(conn *dhcp4.Conn) error { continue } + s.debug("DHCP", "Got valid request to boot %s (%s)", mach.MAC, mach.Arch) + spec, err := s.Booter.BootSpec(mach) if err != nil { s.log("DHCP", "Couldn't get bootspec for %s: %s", pkt.HardwareAddr, err) diff --git a/pixiecore/pixiecore.go b/pixiecore/pixiecore.go index 62db82c..aece793 100644 --- a/pixiecore/pixiecore.go +++ b/pixiecore/pixiecore.go @@ -53,6 +53,17 @@ const ( ArchX64 ) +func (a Architecture) String() string { + switch a { + case ArchIA32: + return "IA32" + case ArchX64: + return "X64" + default: + return "Unknown architecture" + } +} + // A Machine describes a machine that is attempting to boot. type Machine struct { MAC net.HardwareAddr