http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/sys/dtrace.h#5091987 /* 1988 * DTrace Meta Provider API 1989 * 1990 * The following functions are implemented by the DTrace framework and are 1991 * used to implement meta providers. Meta providers plug into the DTrace 1992 * framework and are used to instantiate new providers on the fly. At 1993 * present, there is only one type of meta provider and only one meta 1994 * provider may be registered with the DTrace framework at a time. The 1995 * sole meta provider type provides user-land static tracing facilities 1996 * by taking meta probe descriptions and adding a corresponding provider 1997 * into the DTrace framework. 1998 * 1999 * 1 Framework-to-Provider 2000 * 2001 * 1.1 Overview 2002 * 2003 * The Framework-to-Provider API is represented by the dtrace_mops structure 2004 * that the meta provider passes to the framework when registering itself as 2005 * a meta provider. This structure consists of the following members: 2006 * 2007 * dtms_create_probe() <-- Add a new probe to a created provider 2008 * dtms_provide_pid() <-- Create a new provider for a given process 2009 * dtms_remove_pid() <-- Remove a previously created provider 2010 * 2011 * 1.2 void dtms_create_probe(void *arg, void *parg, 2012 * dtrace_helper_probedesc_t *probedesc); 2013 * 2014 * 1.2.1 Overview 2015 * 2016 * Called by the DTrace framework to create a new probe in a provider 2017 * created by this meta provider. 2018 * 2019 * 1.2.2 Arguments and notes 2020 * 2021 * The first argument is the cookie as passed to dtrace_meta_register(). 2022 * The second argument is the provider cookie for the associated provider; 2023 * this is obtained from the return value of dtms_provide_pid(). The third 2024 * argument is the helper probe description. 2025 * 2026 * 1.2.3 Return value 2027 * 2028 * None 2029 * 2030 * 1.2.4 Caller's context 2031 * 2032 * dtms_create_probe() is called from either ioctl() or module load context. 2033 * The DTrace framework is locked in such a way that meta providers may not 2034 * register or unregister. This means that the meta provider cannot call 2035 * dtrace_meta_register() or dtrace_meta_unregister(). However, the context is 2036 * such that the provider may (and is expected to) call provider-related 2037 * DTrace provider APIs including dtrace_probe_create(). 2038 * 2039 * 1.3 void *dtms_provide_pid(void *arg, dtrace_meta_provider_t *mprov, 2040 * pid_t pid) 2041 * 2042 * 1.3.1 Overview 2043 * 2044 * Called by the DTrace framework to instantiate a new provider given the 2045 * description of the provider and probes in the mprov argument. The 2046 * meta provider should call dtrace_register() to insert the new provider 2047 * into the DTrace framework. 2048 * 2049 * 1.3.2 Arguments and notes 2050 * 2051 * The first argument is the cookie as passed to dtrace_meta_register(). 2052 * The second argument is a pointer to a structure describing the new 2053 * helper provider. The third argument is the process identifier for 2054 * process associated with this new provider. Note that the name of the 2055 * provider as passed to dtrace_register() should be the contatenation of 2056 * the dtmpb_provname member of the mprov argument and the processs 2057 * identifier as a string. 2058 * 2059 * 1.3.3 Return value 2060 * 2061 * The cookie for the provider that the meta provider creates. This is 2062 * the same value that it passed to dtrace_register(). 2063 * 2064 * 1.3.4 Caller's context 2065 * 2066 * dtms_provide_pid() is called from either ioctl() or module load context. 2067 * The DTrace framework is locked in such a way that meta providers may not 2068 * register or unregister. This means that the meta provider cannot call 2069 * dtrace_meta_register() or dtrace_meta_unregister(). However, the context 2070 * is such that the provider may -- and is expected to -- call 2071 * provider-related DTrace provider APIs including dtrace_register(). 2072 * 2073 * 1.4 void dtms_remove_pid(void *arg, dtrace_meta_provider_t *mprov, 2074 * pid_t pid) 2075 * 2076 * 1.4.1 Overview 2077 * 2078 * Called by the DTrace framework to remove a provider that had previously 2079 * been instantiated via the dtms_provide_pid() entry point. The meta 2080 * provider need not remove the provider immediately, but this entry 2081 * point indicates that the provider should be removed as soon as possible 2082 * using the dtrace_unregister() API. 2083 * 2084 * 1.4.2 Arguments and notes 2085 * 2086 * The first argument is the cookie as passed to dtrace_meta_register(). 2087 * The second argument is a pointer to a structure describing the helper 2088 * provider. The third argument is the process identifier for process 2089 * associated with this new provider. 2090 * 2091 * 1.4.3 Return value 2092 * 2093 * None 2094 * 2095 * 1.4.4 Caller's context 2096 * 2097 * dtms_remove_pid() is called from either ioctl() or exit() context. 2098 * The DTrace framework is locked in such a way that meta providers may not 2099 * register or unregister. This means that the meta provider cannot call 2100 * dtrace_meta_register() or dtrace_meta_unregister(). However, the context 2101 * is such that the provider may -- and is expected to -- call 2102 * provider-related DTrace provider APIs including dtrace_unregister(). 2103 */ 2104 typedef struct dtrace_helper_probedesc { 2105 char *dthpb_mod; /* probe module */ |