Go to main content

man pages section 3: DAX Library Functions

Exit Print View

Updated: Friday, August 13, 2021
 
 

dax_set_debug (3DAX)

Name

dax_set_debug, DAX_DEBUG_EXTRA - set debugging options

Synopsis

cc [ flag... ] file... -ldax [ library...]

#include <dax.h>

dax_status_t
dax_set_debug(dax_context_t *ctx, uint64_t options);

Description

This function sets options to check arguments in the libdax functions that use ctx.

The following are the values for the options parameter, and they can be logically OR'd together:

DAX_DEBUG_ARG

Check function arguments for validity before submitting them to DAX. Checks all conditions that return DAX_EINVAL and DAX_ETHREAD. If this option is disabled, skips the checking of DAX_EINVAL and DAX_ETHREAD. This reduces function CPU call time for programs that have been debugged. The results are undefined if checking is skipped and the arguments are not valid.

DAX_DEBUG_EXTRA

Perform more expensive consistency checks on the data that requires accessing multiple elements of a vector, such as summing aux_data lengths. Not recommended for production code.

DAX_DEBUG_SYNC

Wait for the DAX command to complete before returning from the post functions. In other words, execute the command synchronously. This flag can only be set if there are no outstanding requests in the queue. If the command is posted with one of the dax_post() DAX_PIPE_XXXX flags, the pipe is not used. Not recommended for production code.

DAX_DEBUG_PERF

Enable the DAX DTrace probes. If you omit this option, DTrace probes are not invoked.

DAX_DEBUG_ALL

Enable all debugging options

DAX_DEBUG_OFF

Disable all debugging options

In addition, adds the options specified by the DAX_DEBUG_OPTIONS environment variable to the enabled set. Its format is a comma separated list of option names with no whitespace. Recognized names are arg, extra, and all.

Disables an option if it is not specified either in options or in DAX_DEBUG_OPTIONS.

If the function returns an error, there is no change in the debug options.

Return Values

DAX_SUCCESS

Operation completed successfully

DAX_ETHREAD

The calling thread did not create ctx

DAX_EINVAL

Unrecognized flag in the options

DAX_EQFULL

DAX_DEBUG_SYNC is requested and one of the queues in ctx has outstanding requests.

Usage

After debugging the application, to optimize performance, disable debugging by using the DAX_DEBUG_OFF option. Bugs that would be caught on function entry with DAX_DEBUG_ARG may instead be caught during DAX execution and cause errors such as DAX_EPARSE or DAX_EDATAFMT, but this is not guaranteed; the function may return DAX_SUCCESS but produce incorrect output.

Attributes

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

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/library
Interface Stability
Committed

See Also

libdax(3LIB), dax_thread_init(3DAX), dax_dtrace(3DAX)