radv: Add startup debug option.

This adds a RADV_DEBUG=startup option to dump more info about
instance creation and device enumeration.

A common question end users have is why the direver is not loading
for them, and this has two common reasons:
1) They did not install the driver.
2) AMDGPU is not used for the card in the kernel.

This adds some info messages so we can easily get a some useful
output from end users.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
This commit is contained in:
Bas Nieuwenhuizen
2018-05-31 01:49:38 +02:00
parent 38933c1151
commit b9fb2c266a
4 changed files with 50 additions and 2 deletions

View File

@@ -54,6 +54,26 @@ radv_loge_v(const char *format, va_list va)
fprintf(stderr, "\n");
}
/** Log an error message. */
void radv_printflike(1, 2)
radv_logi(const char *format, ...)
{
va_list va;
va_start(va, format);
radv_logi_v(format, va);
va_end(va);
}
/** \see radv_logi() */
void
radv_logi_v(const char *format, va_list va)
{
fprintf(stderr, "radv: info: ");
vfprintf(stderr, format, va);
fprintf(stderr, "\n");
}
void radv_printflike(3, 4)
__radv_finishme(const char *file, int line, const char *format, ...)
{