Preload Mode

To enable debugging with the LD_PRELOAD mode, LD_PRELOAD the executable with libdftracer_preload_dbg.so at runtime instead of the libdftracer_preload.so library

 1# Remaining environment variables as it is
 2
 3# Enable profiler
 4DFTRACER_ENABLE=1
 5
 6# Set the mode
 7export DFTRACER_INIT=PRELOAD
 8
 9# Set the log level ( Supported options: DEBUG, INFO, WARN, ERROR (Default))
10DFTRACER_LOG_LEVEL=DEBUG
11
12# Run your application
13LD_PRELOAD=$VENV/lib/python*/site-packages/dftracer/lib64/libdftracer_preload_dbg.so ./your_application

Warning

Debug logs set with DFTRACER_LOG_LEVEL only work when debugging is enabled

App Mode

Python:

1 from dftracer.python.dbg import dftracer, dft_fn
2 # Remaining code as it is

Import the logger from dftracer.python.dbg instead of dftracer.python. No other changes in the code are required to enable debug logging

1 # Keep the remaining environment variables
2 # Enable profiler
3 DFTRACER_ENABLE=1
4 # Add the log level
5 DFTRACER_LOG_LEVEL=DEBUG
6
7 # Run the application
8 python3 your_application.py

Warning

Debug logging may impact application performance. Use only for debugging purposes.