/*
* 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <libintl.h>
#include <libcpc.h>
#include "cpucmds.h"
/*
* These routines are solely used to manage a list of request sets.
*/
struct __cpc_setgrp {
struct setgrp_elem {
int nreqs;
char *name;
char *hdr;
};
{
sgrp->has_sysonly_set = 0;
return (sgrp);
}
/*
* Walker to count the number of requests in a set, and check if any requests
* count user-mode events.
*/
/*ARGSUSED*/
static void
{
if (flags & CPC_COUNT_USER)
}
/*
* Walker to discover the picnums used by the requests in a set.
*/
/*ARGSUSED*/
static void
{
int i;
for (i = 0; i < nattrs; i++) {
break;
}
if (i == nattrs)
}
{
int i;
*errcnt += 1;
return (NULL);
}
== NULL) {
gettext("cpc_setgrp: no re memory available\n"));
exit(0);
}
/*
* Count the number of requests in the set we just made. If any requests
* in the set have CPC_COUNT_USER in the flags, the sysonly flag will
* be cleared.
*/
* sizeof (int));
CHARS_PER_REQ) + 1);
/*
* Find out which picnums the requests are using.
*/
/*
* Use the picnums we discovered to build a printable header for this
* set.
*/
}
gettext("cpc_setgrp: no memory available\n"));
exit(0);
}
== NULL ||
== NULL ||
== NULL) {
gettext("cpc_setgrp: no memory available\n"));
exit(0);
}
return (sgrp);
}
int
{
return (-1);
}
{
int i;
gettext("cpc_setgrp: cpc_strtoset() failed\n"));
exit(0);
}
gettext("cpc_setgrp: no memory available\n"));
exit(0);
}
gettext("cpc_setgrp: no memory available\n"));
exit(0);
}
}
return (new);
}
static void
{
int l;
return;
}
void
{
}
}
{
return (NULL);
}
const char *
{
return (NULL);
}
const char *
{
return (NULL);
}
int
{
}
{
return (NULL);
return (cpc_setgrp_getset(sgrp));
}
/*
* Put the setgrp pointer back to the beginning of the set
*/
void
{
}
/*
* Adds the data from the 'data1' buf into the accum setgrp.
*/
void
{
int i;
return;
return;
}
}
/*
* Returns 1 if all requests in the current set count only system-mode events.
*/
int
{
}
/*
* Returns 1 if any set in the group is a system-mode-only set.
*/
int
{
return (sgrp->has_sysonly_set);
}
/*
* If we ever fail to get memory, we print an error message and exit.
*/
static void *
{
/*
* Several callers of this routine need zero-filled buffers.
*/
void *p = calloc(1, n);
if (p == NULL) {
gettext("cpc_setgrp: no memory available\n"));
exit(0);
}
return (p);
}