JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 3: Extended Library Functions     Oracle Solaris 10 1/13 Information Library
search filter icon
search icon

Document Information

Preface

Extended Library Functions - Part 1

Extended Library Functions - Part 2

Extended Library Functions - Part 3

gelf_update_getmove(3ELF)

gelf_update_move(3ELF)

gelf_update_phdr(3ELF)

gelf_update_rel(3ELF)

gelf_update_rela(3ELF)

gelf_update_shdr(3ELF)

gelf_update_sym(3ELF)

gelf_update_syminfo(3ELF)

gelf_update_symshndx(3ELF)

gelf_xlatetof(3ELF)

gelf_xlatetom(3ELF)

getacdir(3BSM)

getacflg(3BSM)

getacinfo(3BSM)

getacmin(3BSM)

getacna(3BSM)

getauclassent(3BSM)

getauclassent_r(3BSM)

getauclassnam(3BSM)

getauclassnam_r(3BSM)

getauditflags(3BSM)

getauditflagsbin(3BSM)

getauditflagschar(3BSM)

getauevent(3BSM)

getauevent_r(3BSM)

getauevnam(3BSM)

getauevnam_r(3BSM)

getauevnonam(3BSM)

getauevnum(3BSM)

getauevnum_r(3BSM)

getauthattr(3SECDB)

getauthnam(3SECDB)

getauuserent(3BSM)

getauuserent_r(3BSM)

getauusernam(3BSM)

getauusernam_r(3BSM)

getdefaultproj(3PROJECT)

getexecattr(3SECDB)

getexecprof(3SECDB)

getexecuser(3SECDB)

getfauditflags(3BSM)

getpathbylabel(3TSOL)

getplabel(3TSOL)

getprofattr(3SECDB)

getproflist(3SECDB)

getprofnam(3SECDB)

getprojbyid(3PROJECT)

getprojbyname(3PROJECT)

getprojent(3PROJECT)

getprojidbyname(3PROJECT)

getuserattr(3SECDB)

getusernam(3SECDB)

getuserrange(3TSOL)

getuseruid(3SECDB)

getzoneidbylabel(3TSOL)

getzonelabelbyid(3TSOL)

getzonelabelbyname(3TSOL)

getzonerootbyid(3TSOL)

getzonerootbylabel(3TSOL)

getzonerootbyname(3TSOL)

gl_abandon_line(3TECLA)

gl_append_history(3TECLA)

gl_automatic_history(3TECLA)

gl_bind_keyseq(3TECLA)

gl_catch_blocked(3TECLA)

gl_change_terminal(3TECLA)

gl_clear_history(3TECLA)

gl_completion_action(3TECLA)

gl_configure_getline(3TECLA)

gl_customize_completion(3TECLA)

gl_display_text(3TECLA)

gl_echo_mode(3TECLA)

gl_erase_terminal(3TECLA)

gl_error_message(3TECLA)

gl_get_line(3TECLA)

gl_group_history(3TECLA)

gl_handle_signal(3TECLA)

gl_ignore_signal(3TECLA)

gl_inactivity_timeout(3TECLA)

gl_io_mode(3TECLA)

gl_last_signal(3TECLA)

gl_limit_history(3TECLA)

gl_list_signals(3TECLA)

gl_load_history(3TECLA)

gl_lookup_history(3TECLA)

gl_normal_io(3TECLA)

gl_pending_io(3TECLA)

gl_prompt_style(3TECLA)

gl_query_char(3TECLA)

gl_range_of_history(3TECLA)

gl_raw_io(3TECLA)

gl_read_char(3TECLA)

gl_register_action(3TECLA)

gl_replace_prompt(3TECLA)

gl_resize_history(3TECLA)

gl_return_status(3TECLA)

gl_save_history(3TECLA)

gl_set_term_size(3TECLA)

gl_show_history(3TECLA)

gl_size_of_history(3TECLA)

gl_state_of_history(3TECLA)

gl_terminal_size(3TECLA)

gl_toggle_history(3TECLA)

gl_trap_signal(3TECLA)

gl_tty_signals(3TECLA)

gl_watch_fd(3TECLA)

gmatch(3GEN)

h_alloc(3TSOL)

HBA_CloseAdapter(3HBAAPI)

HBA_FreeLibrary(3HBAAPI)

HBA_GetAdapterAttributes(3HBAAPI)

HBA_GetAdapterName(3HBAAPI)

HBA_GetAdapterPortAttributes(3HBAAPI)

HBA_GetBindingCapability(3HBAAPI)

HBA_GetBindingSupport(3HBAAPI)

HBA_GetDiscoveredPortAttributes(3HBAAPI)

HBA_GetEventBuffer(3HBAAPI)

HBA_GetFC4Statistics(3HBAAPI)

HBA_GetFcpPersistentBinding(3HBAAPI)

HBA_GetFCPStatistics(3HBAAPI)

HBA_GetFcpTargetMapping(3HBAAPI)

HBA_GetFcpTargetMappingV2(3HBAAPI)

HBA_GetNumberOfAdapters(3HBAAPI)

HBA_GetPersistentBindingV2(3HBAAPI)

HBA_GetPortAttributesByWWN(3HBAAPI)

HBA_GetPortStatistics(3HBAAPI)

HBA_GetRNIDMgmtInfo(3HBAAPI)

HBA_GetVendorLibraryAttributes(3HBAAPI)

HBA_GetVersion(3HBAAPI)

HBA_GetWrapperLibraryAttributes(3HBAAPI)

HBA_LoadLibrary(3HBAAPI)

HBA_OpenAdapter(3HBAAPI)

HBA_OpenAdapterByWWN(3HBAAPI)

HBA_RefreshAdapterConfiguration(3HBAAPI)

HBA_RefreshInformation(3HBAAPI)

HBA_RegisterForAdapterAddEvents(3HBAAPI)

HBA_RegisterForAdapterEvents(3HBAAPI)

HBA_RegisterForAdapterPortEvents(3HBAAPI)

HBA_RegisterForAdapterPortStatEvents(3HBAAPI)

HBA_RegisterForLinkEvents(3HBAAPI)

HBA_RegisterForTargetEvents(3HBAAPI)

HBA_RemoveAllPersistentBindings(3HBAAPI)

HBA_RemoveCallback(3HBAAPI)

HBA_RemovePersistentBinding(3HBAAPI)

HBA_ResetStatistics(3HBAAPI)

HBA_ScsiInquiryV2(3HBAAPI)

HBA_ScsiReadCapacityV2(3HBAAPI)

HBA_ScsiReportLUNsV2(3HBAAPI)

HBA_SendCTPassThru(3HBAAPI)

HBA_SendCTPassThruV2(3HBAAPI)

HBA_SendLIRR(3HBAAPI)

HBA_SendReadCapacity(3HBAAPI)

HBA_SendReportLUNs(3HBAAPI)

HBA_SendRLS(3HBAAPI)

HBA_SendRNID(3HBAAPI)

HBA_SendRNIDV2(3HBAAPI)

HBA_SendRPL(3HBAAPI)

HBA_SendRPS(3HBAAPI)

HBA_SendScsiInquiry(3HBAAPI)

HBA_SendSRL(3HBAAPI)

HBA_SetBindingSupport(3HBAAPI)

HBA_SetPersistentBindingV2(3HBAAPI)

HBA_SetRNIDMgmtInfo(3HBAAPI)

hextob(3TSOL)

h_free(3TSOL)

htobclear(3TSOL)

htobsl(3TSOL)

hypot(3M)

hypotf(3M)

hypotl(3M)

idn_decodename2(3EXT)

idn_decodename(3EXT)

idn_enable(3EXT)

idn_encodename(3EXT)

idn_nameinit(3EXT)

IFDHCloseChannel(3SMARTCARD)

IFDHControl(3SMARTCARD)

IFDHCreateChannel(3SMARTCARD)

IFDHCreateChannelByName(3SMARTCARD)

IFDHGetCapabilities(3SMARTCARD)

IFDHICCPresence(3SMARTCARD)

IFDHPowerICC(3SMARTCARD)

IFDHSetCapabilities(3SMARTCARD)

IFDHSetProtocolParameters(3SMARTCARD)

IFDHTransmitToICC(3SMARTCARD)

ilogb(3M)

ilogbf(3M)

ilogbl(3M)

inproj(3PROJECT)

isencrypt(3GEN)

isfinite(3M)

isgreater(3M)

isgreaterequal(3M)

isinf(3M)

isless(3M)

islessequal(3M)

islessgreater(3M)

isnan(3M)

isnormal(3M)

isunordered(3M)

j0(3M)

j0f(3M)

j0l(3M)

j1(3M)

j1f(3M)

j1l(3M)

jn(3M)

jnf(3M)

jnl(3M)

kstat(3KSTAT)

Kstat(3PERL)

kstat_chain_update(3KSTAT)

kstat_close(3KSTAT)

kstat_data_lookup(3KSTAT)

kstat_lookup(3KSTAT)

kstat_open(3KSTAT)

kstat_read(3KSTAT)

kstat_write(3KSTAT)

kva_match(3SECDB)

kvm_close(3KVM)

kvm_getcmd(3KVM)

kvm_getproc(3KVM)

kvm_getu(3KVM)

kvm_kread(3KVM)

kvm_kwrite(3KVM)

kvm_nextproc(3KVM)

kvm_nlist(3KVM)

kvm_open(3KVM)

kvm_read(3KVM)

kvm_setproc(3KVM)

kvm_uread(3KVM)

kvm_uwrite(3KVM)

kvm_write(3KVM)

la_activity(3EXT)

la_amd64_pltenter(3EXT)

labelbuilder(3TSOL)

labelclipping(3TSOL)

label_to_str(3TSOL)

la_i86_pltenter(3EXT)

la_objfilter(3EXT)

la_objopen(3EXT)

la_objsearch(3EXT)

la_pltexit(3EXT)

la_pltexit64(3EXT)

la_preinit(3EXT)

la_sparcv8_pltenter(3EXT)

la_sparcv9_pltenter(3EXT)

la_symbind32(3EXT)

la_symbind64(3EXT)

la_version(3EXT)

ld_atexit(3ext)

ld_atexit64(3ext)

ldexp(3M)

ldexpf(3M)

ldexpl(3M)

ld_file(3ext)

ld_file64(3ext)

ld_input_done(3ext)

ld_input_section(3ext)

ld_input_section64(3ext)

ld_open(3ext)

ld_open64(3ext)

ld_section(3ext)

ld_section64(3ext)

ld_start(3ext)

ld_start64(3ext)

ld_support(3ext)

ld_version(3ext)

lgamma(3M)

lgammaf(3M)

lgammaf_r(3M)

lgammal(3M)

lgammal_r(3M)

lgamma_r(3M)

lgrp_affinity_get(3LGRP)

lgrp_affinity_set(3LGRP)

lgrp_children(3LGRP)

lgrp_cookie_stale(3LGRP)

lgrp_cpus(3LGRP)

lgrp_fini(3LGRP)

lgrp_home(3LGRP)

lgrp_init(3LGRP)

lgrp_latency(3LGRP)

lgrp_latency_cookie(3LGRP)

lgrp_mem_size(3LGRP)

lgrp_nlgrps(3LGRP)

lgrp_parents(3LGRP)

lgrp_resources(3LGRP)

lgrp_root(3LGRP)

lgrp_version(3LGRP)

lgrp_view(3LGRP)

libpicl(3PICL)

libpicltree(3PICLTREE)

libtecla_version(3TECLA)

libtnfctl(3TNF)

llrint(3M)

llrintf(3M)

llrintl(3M)

llround(3M)

llroundf(3M)

llroundl(3M)

log10(3M)

log10f(3M)

log10l(3M)

log1p(3M)

log1pf(3M)

log1pl(3M)

log2(3M)

log2f(3M)

log2l(3M)

log(3M)

logb(3M)

logbf(3M)

logbl(3M)

logf(3M)

logl(3M)

lrint(3M)

lrintf(3M)

lrintl(3M)

lround(3M)

lroundf(3M)

lroundl(3M)

maillock(3MAIL)

mailunlock(3MAIL)

match_execattr(3SECDB)

matherr(3M)

m_create_layout(3LAYOUT)

md4(3EXT)

MD4Final(3EXT)

MD4Init(3EXT)

MD4Update(3EXT)

md5(3EXT)

md5_calc(3EXT)

MD5Final(3EXT)

MD5Init(3EXT)

MD5Update(3EXT)

m_destroy_layout(3LAYOUT)

media_findname(3VOLMGT)

media_getattr(3VOLMGT)

media_getid(3VOLMGT)

media_setattr(3VOLMGT)

m_getvalues_layout(3LAYOUT)

mkdirp(3GEN)

m_label(3TSOL)

m_label_alloc(3TSOL)

m_label_dup(3TSOL)

m_label_free(3TSOL)

modf(3M)

modff(3M)

modfl(3M)

mp(3MP)

MP_AssignLogicalUnitToTPG(3MPAPI)

MP_CancelOverridePath(3MPAPI)

MP_CompareOIDs(3MPAPI)

MP_DeregisterForObjectPropertyChanges(3MPAPI)

MP_DeregisterForObjectVisibilityChanges(3MPAPI)

MP_DeregisterPlugin(3MPAPI)

MP_DisableAutoFailback(3MPAPI)

MP_DisableAutoProbing(3MPAPI)

MP_DisablePath(3MPAPI)

MP_EnableAutoFailback(3MPAPI)

MP_EnableAutoProbing(3MPAPI)

Extended Library Functions - Part 4

Extended Library Functions - Part 5

Extended Library Functions - Part 6

libtnfctl

- library for TNF probe control in a process or the kernel

Synopsis

cc [ flag ... ] file ... -ltnfctl [ library ... ]
#include <tnf/tnfctl.h>

Description

The libtnfctl library provides an API to control TNF ("Trace Normal Form") probes within a process or the kernel. See tracing(3TNF) for an overview of the Solaris tracing architecture. The client of libtnfctl controls probes in one of four modes:

internal mode

The target is the controlling process itself; that is, the client controls its own probes.

direct mode

The target is a separate process; a client can either exec(2) a program or attach to a running process for probe control. The libtnfctl library uses proc(4) on the target process for probe and process control in this mode, and additionally provides basic process control features.

indirect mode

The target is a separate process, but the controlling process is already using proc(4) to control the target, and hence libtnfctl cannot use those interfaces directly. Use this mode to control probes from within a debugger. In this mode, the client must provide a set of functions that libtnfctl can use to query and update the target process.

kernel mode

The target is the Solaris kernel.

A process is controlled "externally" if it is being controlled in either direct mode or indirect mode. Alternatively, a process is controlled "internally" when it uses internal mode to control its own probes.

There can be only one client at a time doing probe control on a given process. Therefore, it is not possible for a process to be controlled internally while it is being controlled externally. It is also not possible to have a process controlled by multiple external processes. Similarly, there can be only one process at a time doing kernel probe control. Note, however, that while a given target may only be controlled by one libtnfctl client, a single client may control an arbitrary number of targets. That is, it is possible for a process to simultaneously control its own probes, probes in other processes, and probes in the kernel.

The following tables denotes the modes applicable to all libtnfctl interfaces (INT = internal mode; D = direct mode; IND = indirect mode; K = kernel mode).

These interfaces create handles in the specified modes:

tnfctl_internal_open()
INT
tnfctl_exec_open()
D
tnfctl_pid_open()
D
tnfctl_indirect_open()
IND
tnfctl_kernel_open()
K

These interfaces are used with the specified modes:

tnfctl_continue()
D
tnfctl_probe_connect()
INT
D
IND
tnfctl_probe_disconnect_all ()
INT
D
IND
tnfctl_trace_attrs_get()
INT
D
IND
K
tnfctl_buffer_alloc()
INT
D
IND
K
tnfctl_register_funcs()
INT
D
IND
K
tnfctl_probe_apply()
INT
D
IND
K
tnfctl_probe_apply_ids()
INT
D
IND
K
tnfctl_probe_state_get ()
INT
D
IND
K
tnfctl_probe_enable()
INT
D
IND
K
tnfctl_probe_disable()
INT
D
IND
K
tnfctl_probe_trace()
INT
D
IND
K
tnfctl_probe_untrace()
INT
D
IND
K
tnfctl_check_libs()
INT
D
IND
K
tnfctl_close()
INT
D
IND
K
tnfctl_strerror()
INT
D
IND
K
tnfctl_buffer_dealloc()
K
tnfctl_trace_state_set()
K
tnfctl_filter_state_set()
K
tnfctl_filter_list_get()
K
tnfctl_filter_list_add()
K
tnfctl_filter_list_delete()
K

When using libtnfctl, the first task is to create a handle for controlling probes. The tnfctl_internal_open() function creates an internal mode handle for controlling probes in the same process, as described above. The tnfctl_pid_open() and tnfctl_exec_open() functions create handles in direct mode. The tnfctl_indirect_open() function creates an indirect mode handle, and the tnfctl_kernel_open() function creates a kernel mode handle. A handle is required for use in nearly all other libtnfctl functions. The tnfctl_close() function releases the resources associated with a handle.

The tnfctl_continue() function is used in direct mode to resume execution of the target process.

The tnfctl_buffer_alloc() function allocates a trace file or, in kernel mode, a trace buffer.

The tnfctl_probe_apply() and tnfctl_probe_apply_ids() functions call a specified function for each probe or for a designated set of probes.

The tnfctl_register_funcs() function registers functions to be called whenever new probes are seen or probes have disappeared, providing an opportunity to do one-time processing for each probe.

The tnfctl_check_libs() function is used primarily in indirect mode to check whether any new probes have appeared, that is, they have been made available by dlopen(3C), or have disappeared, that is, they have disassociated from the process by dlclose(3C).

The tnfctl_probe_enable() and tnfctl_probe_disable() functions control whether the probe, when hit, will be ignored.

The tnfctl_probe_trace() and tnfctl_probe_untrace() functions control whether an enabled probe, when hit, will cause an entry to be made in the trace file.

The tnfctl_probe_connect() and tnfctl_probe_disconnect_all() functions control which functions, if any, are called when an enabled probe is hit.

The tnfctl_probe_state_get() function returns information about the status of a probe, such as whether it is currently enabled.

The tnfctl_trace_attrs_get() function returns information about the tracing session, such as the size of the trace buffer or trace file.

The tnfctl_strerror() function maps a tnfctl error code to a string, for reporting purposes.

The remaining functions apply only to kernel mode.

The tnfctl_trace_state_set() function controls the master switch for kernel tracing. See prex(1) for more details.

The tnfctl_filter_state_set(), tnfctl_filter_list_get(), tnfctl_filter_list_add(), and tnfctl_filter_list_delete() functions allow a set of processes to be specified for which probes will not be ignored when hit. This prevents kernel activity caused by uninteresting processes from cluttering up the kernel's trace buffer.

The tnfctl_buffer_dealloc() function deallocates the kernel's internal trace buffer.

Return Values

Upon successful completion, these functions returnTNFCTL_ERR_NONE.

Errors

The error codes for libtnfctl are:

TNFCTL_ERR_ACCES

Permission denied.

TNFCTL_ERR_NOTARGET

The target process completed.

TNFCTL_ERR_ALLOCFAIL

A memory allocation failure occurred.

TNFCTL_ERR_INTERNAL

An internal error occurred.

TNFCTL_ERR_SIZETOOSMALL

The requested trace size is too small.

TNFCTL_ERR_SIZETOOBIG

The requested trace size is too big.

TNFCTL_ERR_BADARG

Bad input argument.

TNFCTL_ERR_NOTDYNAMIC

The target is not a dynamic executable.

TNFCTL_ERR_NOLIBTNFPROBE

libtnfprobe.so not linked in target.

TNFCTL_ERR_BUFBROKEN

Tracing is broken in the target.

TNFCTL_ERR_BUFEXISTS

A buffer already exists.

TNFCTL_ERR_NOBUF

No buffer exists.

TNFCTL_ERR_BADDEALLOC

Cannot deallocate buffer.

TNFCTL_ERR_NOPROCESS

No such target process exists.

TNFCTL_ERR_FILENOTFOUND

File not found.

TNFCTL_ERR_BUSY

Cannot attach to process or kernel because it is already tracing.

TNFCTL_ERR_INVALIDPROBE

Probe no longer valid.

TNFCTL_ERR_USR1

Error code reserved for user.

TNFCTL_ERR_USR2

Error code reserved for user.

TNFCTL_ERR_USR3

Error code reserved for user.

TNFCTL_ERR_USR4

Error code reserved for user.

TNFCTL_ERR_USR5

Error code reserved for user.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
SUNWtnfc
MT Level
MT-Safe with exceptions

See Also

prex(1), exec(2), dlclose(3C), dlopen(3C), TNF_PROBE(3TNF), tnfctl_buffer_alloc(3TNF), tnfctl_buffer_dealloc(3TNF), tnfctl_check_libs(3TNF), tnfctl_close(3TNF), tnfctl_continue(3TNF), tnfctl_internal_open(3TNF), tnfctl_exec_open(3TNF), tnfctl_filter_list_add(3TNF), tnfctl_filter_list_delete(3TNF), tnfctl_filter_list_get(3TNF), tnfctl_filter_state_set(3TNF), tnfctl_kernel_open(3TNF), tnfctl_pid_open(3TNF), tnfctl_probe_apply(3TNF), tnfctl_probe_apply_ids(3TNF), tnfctl_probe_connect(3TNF), tnfctl_probe_disable(3TNF), tnfctl_probe_enable(3TNF), tnfctl_probe_state_get(3TNF), tnfctl_probe_trace(3TNF), tnfctl_probe_untrace(3TNF), tnfctl_indirect_open(3TNF), tnfctl_register_funcs(3TNF), tnfctl_strerror(3TNF), tnfctl_trace_attrs_get(3TNF), tnfctl_trace_state_set(3TNF), libtnfctl(3LIB), proc(4), attributes(5)

Linker and Libraries Guide

Notes

This API is MT-Safe. Multiple threads may concurrently operate on independent tnfctl handles, which is the typical behavior expected. The libtnfctl library does not support multiple threads operating on the same tnfctl handle. If this is desired, it is the client's responsibility to implement locking to ensure that two threads that use the same tnfctl handle are not simultaneously in a libtnfctl interface.