Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Mar 2026 10:39:01 +0000
From:      Christos Margiolis <christos@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4324e0fa71f8 - main - sound: Remove SND_DIAGNOSTIC section in buffer.c
Message-ID:  <69c269c5.32455.45b18ca3@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=4324e0fa71f85f274013100d912584a042c9909e

commit 4324e0fa71f85f274013100d912584a042c9909e
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-03-24 10:31:48 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-03-24 10:38:41 +0000

    sound: Remove SND_DIAGNOSTIC section in buffer.c
    
    The purpose of this has not been documented, but it seems like it makes
    it possible to view the maximum number of bytes that passed to
    sndbuf_feed(), as well as the maximum number of cycles taken inside its
    main loop. These do not seem particularly useful anymore.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D55989
---
 sys/dev/sound/pcm/buffer.c | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c
index 1db9e5661dc8..0c574ae2908c 100644
--- a/sys/dev/sound/pcm/buffer.c
+++ b/sys/dev/sound/pcm/buffer.c
@@ -506,29 +506,11 @@ sndbuf_dispose(struct snd_dbuf *b, u_int8_t *to, unsigned int count)
 	return 0;
 }
 
-#ifdef SND_DIAGNOSTIC
-static uint32_t snd_feeder_maxfeed = 0;
-SYSCTL_UINT(_hw_snd, OID_AUTO, feeder_maxfeed, CTLFLAG_RD,
-    &snd_feeder_maxfeed, 0, "maximum feeder count request");
-
-static uint32_t snd_feeder_maxcycle = 0;
-SYSCTL_UINT(_hw_snd, OID_AUTO, feeder_maxcycle, CTLFLAG_RD,
-    &snd_feeder_maxcycle, 0, "maximum feeder cycle");
-#endif
-
 /* count is number of bytes we want added to destination buffer */
 int
 sndbuf_feed(struct snd_dbuf *from, struct snd_dbuf *to, struct pcm_channel *channel, struct pcm_feeder *feeder, unsigned int count)
 {
 	unsigned int cnt, maxfeed;
-#ifdef SND_DIAGNOSTIC
-	unsigned int cycle;
-
-	if (count > snd_feeder_maxfeed)
-		snd_feeder_maxfeed = count;
-
-	cycle = 0;
-#endif
 
 	KASSERT(count > 0, ("can't feed 0 bytes"));
 
@@ -544,16 +526,8 @@ sndbuf_feed(struct snd_dbuf *from, struct snd_dbuf *to, struct pcm_channel *chan
 			break;
 		sndbuf_acquire(to, to->tmpbuf, cnt);
 		count -= cnt;
-#ifdef SND_DIAGNOSTIC
-		cycle++;
-#endif
 	} while (count != 0);
 
-#ifdef SND_DIAGNOSTIC
-	if (cycle > snd_feeder_maxcycle)
-		snd_feeder_maxcycle = cycle;
-#endif
-
 	return (0);
 }
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69c269c5.32455.45b18ca3>