Remove kernel path and hostname from #version
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 13 May 2016 18:16:55 +0000 (14:16 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 16 Jun 2016 15:48:36 +0000 (11:48 -0400)
Perf had been using the kernel path so that it could emit it in
perf.data.  We no longer need that.  The kernel path was the path on the
machine on which the kernel was built, which assumes the perf report would
be analyzed on that same machine.

Likewise, this removes the hostname from #version.  This hostname wasn't
the name of the Akaros machine; it was the name of the machine on which
Akaros was built.  I don't see a good reason to keep this around.

If we need either of these in the future, we can probably replace it with
build-id (from the linker).

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/riscv/Makefile
kern/arch/x86/Makefile
kern/drivers/dev/version.c
kern/include/build_info.h
kern/src/Kbuild

index 4bbb35c..2bd6e7e 100644 (file)
@@ -1,7 +1,3 @@
 CROSS_COMPILE := riscv-ucb-akaros-
 # basically a nop.  this runs post-link of the kernel
 ARCH_POST_LINK_CMD = echo -n
-
-# Machinery to create the kernel build info source
-KERNEL_ELF_PATH := $(abspath $(KERNEL_OBJ))
-export KERNEL_ELF_PATH
index 2d121f6..e1fdaaa 100644 (file)
@@ -8,9 +8,5 @@ LDFLAGS_KERNEL += -z max-page-size=0x1000
 # Need to change the format to 32 bit, to trick multiboot/grub1 into loading
 ARCH_POST_LINK_CMD = cp $@ $@-64b; $(OBJCOPY) -I elf64-x86-64 -O elf32-i386 $@
 
-# Machinery to create the kernel build info source
-KERNEL_ELF_PATH := $(abspath $(KERNEL_OBJ))-64b
-export KERNEL_ELF_PATH
-
 # BITS is used in Kbuilds, so we can select bit-specific source files.
 export BITS
index e65d9bd..455cd7e 100644 (file)
@@ -16,9 +16,7 @@
 
 enum {
        Kverdirqid = 0,
-       Kverkernelpath,
        Kverdate,
-       Kverhost,
        Kvercommitid,
        Kverversion,
        Kverversionname,
@@ -27,9 +25,7 @@ enum {
 struct dev verdevtab;
 static struct dirtab vertab[] = {
        {".",                           {Kverdirqid,            0, QTDIR}, 0,   DMDIR|0550},
-       {"kernel_path",         {Kverkernelpath},       0,      0444},
        {"date",                        {Kverdate},                     0,      0444},
-       {"host",                        {Kverhost},                     0,      0444},
        {"commitid",            {Kvercommitid},         0,      0444},
        {"version",                     {Kverversion},          0,      0444},
        {"version_name",        {Kverversionname},      0,      0444},
@@ -96,18 +92,10 @@ static long ver_read(struct chan *c, void *va, long n, int64_t off)
        switch ((int) c->qid.path) {
        case Kverdirqid:
                return devdirread(c, va, n, vertab, ARRAY_SIZE(vertab), devgen);
-       case Kverkernelpath:
-               if (build_info_kernel_path)
-                       return ver_emit_nlstr(va, build_info_kernel_path, n, (long) off);
-               break;
        case Kverdate:
                if (build_info_date)
                        return ver_emit_nlstr(va, build_info_date, n, (long) off);
                break;
-       case Kverhost:
-               if (build_info_host)
-                       return ver_emit_nlstr(va, build_info_host, n, (long) off);
-               break;
        case Kvercommitid:
                if (build_info_commitid)
                        return ver_emit_nlstr(va, build_info_commitid, n, (long) off);
index bc44f35..4bac2dc 100644 (file)
@@ -7,9 +7,7 @@
 
 #include <compiler.h>
 
-extern const char __weak build_info_kernel_path[];
 extern const char __weak build_info_date[];
-extern const char __weak build_info_host[];
 extern const char __weak build_info_commitid[];
 extern const char __weak build_info_version[];
 extern const char __weak build_info_version_name[];
index 90be22d..9381b18 100644 (file)
@@ -9,12 +9,8 @@ $(src)/build_info.c: $(src)/build_info.cid
 ifeq ($(BUILD_INFO_FILE),)
                @echo "/* Automatically generated. DO NOT EDIT! */" > $(@)
                @echo "" >> $(@)
-               @echo "const char build_info_kernel_path[] = { \"$(KERNEL_ELF_PATH)\" };"\
-                       >> $(@)
                @echo "const char build_info_date[] = { \"`date`\" };"\
                        >> $(@)
-               @echo "const char build_info_host[] = { \"`hostname`\" };"\
-                       >> $(@)
                @echo "const char build_info_commitid[] = { \"`cat $(src)/build_info.cid`\" };"\
                        >> $(@)
                @echo "const char build_info_version[] = { \"$(KERNELVERSION)\" };"\