Deleted Added
full compact
subr_prf.c (302408) subr_prf.c (303432)
1/*-
2 * Copyright (c) 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 21 unchanged lines hidden (view full) ---

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
35 */
36
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 21 unchanged lines hidden (view full) ---

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: stable/11/sys/kern/subr_prf.c 301750 2016-06-09 18:24:51Z cem $");
38__FBSDID("$FreeBSD: stable/11/sys/kern/subr_prf.c 303432 2016-07-28 11:43:25Z kib $");
39
40#ifdef _KERNEL
41#include "opt_ddb.h"
42#include "opt_printf.h"
43#endif /* _KERNEL */
44
45#include <sys/param.h>
46#ifdef _KERNEL

--- 1144 unchanged lines hidden (view full) ---

1191 sbuf_printf(sb, ".");
1192 }
1193 sbuf_printf(sb, "|");
1194 }
1195 sbuf_printf(sb, "\n");
1196 }
1197}
1198
39
40#ifdef _KERNEL
41#include "opt_ddb.h"
42#include "opt_printf.h"
43#endif /* _KERNEL */
44
45#include <sys/param.h>
46#ifdef _KERNEL

--- 1144 unchanged lines hidden (view full) ---

1191 sbuf_printf(sb, ".");
1192 }
1193 sbuf_printf(sb, "|");
1194 }
1195 sbuf_printf(sb, "\n");
1196 }
1197}
1198
1199#ifdef _KERNEL
1200void
1201counted_warning(unsigned *counter, const char *msg)
1202{
1203 struct thread *td;
1204 unsigned c;
1205
1206 for (;;) {
1207 c = *counter;
1208 if (c == 0)
1209 break;
1210 if (atomic_cmpset_int(counter, c, c - 1)) {
1211 td = curthread;
1212 log(LOG_INFO, "pid %d (%s) %s%s\n",
1213 td->td_proc->p_pid, td->td_name, msg,
1214 c > 1 ? "" : " - not logging anymore");
1215 break;
1216 }
1217 }
1218}
1219#endif