diff --git a/config.h.in b/config.h.in index 0ff560da..8ee2f3a3 100644 --- a/config.h.in +++ b/config.h.in @@ -54,12 +54,18 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* IHK version string */ +#undef IHK_VERSION + /* McKernel specific headers */ #undef MCKERNEL_INCDIR /* McKernel specific libraries */ #undef MCKERNEL_LIBDIR +/* McKernel version string */ +#undef MCKERNEL_VERSION + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT diff --git a/configure b/configure index c9ab2f29..83792b19 100755 --- a/configure +++ b/configure @@ -4837,6 +4837,17 @@ cat >>confdefs.h <<_ACEOF _ACEOF + +cat >>confdefs.h <<_ACEOF +#define IHK_VERSION "$IHK_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define MCKERNEL_VERSION "$MCKERNEL_VERSION" +_ACEOF + + ABS_SRCDIR=$( cd $( dirname $0 ); pwd ) IHK_ABS_SRCDIR=${ABS_SRCDIR}/../ihk BUILDID=$( cd $IHK_ABS_SRCDIR; if [ ! -d .git ]; then echo $IHK_VERSION; else bash -c 'git rev-list -1 HEAD | cut -c1-8'; fi ) diff --git a/configure.ac b/configure.ac index 3a2ba579..05fa1849 100644 --- a/configure.ac +++ b/configure.ac @@ -504,6 +504,9 @@ fi AC_DEFINE_UNQUOTED(BINDIR,"$BINDIR",[Path of install directory for binary]) AC_DEFINE_UNQUOTED(SBINDIR,"$SBINDIR",[Path of install directory for system binary]) +AC_DEFINE_UNQUOTED(IHK_VERSION,"$IHK_VERSION",[IHK version string]) +AC_DEFINE_UNQUOTED(MCKERNEL_VERSION,"$MCKERNEL_VERSION",[McKernel version string]) + ABS_SRCDIR=$( cd $( dirname $0 ); pwd ) IHK_ABS_SRCDIR=${ABS_SRCDIR}/../ihk BUILDID=$( cd $IHK_ABS_SRCDIR; if @<:@ ! -d .git @:>@; then echo $IHK_VERSION; else bash -c 'git rev-list -1 HEAD | cut -c1-8'; fi ) diff --git a/executer/kernel/mcctrl/procfs.c b/executer/kernel/mcctrl/procfs.c index 896dbd18..1417c2f8 100644 --- a/executer/kernel/mcctrl/procfs.c +++ b/executer/kernel/mcctrl/procfs.c @@ -1138,5 +1138,6 @@ static const struct procfs_entry base_entry_stuff[] = { // PROC_REG("vmallocinfo",S_IRUSR, NULL), // PROC_REG("vmstat", S_IRUGO, NULL), // PROC_REG("zoneinfo", S_IRUGO, NULL), + PROC_REG("mckernel", S_IRUGO, &mckernel_buff_io), PROC_TERM }; diff --git a/kernel/procfs.c b/kernel/procfs.c index f8f53916..577aa329 100644 --- a/kernel/procfs.c +++ b/kernel/procfs.c @@ -309,6 +309,15 @@ int process_procfs_request(struct ikc_scd_packet *rpacket) hold_process_vm(vm); process_unlock(proc, &lock); } + else if (!strcmp(p, "mckernel")) { + ans = snprintf(buf, count, "%s-%s\n", + MCKERNEL_VERSION, BUILDID); + + if (buf_add(&buf_top, &buf_cur, buf, ans) < 0) + goto err; + ans = 0; + goto end; + } else if (!strcmp(p, "stat")) { /* "/proc/stat" */ extern int num_processors; /* kernel/ap.c */ int cpu;