audiosup.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <mdb/mdb_modapi.h>
typedef struct audiotrace_walk_data {
int aw_cnt;
int
{
mdb_warn("failed to read 'audio_tb_siz'");
return (WALK_ERR);
}
if (size == 0)
return (WALK_DONE);
mdb_warn("failed to find 'audio_trace_buffer'");
return (WALK_ERR);
}
mdb_warn("failed to read 'audio_tb_seq'");
return (WALK_ERR);
}
mdb_warn("failed to read 'audio_tb_pos'");
return (WALK_ERR);
}
/* by default start the walk with the first buffer entry */
/* start the walk with the oldest buffer entry */
mdb_warn("failed to read audio_trace_buf_t at %p",
return (WALK_ERR);
}
}
return (WALK_NEXT);
}
int
{
return (WALK_DONE);
return (WALK_DONE);
}
}
void
{
}
/*ARGSUSED*/
int
{
int count;
char str[256];
if (!(flags & DCMD_ADDRSPEC)) {
== -1) {
mdb_warn("can't walk audio trace buffer entries");
return (DCMD_ERR);
}
return (DCMD_OK);
}
if (argc > 1)
return (DCMD_USAGE);
/*
* Specifying an address and a count at the same time doesn't make
* sense.
*/
return (DCMD_USAGE);
if (DCMD_HDRSPEC(flags))
mdb_printf("%<u>%6s %?s %-40s%</u>\n",
"SEQNO", "DATA", "COMMENT");
return (DCMD_ERR);
}
if (argc == 1) {
/*
* Display the last 'count' entries only. Skip any other
* entries.
*/
mdb_warn("failed to read 'audio_tb_seq'");
return (DCMD_ERR);
}
else
return (DCMD_OK);
}
return (DCMD_ERR);
}
return (DCMD_OK);
}
void
audiotrace_help(void)
{
"If count is specified ::audiotrace prints the specified\n"
"number of entries from the logical end of the trace buffer.\n");
}
/*
* MDB module linkage
*/
static const mdb_dcmd_t dcmds[] = {
{ "audiotrace", "?[count]", "display audio trace buffer entries",
{ NULL }
};
static const mdb_walker_t walkers[] = {
{ NULL }
};
const mdb_modinfo_t *
_mdb_init(void)
{
return (&modinfo);
}