cooked.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"
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <libintl.h>
#include "state.h"
#define PROBE_TYPE "tnf_probe_type"
static void describe_c_brief (tnf_datum_t);
static void describe_target (tnf_datum_t);
static void describe_c_struct (tnf_datum_t);
static void describe_probe_type (tnf_datum_t);
void
print_c_header(void)
{
(void) printf("%16s %16s %5s %5s %10s %3s %-25s %s\n",
"----------------", "----------------", "-----", "-----",
"----------", "---", "-------------------------",
"------------------------");
(void) printf("%16s %16s %5s %5s %10s %3s %-25s %s\n",
"Elapsed (ms)", "Delta (ms)", "PID", "LWPID",
" TID ", "CPU", "Probe Name", "Data / Description . . .");
(void) printf("%16s %16s %5s %5s %10s %3s %-25s %s\n",
"----------------", "----------------", "-----", "-----",
"----------", "---", "-------------------------",
"------------------------");
}
static void
{
if (sched == TNF_DATUM_NULL) {
/*
* should never happen because it had a schedule
* record earlier
*/
}
}
void
print_sorted_events(void)
{
table_sort();
ent = table_get_entry_indexed(0);
if (ent) {
}
}
void
{
char *name_str;
switch (tnf_get_kind(datum)) {
case TNF_K_STRUCT:
/* print only event records */
if (schedule_rec != TNF_DATUM_NULL) {
/* event record */
}
break;
case TNF_K_STRING:
case TNF_K_ARRAY:
/* Skip arrays at top level */
break;
case TNF_K_TYPE:
/* REMIND: filter based on property */
break;
default:
break;
}
}
static void
{
unsigned n, i;
char *slotname;
n = tnf_get_slot_count(datum);
#if 0
/* print the OUTPUT PAD */
(void) printf("%16s %14s %5s %5s %8s %3s %-25s",
"-", "-", "-", "-", "-", "-", "-");
#endif
(void) printf("probe\t");
for (i = 0; i < n; i++) {
/* print all fields except ... */
(void) printf(" ");
i));
}
}
(void) printf("\n");
}
static void
{
unsigned time_delta = 0;
}
#define K_TID "tnf_kthread_id"
#define CPUID "cpuid"
static void
{
unsigned n, i;
int start_slots = 0;
unsigned long long tid = 0;
} else {
}
/* XXX should use TNF_N_KERNEL_SCHEDULE, TNF_N_USER_SCHEDULE */
int cpuid;
/* XXX Assumes cpuid always exists in kernel schedule */
/* print the OUTPUT schedule record for Kernel case */
(void) printf("%16.6f %16.6f %5u %5u 0x%-8llx %3d",
evt_time / 1000000.0,
} else {
/* print the OUTPUT schedule record */
(void) printf("%16.6f %16.6f %5u %5u %10llu %3s",
evt_time / 1000000.0,
}
/* print the tag */
/* heuristic - start of data is after TIME_DELTA field */
start_slots++;
n = tnf_get_slot_count(datum);
/* print the rest of the fields */
for (i = start_slots; i < n; i++) {
(void) printf(" ");
}
(void) printf("\n");
}
static void
{
unsigned n, i, tag_index;
char *slotname;
n = tnf_get_slot_count(datum);
/* print the tag */
(void) printf(" ");
for (i = 0; i < n; i++) {
/* print the rest of the members */
if (i != tag_index) {
(void) printf(" ");
}
}
}
static void
{
(void) printf("0x%-8x <NULL>", 0);
else if (tnf_is_scalar(datum))
else if (tnf_is_record(datum)) {
switch (tnf_get_kind(datum)) {
case TNF_K_TYPE:
break;
case TNF_K_STRING:
break;
default:
}
} else
}
static void
{
(void) printf("0x%-8x <NULL>", 0);
else if (tnf_is_scalar(datum))
else if (tnf_is_record(datum)) {
switch (tnf_get_kind(datum)) {
case TNF_K_STRUCT:
(void) printf("{");
(void) printf(" }");
break;
case TNF_K_TYPE:
break;
case TNF_K_STRING:
break;
default:
}
} else
}