debug: Add option to print the guest program name in the log

This is helpful to get the name of the guest program that may trigger a
memory leak. One can also pass a custom string as program name by setting
the environment variable GALLIUM_PROCESS_NAME in the guest accordingly.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Gert Wollny 6 years ago committed by Dave Airlie
parent 70fefe33df
commit ff18dfe508
  1. 1
      src/vrend_debug.c
  2. 3
      src/vrend_debug.h
  3. 2
      src/vrend_renderer.c

@ -113,6 +113,7 @@ static const struct debug_named_value vrend_debug_options[] = {
{"copyres", dbg_copy_resource, "Debug copy resource code path"},
{"feat", dbg_features, "Log features found"},
{"tex", dbg_tex, "Log texture operations"},
{"caller", dbg_caller, "Log who is creating the context"},
{"all", dbg_all, "Enable all debugging output"},
{"guestallow", dbg_allow_guest_override, "Allow the guest to override the debug flags"},
DEBUG_NAMED_VALUE_END

@ -42,7 +42,8 @@ enum virgl_debug_flags {
dbg_copy_resource = 1 << 6,
dbg_features = 1 << 7,
dbg_tex = 1 << 8,
dbg_all = (1 << 9) - 1,
dbg_caller = 1 << 9,
dbg_all = (1 << 10) - 1,
dbg_allow_guest_override = 1 << 16,
dbg_feature_use = 1 << 17,
};

@ -5504,6 +5504,8 @@ struct vrend_context *vrend_create_context(int id, uint32_t nlen, const char *de
strncpy(grctx->debug_name, debug_name, 64);
}
VREND_DEBUG(dbg_caller, grctx, "create context\n");
grctx->ctx_id = id;
list_inithead(&grctx->sub_ctxs);

Loading…
Cancel
Save