Skip to content

Commit

Permalink
pkg/datapath/loader: log versions
Browse files Browse the repository at this point in the history
Signed-off-by: Lehner Florian <dev@der-flo.net>
  • Loading branch information
florianl authored and joestringer committed Feb 25, 2020
1 parent e075f8c commit 3b055d1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pkg/datapath/loader/compile.go
Expand Up @@ -283,9 +283,23 @@ func compile(ctx context.Context, prog *progInfo, dir *directoryInfo, debug bool
// * Assembly
// * Object compiled with debug symbols
func compileDatapath(ctx context.Context, dirs *directoryInfo, debug bool, logger *logrus.Entry) error {
// TODO: Consider logging kernel/clang versions here too
scopedLog := logger.WithField(logfields.Debug, debug)

versionCmd := exec.CommandContext(ctx, compiler, "--version")
compilerVersion, err := versionCmd.CombinedOutput(scopedLog, debug)
if err != nil {
return err
}
versionCmd = exec.CommandContext(ctx, linker, "--version")
linkerVersion, err := versionCmd.CombinedOutput(scopedLog, debug)
if err != nil {
return err
}
scopedLog.WithFields(logrus.Fields{
compiler: string(compilerVersion),
linker: string(linkerVersion),
}).Debug("Compiling datapath")

// Write out assembly and preprocessing files for debugging purposes
if debug {
for _, p := range debugProgs {
Expand Down

0 comments on commit 3b055d1

Please sign in to comment.