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. Three environmental variables LOG_AMA_CONFIG, LOG_AMA_FILTER and LOG_AMA_FILTER_PERF 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. LOG_AMA_FILTER_PERF variable controls the flow of performance related logs. 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. If enabled, minimal information log level is set. Otherwise, log level is set by log_level.

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

LOG_AMA_FILTER_PERF

LOG_AMA_FILTER_PERF is utilized as follows:

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

, where LAYER and ACCEL are defined as above.

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"
    
  9. Set performance logs to info level:

    export LOG_AMA_CONFIG="destination=file, location=log_ama_perf.txt | log_level=WARN | perf_log=1"
    
  10. Set performance log level to DEBUG for ABR at SDK layer:

    export LOG_AMA_FILTER_PERF="SDK.ABR=DEBUG"