Print this page
3396 new psrinfo does not print socket type
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>

*** 9,18 **** --- 9,19 ---- * http://www.illumos.org/license/CDDL. */ /* * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ /* * This implements psrinfo(1M), a utility to report various information * about processors, cores, and threads (virtual cpus). This is mostly
*** 95,104 **** --- 96,106 ---- char *v_fpu_type; long v_clock_mhz; long v_pchip_id; /* 1 per socket */ char *v_impl; char *v_brand; + char *v_socket; long v_core_id; /* n per chip_id */ }; static struct link *pchips = NULL; static struct link *cores = NULL;
*** 266,275 **** --- 268,280 ---- (void) printf(" %s\n", vcpu->v_impl); } if (((len = strlen(vcpu->v_brand)) != 0) && (strncmp(vcpu->v_brand, vcpu->v_impl, len) != 0)) (void) printf("\t%s", vcpu->v_brand); + if (strcmp(vcpu->v_socket, "Unknown") != 0) + (void) printf("\t[ %s: %s ]", _("Socket"), + vcpu->v_socket); (void) putchar('\n'); } else { for (l2 = chip->p_cores; l2; l2 = l2->l_next) { core = l2->l_ptr; (void) printf(_(" %s has %d virtual %s"),
*** 505,514 **** --- 510,525 ---- vc->v_brand = _("(unknown)"); } else { vc->v_brand = mystrdup(knp->value.str.addr.ptr); } + if ((knp = kstat_data_lookup(ksp, "socket_type")) == NULL) { + vc->v_socket = "Unknown"; + } else { + vc->v_socket = mystrdup(knp->value.str.addr.ptr); + } + if ((knp = kstat_data_lookup(ksp, "implementation")) == NULL) { vc->v_impl = _("(unknown)"); } else { vc->v_impl = mystrdup(knp->value.str.addr.ptr); }