summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-05-23 07:45:12 -0600
committerBrian Paul <[email protected]>2017-05-24 11:33:47 -0600
commitcf1adb7b1cf921262f5998681854c370c1772925 (patch)
treecee8ebe17d7ec312368b5bd6f325e958cac4f575 /src/gallium
parent14d16872298a88ddbf704ccdd5b0fc3b0e78778b (diff)
svga: log the process command line to the vmware.log file
This is useful for Piglit when thousands of tests are run and we want to determine which test triggered a device error. v2: only log command line info if the new SVGA_EXTRA_LOGGING env var is set Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/svga/svga_screen.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 866eef13930..81856b30435 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -30,6 +30,8 @@
#include "util/u_string.h"
#include "util/u_math.h"
+#include "os/os_process.h"
+
#include "svga_winsys.h"
#include "svga_public.h"
#include "svga_context.h"
@@ -42,6 +44,7 @@
#include "svga3d_shaderdefs.h"
#include "VGPU10ShaderTokens.h"
+#include "svga_msg.h"
/* NOTE: this constant may get moved into a svga3d*.h header file */
#define SVGA3D_DX_MAX_RESOURCE_SIZE (128 * 1024 * 1024)
@@ -949,6 +952,7 @@ svga_screen_create(struct svga_winsys_screen *sws)
{
struct svga_screen *svgascreen;
struct pipe_screen *screen;
+ char host_log[200];
#ifdef DEBUG
SVGA_DEBUG = debug_get_flags_option("SVGA_DEBUG", svga_debug_flags, 0 );
@@ -1138,6 +1142,18 @@ svga_screen_create(struct svga_winsys_screen *sws)
"%s%s (%s)", HOST_LOG_PREFIX, PACKAGE_VERSION, MESA_GIT_SHA1);
svga_host_log(host_log);
+ /* If the SVGA_EXTRA_LOGGING env var is set, log the process's command
+ * line (program name and arguments).
+ */
+ if (debug_get_bool_option("SVGA_EXTRA_LOGGING", FALSE)) {
+ char cmdline[1000];
+ if (os_get_command_line(cmdline, sizeof(cmdline))) {
+ util_snprintf(host_log, sizeof(host_log) - strlen(HOST_LOG_PREFIX),
+ "%s%s", HOST_LOG_PREFIX, cmdline);
+ svga_host_log(host_log);
+ }
+ }
+
return screen;
error2:
FREE(svgascreen);