From owner-svn-src-all@freebsd.org Wed Dec 14 12:56:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E354C76937; Wed, 14 Dec 2016 12:56:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2452B15B9; Wed, 14 Dec 2016 12:56:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBECuwLq012864; Wed, 14 Dec 2016 12:56:58 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBECuwHv012862; Wed, 14 Dec 2016 12:56:58 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201612141256.uBECuwHv012862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 14 Dec 2016 12:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310053 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2016 12:56:59 -0000 Author: ed Date: Wed Dec 14 12:56:58 2016 New Revision: 310053 URL: https://svnweb.freebsd.org/changeset/base/310053 Log: Add labels to sysctls related to clocks. Sysctls like kern.eventtimer.et.*.quality currently embed the name of the clock device. This is problematic for the Prometheus metrics exporter for two reasons: - Some of those clocks have dashes in their names, which Prometheus doesn't allow to be used in metric names. - It doesn't allow for extracting the same property of all clocks on the system from within a single query. Attach these nodes to have a label, so that the Prometheus metrics exporter gives these metric a uniform name with the name of the clock attached as a label. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D8775 Modified: head/sys/kern/kern_et.c head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_et.c ============================================================================== --- head/sys/kern/kern_et.c Wed Dec 14 12:53:33 2016 (r310052) +++ head/sys/kern/kern_et.c Wed Dec 14 12:56:58 2016 (r310053) @@ -66,9 +66,9 @@ et_register(struct eventtimer *et) } } KASSERT(et->et_start, ("et_register: timer has no start function")); - et->et_sysctl = SYSCTL_ADD_NODE(NULL, + et->et_sysctl = SYSCTL_ADD_NODE_WITH_LABEL(NULL, SYSCTL_STATIC_CHILDREN(_kern_eventtimer_et), OID_AUTO, et->et_name, - CTLFLAG_RW, 0, "event timer description"); + CTLFLAG_RW, 0, "event timer description", "eventtimer"); SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, "flags", CTLFLAG_RD, &(et->et_flags), 0, "Event timer capabilities"); Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Wed Dec 14 12:53:33 2016 (r310052) +++ head/sys/kern/kern_tc.c Wed Dec 14 12:56:58 2016 (r310053) @@ -1218,9 +1218,9 @@ tc_init(struct timecounter *tc) /* * Set up sysctl tree for this counter. */ - tc_root = SYSCTL_ADD_NODE(NULL, + tc_root = SYSCTL_ADD_NODE_WITH_LABEL(NULL, SYSCTL_STATIC_CHILDREN(_kern_timecounter_tc), OID_AUTO, tc->tc_name, - CTLFLAG_RW, 0, "timecounter description"); + CTLFLAG_RW, 0, "timecounter description", "timecounter"); SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(tc_root), OID_AUTO, "mask", CTLFLAG_RD, &(tc->tc_counter_mask), 0, "mask for implemented bits");