common/utrace: Prefix all environment variables with `MESA_`
authorMark Collins <mark@igalia.com>
Thu, 20 Oct 2022 12:16:39 +0000 (12:16 +0000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 11 Nov 2022 13:50:56 +0000 (13:50 +0000)
To be more consistent with other environment variables and ensure
better scoping, all environment variables in utrace have now been
prefixed with `MESA_`.

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Ack-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18271>

docs/u_trace.rst
src/util/perf/u_trace.c
src/util/tests/perf/u_trace_test.cpp

index a6e6fa9..e7dafc0 100644 (file)
@@ -21,7 +21,7 @@ Usage
 
 u_trace is controlled by environment variables:
 
-:envvar:`GPU_TRACES`
+:envvar:`MESA_GPU_TRACES`
    controls whether u_trace is enabled and trace output
 
    ``print``
@@ -38,7 +38,7 @@ u_trace is controlled by environment variables:
       traces can be collected without setting this but it may miss some
       events prior to the tracing session being started.
 
-:envvar:`GPU_TRACEFILE`
+:envvar:`MESA_GPU_TRACEFILE`
    specifies a file where to write the output instead of ``stdout``
 
 :envvar:`*_GPU_TRACEPOINT`
index 88ba45b..7ddcfed 100644 (file)
@@ -368,7 +368,7 @@ static const struct debug_named_value config_control[] = {
    DEBUG_NAMED_VALUE_END
 };
 
-DEBUG_GET_ONCE_OPTION(trace_file, "GPU_TRACEFILE", NULL)
+DEBUG_GET_ONCE_OPTION(trace_file, "MESA_GPU_TRACEFILE", NULL)
 
 static void
 trace_file_fini(void)
@@ -381,7 +381,7 @@ static void
 u_trace_state_init_once(void)
 {
    u_trace_state.enabled_traces =
-      debug_get_flags_option("GPU_TRACES", config_control, 0);
+      debug_get_flags_option("MESA_GPU_TRACES", config_control, 0);
    const char *tracefile_name = debug_get_option_trace_file();
    if (tracefile_name && !__check_suid()) {
       u_trace_state.trace_file = fopen(tracefile_name, "w");
index 6714983..34134ec 100644 (file)
@@ -19,7 +19,7 @@ test_thread(void *_state)
 
 TEST(UtilPerfTraceTest, Multithread)
 {
-   static char env_tracefile[] = "GPU_TRACEFILE=tracefile_for_test-b5ba5a0c-6ed1-4901-a38d-755991182663";
+   static char env_tracefile[] = "MESA_GPU_TRACEFILE=tracefile_for_test-b5ba5a0c-6ed1-4901-a38d-755991182663";
    thrd_t threads[NUM_DEBUG_TEST_THREAD];
    putenv(env_tracefile);
    for (unsigned i = 0; i < NUM_DEBUG_TEST_THREAD; i++) {