fmd_trace.c revision d9638e547d8811f2c689977f8dd2a353938b61fd
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <ucontext.h>
#include <strings.h>
#include <stdio.h>
#include <errno.h>
#include <fmd_trace.h>
#include <fmd_alloc.h>
#include <fmd_subr.h>
#include <fmd_conf.h>
#include <fmd.h>
fmd_trace_create(void)
{
/*
* We require 8-byte alignment of fmd_tracerec_t to store hrtime_t's.
* Since the trailing flexible array member is of type uintptr_t, we
* must make it a multiple of 2 if we are compiling 32-bit; otherwise
* uintptr_t is 8 bytes so any value of tb_frames is acceptable.
*/
#ifdef _ILP32
#endif
return (tbp);
}
void
{
}
/*
* Callback for walkcontext(3C) to store the stack trace. We use tr_tag below
* to store the maximum value of depth that is permitted so we can use it here.
*/
/*ARGSUSED*/
static int
{
}
/*ARGSUSED*/
{
return (NULL);
}
{
char *p;
return (NULL);
}
p[-1] = '\0';
else
return (trp);
}
{
char *p;
return (NULL);
}
(void) getcontext(&uc);
p[-1] = '\0';
else
return (trp);
}