Module Name:    src
Committed By:   gson
Date:           Tue Sep 29 07:51:01 UTC 2020

Modified Files:
        src/sys/kern: kern_entropy.c

Log Message:
Log a message when a process blocks due to a lack of entropy.
Discussed on tech-kern.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/kern/kern_entropy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_entropy.c
diff -u src/sys/kern/kern_entropy.c:1.23 src/sys/kern/kern_entropy.c:1.24
--- src/sys/kern/kern_entropy.c:1.23	Fri Aug 14 00:53:16 2020
+++ src/sys/kern/kern_entropy.c	Tue Sep 29 07:51:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_entropy.c,v 1.23 2020/08/14 00:53:16 riastradh Exp $	*/
+/*	$NetBSD: kern_entropy.c,v 1.24 2020/09/29 07:51:01 gson Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.23 2020/08/14 00:53:16 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.24 2020/09/29 07:51:01 gson Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -1297,6 +1297,9 @@ entropy_extract(void *buf, size_t len, i
 
 		/* Wait for some entropy to come in and try again.  */
 		KASSERT(E->stage >= ENTROPY_WARM);
+		printf("entropy: pid %d (%s) blocking due to lack of entropy\n",
+		       curproc->p_pid, curproc->p_comm);
+
 		if (ISSET(flags, ENTROPY_SIG)) {
 			error = cv_wait_sig(&E->cv, &E->lock);
 			if (error)

Reply via email to