From 94984a846166c7ac927fcfcb2b34c1bfeabf8fcf Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 25 Apr 2018 14:10:46 -0600 Subject: [PATCH] util/x86/x86_page_tables: add command line to generated files In order to help the reader understand where things are generated from add a comment string that is composed of the command line used to generate the files. BUG=b:72728953 Change-Id: I1b93923f8b08192448ab19226fd27661cc09e853 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/25834 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Paul Menzel --- util/x86/x86_page_tables.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/util/x86/x86_page_tables.go b/util/x86/x86_page_tables.go index 22793654f0..2dc0ed36ff 100644 --- a/util/x86/x86_page_tables.go +++ b/util/x86/x86_page_tables.go @@ -23,6 +23,7 @@ import "fmt" import "io" import "log" import "os" +import "path/filepath" import "sort" import "strconv" import "strings" @@ -174,8 +175,13 @@ func (cw *cWriter) WritePageEntry(data interface{}) error { if cw.currentIndex == 0 { if _, err := fmt.Fprint(cw.wr, generatedCodeLicense); err != nil { - return err - } + return err + } + if _, err := fmt.Fprintf(cw.wr, "/* Generated by:\n util/x86/%s %s\n */\n", + filepath.Base(os.Args[0]), + strings.Join(os.Args[1:], " ")); err != nil { + return err + } includes := []string{ "stdint.h", }