list.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 (c) 1994, by Sun Microsytems, Inc.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Includes
*/
#ifndef DEBUG
#define NDEBUG 1
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <libintl.h>
#include <search.h>
#include "source.h"
#include "queue.h"
#include "list.h"
#include "spec.h"
#include "new.h"
#include "fcn.h"
extern caddr_t g_commitfunc;
/*
* Typedefs
*/
typedef struct list_probe_args {
typedef struct list_attrs_args {
void *attrroot_p;
typedef struct attr_node {
char *name;
void *valsroot_p;
} attr_node_t;
typedef struct vals_node {
char *name;
} vals_node_t;
/*
* Globals
*/
/*
* Declarations
*/
void *pdata);
#if 0
#endif
/* ---------------------------------------------------------------- */
/* ----------------------- Public Functions ----------------------- */
/* ---------------------------------------------------------------- */
extern tnfctl_handle_t *g_hndl;
/*
* list_set() - lists all of the current probes in a target process
*/
void
{
if (!set_p) {
return;
}
if (err) {
}
}
/*
* list_expr() - lists all of the current probes in an expression list
*/
void
{
if (err) {
}
}
/*
* list_values() - list all the values for a supplied spec
*/
void
{
/* setup argument block */
/* traverse the probes, recording attributes that match */
if (err) {
}
/* pretty print the results */
/* destroy the attribute tree */
while (args.attrroot_p) {
attr_node_t **aptr;
char *anameptr;
/* destroy the value tree */
while ((*aptr)->valsroot_p) {
vals_node_t **vptr;
char *vnameptr;
#ifdef LEAKCHK
vnameptr);
#endif
}
#ifdef LEAKCHK
#endif
}
} /* end list_values */
/*
* list_getattrs() - build an attribute string for this probe.
*/
#define BUF_LIMIT 2048
char *
{
char *attrs;
char *buf_p;
char *buf_end;
int str_len;
if (err) {
if (attrs)
attrs[0] = '\0';
return (attrs);
}
}
}
/* REMIND: add limit for string size */
if (p_state.func_names) {
int i = 0;
char *fcnname;
while (p_state.func_names[i]) {
if (fcnname) {
} else
i++;
}
}
if (attrs) {
}
return (attrs);
}
/* ---------------------------------------------------------------- */
/* ----------------------- Private Functions ---------------------- */
/* ---------------------------------------------------------------- */
/*
* probescan() - function used as a callback, gathers probe attributes and
* values
*/
/*ARGSUSED*/
static tnfctl_errcode_t
{
char *attrs;
}
if (attrs)
return (TNFCTL_ERR_NONE);
}
/*
*/
/*ARGSUSED*/
static void
char *attr,
char *values,
void *pdata)
{
if (!allspec)
#ifdef LEAKCHK
#endif
if (ret_pp) {
/*
* we already had a node for this attribute; delete ours *
* and point at the original instead.
*/
#ifdef LEAKCHK
#endif
} else {
}
} /* end attrscan */
/*
* valadd() - add vals to an attributes tree
*/
/*ARGSUSED*/
static void
char *val,
void *calldata_p)
{
#ifdef LEAKCHK
#endif
if (ret_pp) {
/* we already had a node for this value */
#ifdef LEAKCHK
#endif
} else {
}
} /* end valadd */
/*
* attrcompare() - compares attribute nodes, alphabetically
*/
static int
attrcompare(const void *node1,
const void *node2)
{
} /* end attrcompare */
/*
* valscompare() - compares attribute nodes, alphabetically
*/
static int
valscompare(const void *node1,
const void *node2)
{
} /* end valscompare */
/*
* printattrs() - prints attributes from the attr tree
*/
/*ARGSUSED*/
static void
printattrs(const void *node,
int level)
{
}
} /* end printattrs */
/*
* printvals() - prints values from a value tree
*/
/*ARGSUSED*/
static void
int level)
{
} /* end printvals */
#if 0
/*
* attrnodedel() - deletes an attr_node_t after the action
*/
static void
{
/* destroy the value tree */
while (an_p->valsroot_p) {
vals_node_t **ptr;
}
/* We don't need to free this object, since tdelete() appears to */
/* free(an_p); */
} /* end attrnodedel */
#endif
/*
* listprobe() - function used as a callback, pretty prints a probe
*/
/*ARGSUSED*/
static tnfctl_errcode_t
{
char *attrs;
/* build a default speclist if there is not one built already */
if (!default_speclist) {
spec("name",
spec("enable",
SPEC_EXACT)),
}
if (!sawattr)
(void) printf("<no attr> ");
}
(void) printf("\n");
}
if (attrs)
return (TNFCTL_ERR_NONE);
}
/*ARGSUSED*/
static void
char *attr,
char *value,
void *pdata)
{
} /* end printattrval */