Unified Logging

Unified Logging (UL) utility is aimed at providing an identical logging output, configuration and interaction for different video frameworks provided by AMD AMA Video SDK. Two environmental variables LOG_AMA_CONFIG and LOG_AMA_FILTER control interactions with UL. LOG_AMA_CONFIG variable controls the global setting of logging, which includes log destination, max size, log source info, and log levels. LOG_AMA_FILTER variable filters the global configuration and narrows down the logging output to specific software layer, accelerator type or level. The following sections describe the configuration parameters of each variable.

LOG_AMA_CONFIG

LOG_AMA_CONFIG is utilized as follows:

export LOG_AMA_CONFIG="[key=value | ...]"

, where key and value are defined as:

key

value

Description

destination

console, file, syslog, release_preset or debug_preset

Determines the target destination of output logs.

console: Terminal output

file: Defaults to "async=1, max_size=10MB, location=log_ama_<pid>_<timestamp>.txt"

syslog: Defaults to "async=1, location=localhost, facility=LOCAL0"

release_preset: Shortcut for "destination=syslog, async=1 | log_level = WARN| perf_log=0 | debug_file_name=0 | debug_thread = 0 | debug_pid=0 | debug_time_stamp=0"

debug_preset: Shortcut for "destination=file, max_size=1GB | log_level = DEBUG | async=1 | perf_log=1 | debug_file_name=1 | debug_thread = 1 | debug_pid=1 | debug_time_stamp=1"

async refers to asynchronous mode of write operation

location refers to output path of logs

log_level

FATAL, ERROR, WARN, INFO, DEBUG, TRACE or ALL

Determines the log level.

Defaults to WARN

perf_log

0 or 1

Enables or disables performance measurements.

Defaults to 0

debug_file_name

0 or 1

Enables or disables addition of log file names.

Defaults to 0

debug_file_line

0 or 1

Enables or disables inclusion of log line numbers.

Defaults to 0

debug_time_stamp

0 or 1

Enables or disables addition of timestamps.

Defaults to 0

debug_pid

0 or 1

Enables or disables reporting of process id.

Defaults to 0

debug_thread

0 or 1

Enables or disables reporting of thread id.

Defaults to 0

LOG_AMA_FILTER

LOG_AMA_FILTER is utilized as follows:

export LOG_AMA_FILTER="[LAYER.ACCEL=log_level | ...]"

, where LAYER and ACCEL are defined as:

LAYER

Description

SDK

Any user space library

VPI

Video processing plugins

XMA

XMA library

FFMPEG

FFmpeg plugins

GST

Gstreamer plugins

GEN

General and common layers

XRM

XRM library

ACCEL

Description

ABR

ABR ladder

DEC

Decoder

ENC

Encoder

GEN

General hardware logs

Examples

  1. Send output to log_ama_<pid>_<timestamp>.txt file, and set log_level to warning:

    export LOG_AMA_CONFIG="destination=file | log_level=WARN | debug_file_line=1 | debug_time_stamp=1 | debug_pid=1 | debug_thread=1 | perf_log=0"
    
  2. Send output to /tmp/log_ama.txt file, and set log_level to info:

    export LOG_AMA_CONFIG="destination=file, location=/tmp/log_ama.txt | log_level=INFO | debug_file_line=1 | debug_time_stamp=1 | debug_pid=1 | debug_thread=1 | perf_log=0"
    
  3. Send output to /tmp/log_ama.txt file, and set log_level to info, with max log file size equal to 100MB:

    export LOG_AMA_CONFIG="destination=file, max_size=100MB, location=/tmp/log_ama.txt | log_level=INFO | debug_file_line=1 | debug_time_stamp=1 | debug_pid=1 | debug_thread=1 | perf_log=0"
    
  4. Get output on console, with log_level set to info:

    export LOG_AMA_CONFIG="destination=console | log_level=INFO | debug_file_line=1 | debug_time_stamp=1 | debug_pid=1 | debug_thread=1 | perf_log=0"
    
  5. Assume log_level was WARN in LOG_AMA_CONFIG, the following filter will additionally enable TRACE log level of VPI layer for ABR plugins:

    export LOG_AMA_FILTER=" VPI.ABR=TRACE"
    
  6. If we want all layers logs for ABR:

    export LOG_AMA_FILTER=" *.ABR=TRACE"
    
  7. If we want all layers logs for ABR & ENC:

    export LOG_AMA_FILTER=" *.ABR=TRACE | *.ENC=TRACE"
    
  8. Force all logs to ERROR, and generate debug logs from SDK for ABR type:

    export LOG_AMA_FILTER=" *.*=ERROR | *.ABR=DEBUG"