Module Name:    src
Committed By:   isaki
Date:           Sat Apr 23 07:55:07 UTC 2022

Modified Files:
        src/sys/dev/audio: audio.c audiodef.h

Log Message:
audio(4): Remove no longer used counters.
These were used at very early phase of development.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/audio/audiodef.h

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

Modified files:

Index: src/sys/dev/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.130 src/sys/dev/audio/audio.c:1.131
--- src/sys/dev/audio/audio.c:1.130	Sat Apr 23 07:43:16 2022
+++ src/sys/dev/audio/audio.c	Sat Apr 23 07:55:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.130 2022/04/23 07:43:16 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.131 2022/04/23 07:55:07 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -181,7 +181,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.130 2022/04/23 07:43:16 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.131 2022/04/23 07:55:07 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -2825,7 +2825,6 @@ audio_read(struct audio_softc *sc, struc
 			goto abort;
 		}
 		auring_take(usrbuf, bytes);
-		track->useriobytes += bytes;
 		TRACET(3, track, "uiomove(len=%d) usrbuf=%d/%d/C%d",
 		    bytes,
 		    usrbuf->head, usrbuf->used, usrbuf->capacity);
@@ -2953,7 +2952,6 @@ audio_write(struct audio_softc *sc, stru
 				goto abort;
 			}
 			auring_push(usrbuf, len);
-			track->useriobytes += len;
 			TRACET(3, track, "uiomove(len=%d) usrbuf=%d/%d/C%d",
 			    len,
 			    usrbuf->head, usrbuf->used, usrbuf->capacity);
@@ -4955,9 +4953,6 @@ audio_track_play(audio_track_t *track)
 	    "count=%d fpb=%d",
 	    count, frame_per_block(track->mixer, &track->outbuf.fmt));
 
-	/* XXX TODO: is this necessary for now? */
-	int track_count_0 = track->outbuf.used;
-
 	usrbuf = &track->usrbuf;
 	input = track->input;
 
@@ -5068,12 +5063,6 @@ audio_track_play(audio_track_t *track)
 		}
 	}
 
-	if (track->input == &track->outbuf) {
-		track->outputcounter = track->inputcounter;
-	} else {
-		track->outputcounter += track->outbuf.used - track_count_0;
-	}
-
 	track->stamp++;
 
 #if defined(AUDIO_DEBUG)
@@ -6389,8 +6378,7 @@ audio_track_drain(struct audio_softc *sc
 	}
 
 	track->pstate = AUDIO_STATE_CLEAR;
-	TRACET(3, track, "done trk_inp=%d trk_out=%d",
-		(int)track->inputcounter, (int)track->outputcounter);
+	TRACET(3, track, "done");
 	return 0;
 }
 

Index: src/sys/dev/audio/audiodef.h
diff -u src/sys/dev/audio/audiodef.h:1.18 src/sys/dev/audio/audiodef.h:1.19
--- src/sys/dev/audio/audiodef.h:1.18	Wed Apr 20 07:11:13 2022
+++ src/sys/dev/audio/audiodef.h	Sat Apr 23 07:55:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiodef.h,v 1.18 2022/04/20 07:11:13 isaki Exp $	*/
+/*	$NetBSD: audiodef.h,v 1.19 2022/04/23 07:55:07 isaki Exp $	*/
 
 /*
  * Copyright (C) 2017 Tetsuya Isaki. All rights reserved.
@@ -175,11 +175,7 @@ struct audio_track {
 	audio_state_t	pstate;		/* playback state */
 	bool		is_pause;
 
-	/* Statistic counters. */
-	uint64_t	inputcounter;	/* # of frames input to track */
-	uint64_t	outputcounter;	/* # of frames output from track */
-	uint64_t	useriobytes;	/* # of bytes xfer to/from userland */
-	uint64_t	dropframes;	/* # of frames dropped */
+	uint64_t	dropframes;	/* number of dropped frames */
 	int		eofcounter;	/* count of zero-sized write */
 
 	/*

Reply via email to