Remove kernbb(8).
authorSascha Wildner <saw@online.de>
Sun, 23 Jul 2017 05:40:46 +0000 (07:40 +0200)
committerSascha Wildner <saw@online.de>
Sun, 23 Jul 2017 05:40:46 +0000 (07:40 +0200)
It likely never worked in DragonFly (or until some early compiler
upgrade). FreeBSD stopped building it in 2004 (r132787).

Reported-by: zrj
Makefile_upgrade.inc
sys/platform/pc64/x86_64/support.s
usr.sbin/Makefile
usr.sbin/kernbb/Makefile [deleted file]
usr.sbin/kernbb/kernbb.8 [deleted file]
usr.sbin/kernbb/kernbb.c [deleted file]

index eefb1c9..51ef30c 100644 (file)
@@ -3213,6 +3213,8 @@ TO_REMOVE+=/usr/share/zoneinfo/Pacific/Johnston
 TO_REMOVE+=/usr/libexec/uucp
 TO_REMOVE+=/usr/include/bus/cam/scsi/scsi_iu.h
 TO_REMOVE+=/boot/kernel/ispfw.ko
+TO_REMOVE+=/usr/sbin/kernbb
+TO_REMOVE+=/usr/share/man/man8/kernbb.8.gz
 
 .if !defined(WANT_INSTALLER)
 TO_REMOVE+=/usr/sbin/dfuibe_installer
index aae3662..2ce1dcc 100644 (file)
@@ -754,22 +754,3 @@ msr_onfault:
        movq    $0,PCB_ONFAULT(%r8)
        movl    $EFAULT,%eax
        ret
-
-/*
- * Support for BB-profiling (gcc -a).  The kernbb program will extract
- * the data from the kernel.
- */
-
-       .data
-       ALIGN_DATA
-       .globl bbhead
-bbhead:
-       .quad 0
-
-       .text
-NON_GPROF_ENTRY(__bb_init_func)
-       movq    $1,(%rdi)
-       movq    bbhead,%rax
-       movq    %rax,32(%rdi)
-       movq    %rdi,bbhead
-       NON_GPROF_RET
index 1d92d74..8007bc4 100644 (file)
@@ -51,7 +51,6 @@ SUBDIR= 802_11 \
        jls \
        kbdcontrol \
        kbdmap \
-       kernbb \
        lastlogin \
        mailwrapper \
        makewhatis \
diff --git a/usr.sbin/kernbb/Makefile b/usr.sbin/kernbb/Makefile
deleted file mode 100644 (file)
index 785329d..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD: src/usr.sbin/kernbb/Makefile,v 1.5.2.1 2001/04/25 12:09:49 ru Exp $
-# $DragonFly: src/usr.sbin/kernbb/Makefile,v 1.2 2003/06/17 04:29:55 dillon Exp $
-
-PROG=  kernbb
-MAN=   kernbb.8
-DPADD= ${LIBKVM}
-LDADD= -lkvm
-
-.include <bsd.prog.mk>
-
diff --git a/usr.sbin/kernbb/kernbb.8 b/usr.sbin/kernbb/kernbb.8
deleted file mode 100644 (file)
index 7276ae7..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-.\" Copyright (c) 1983, 1991, 1993
-.\"    The Regents of the University of California.  All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the University nor the names of its contributors
-.\"    may be used to endorse or promote products derived from this software
-.\"    without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $FreeBSD: src/usr.sbin/kernbb/kernbb.8,v 1.9.2.5 2001/08/16 15:56:01 ru Exp $
-.\" $DragonFly: src/usr.sbin/kernbb/kernbb.8,v 1.3 2008/09/02 11:50:46 matthias Exp $
-.\"
-.Dd September 2, 2008
-.Dt KERNBB 8
-.Os
-.Sh NAME
-.Nm kernbb
-.Nd generate a dump of the kernels basic-block profile buffers
-.Sh SYNOPSIS
-.Nm
-.Sh DESCRIPTION
-.Nm Kernbb
-is a tool used to dump the basic-block profiling buffers of the running
-kernel.
-.Pp
-At least one source file in the running kernel must have been compiled
-with the
-.Fl a
-option.
-.Pp
-The output format is
-.Tn ASCII ,
-consisting of one line per record with the
-following fields: filename, linenumber, procedure, address, count
-of executions, length of the basic-block in bytes and the product of
-the previous two fields.
-.Sh FILES
-.Bl -tag -width /dev/kmemx -compact
-.It Pa /boot/kernel
-the default system
-.It Pa /dev/kmem
-the default memory
-.El
-.Sh SEE ALSO
-.Xr cc 1
-.Sh AUTHORS
-The
-.Nm
-command was written by
-.An Poul-Henning Kamp ,
-along with the kernel-support.
diff --git a/usr.sbin/kernbb/kernbb.c b/usr.sbin/kernbb/kernbb.c
deleted file mode 100644 (file)
index 4270237..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * ----------------------------------------------------------------------------
- * "THE BEER-WARE LICENSE" (Revision 42):
- * <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
- * can do whatever you want with this stuff. If we meet some day, and you think
- * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
- * ----------------------------------------------------------------------------
- *
- * $FreeBSD: src/usr.sbin/kernbb/kernbb.c,v 1.11.2.1 2001/07/19 04:17:03 kris Exp $
- */
-
-#include <err.h>
-#include <fcntl.h>
-#include <kvm.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define MAXBB 32768
-
-struct bb {
-       u_long  zero_one;
-       u_long  filename;
-       u_long  counts;
-       u_long  ncounts;
-       u_long  next;
-       u_long  addr;
-       u_long  nwords;
-       u_long  func;
-       u_long  lineno;
-       u_long  file;
-};
-
-struct nlist namelist[] = {
-       { .n_name = "bbhead" },
-       { .n_name = NULL }
-};
-
-u_long lineno[MAXBB];
-u_long counts[MAXBB];
-u_long addr[MAXBB];
-u_long func[MAXBB];
-u_long file[MAXBB];
-char   *fn[MAXBB];
-char   *pn[MAXBB];
-
-kvm_t  *kv;
-
-int
-main(int argc __unused, char **argv __unused)
-{
-       u_int i,j;
-       u_long l1,l2,l4;
-       struct bb bb;
-       char buf[128];
-       char dash[] = "-";
-
-       kv = kvm_open(NULL,NULL,NULL,O_RDWR,"dnc");
-       if (!kv) 
-               err(1,"kvm_open");
-       i = kvm_nlist(kv,namelist);
-       if (i)
-               err(1,"kvm_nlist");
-
-       l1 = namelist[0].n_value;
-       kvm_read(kv,l1,&l2,sizeof l2);
-       while(l2) {
-               l1 += sizeof l1;
-               kvm_read(kv,l2,&bb,sizeof bb);
-               l2 = bb.next;
-               if (!bb.ncounts)
-                       continue;
-               if (bb.ncounts > MAXBB)
-                       errx(1, "found %lu counts above limit of %u",
-                               bb.ncounts, MAXBB);
-               kvm_read(kv,bb.lineno,lineno, bb.ncounts * sizeof lineno[0]);
-               kvm_read(kv,bb.counts,counts, bb.ncounts * sizeof counts[0]);
-               kvm_read(kv,bb.addr,  addr,   bb.ncounts * sizeof addr[0]);
-               kvm_read(kv,bb.file,  file,   bb.ncounts * sizeof file[0]);
-               kvm_read(kv,bb.func,  func,   bb.ncounts * sizeof func[0]);
-               l4 = 0;
-               for (i=0; i < bb.ncounts; i++) {
-                       if (counts[i])
-                               l4++;
-                       if (!func[i] && i+1 < bb.ncounts)
-                               func[i] = func[i+1];
-               }
-               if (!l4)
-                       continue;
-               for (i=0; i < bb.ncounts; i++) {
-
-                       if (0 && !counts[i])
-                               continue;
-
-                       if (!pn[i] && func[i]) {
-                               kvm_read(kv,func[i], buf, sizeof buf);
-                               buf[sizeof buf -1] = 0;
-                               pn[i] = strdup(buf);
-                               for(j=i+1;j<bb.ncounts;j++)
-                                       if (func[j] == func[i]) {
-                                               pn[j] = pn[i];
-                                               func[j] = 0;
-                                       }
-                       }
-                       if (!pn[i])
-                               pn[i] = dash;
-                       if (!fn[i] && file[i]) {
-                               kvm_read(kv,file[i], buf, sizeof buf);
-                               buf[sizeof buf -1] = 0;
-                               fn[i] = strdup(buf);
-                               for(j=i+1;j<bb.ncounts;j++)
-                                       if (file[j] == file[i]) {
-                                               fn[j] = fn[i];
-                                               file[j] = 0;
-                                       }
-                       }
-                       if (!fn[i])
-                               fn[i] = dash;
-                       l4 = 0;
-                       if (i+1 < bb.ncounts)
-                               l4 = addr[i+1] - addr[i];
-                       printf("%s %5lu %s %lu %lu %lu %lu\n",
-                               fn[i], lineno[i], pn[i], addr[i], counts[i], l4, counts[i] * l4);
-               }
-               for(i=0;i<bb.ncounts;i++) {
-                       if (func[i] && pn[i]) 
-                               free(pn[i]);
-                       if (file[i] && fn[i])
-                               free(fn[i]);
-                       pn[i] = NULL;
-                       fn[i] = NULL;
-               }
-       }
-       return 0;
-}