summaryrefslogtreecommitdiff
path: root/usr/src/cmd/mdb/common/modules
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2019-08-30 03:00:46 -0700
committerJohn Levon <john.levon@joyent.com>2019-09-12 04:36:23 -0700
commit8eb8717cc9dc99bdd784b74c994bea7ef5e60f92 (patch)
tree0d9edcbb68752a3a5bf2434ec96029e9b33e99c7 /usr/src/cmd/mdb/common/modules
parent169b638e2b6e15b2589c3769e4a0d96188adf56d (diff)
downloadillumos-gate-8eb8717cc9dc99bdd784b74c994bea7ef5e60f92.tar.gz
11626 introduce /etc/versions/build
11627 clean up UUID code for ::status Reviewed by: Peter Tribble <peter.tribble@gmail.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/cmd/mdb/common/modules')
-rw-r--r--usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c b/usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c
index d4b817295d..85f3839c96 100644
--- a/usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c
+++ b/usr/src/cmd/mdb/common/modules/mdb_ks/mdb_ks.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2017 Joyent, Inc.
+ * Copyright 2019 Joyent, Inc.
*/
/*
@@ -1012,9 +1012,9 @@ find_mbind(const char *name, uintptr_t *hashtab)
int
mdb_name_to_major(const char *name, major_t *major)
{
- uintptr_t mbind;
- uintptr_t mb_hashtab[MOD_BIND_HASHSIZE];
- struct bind mbind_local;
+ uintptr_t mbind;
+ uintptr_t mb_hashtab[MOD_BIND_HASHSIZE];
+ struct bind mbind_local;
if (mdb_readsym(mb_hashtab, sizeof (mb_hashtab), "mb_hashtab") == -1) {
@@ -1810,3 +1810,19 @@ mdb_get_lbolt(void)
return ((ts/nsec) - lbi.lbi_debug_time);
}
+
+void
+mdb_print_buildversion(void)
+{
+ GElf_Sym sym;
+
+ if (mdb_lookup_by_name("buildversion", &sym) != 0)
+ return;
+
+ char *str = mdb_zalloc(4096, UM_SLEEP | UM_GC);
+
+ if (mdb_readstr(str, 4096, sym.st_value) < 1)
+ return;
+
+ mdb_printf("build version: %s\n", str);
+}