[Mesa-dev] [PATCH 2/8] util/u_log: flush auto loggers before starting a new page

Nicolai Hähnle nhaehnle at gmail.com
Wed Apr 24 13:14:30 UTC 2019


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Without this, command stream dumps of radeonsi may misleadingly end up
in a later page.
---
 src/gallium/auxiliary/util/u_log.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_log.c b/src/gallium/auxiliary/util/u_log.c
index 90fd24ca394..095421edd06 100644
--- a/src/gallium/auxiliary/util/u_log.c
+++ b/src/gallium/auxiliary/util/u_log.c
@@ -180,35 +180,39 @@ u_log_chunk(struct u_log_context *ctx, const struct u_log_chunk_type *type,
 out_of_memory:
    fprintf(stderr, "Gallium: u_log: out of memory\n");
 }
 
 /**
  * Convenience helper that starts a new page and prints the previous one.
  */
 void
 u_log_new_page_print(struct u_log_context *ctx, FILE *stream)
 {
+   u_log_flush(ctx);
+
    if (ctx->cur) {
       u_log_page_print(ctx->cur, stream);
       u_log_page_destroy(ctx->cur);
       ctx->cur = NULL;
    }
 }
 
 /**
  * Return the current page from the logging context and start a new one.
  *
  * The caller is responsible for destroying the returned page.
  */
 struct u_log_page *
 u_log_new_page(struct u_log_context *ctx)
 {
+   u_log_flush(ctx);
+
    struct u_log_page *page = ctx->cur;
    ctx->cur = NULL;
    return page;
 }
 
 /**
  * Free all data associated with \p page.
  */
 void
 u_log_page_destroy(struct u_log_page *page)
-- 
2.20.1



More information about the mesa-dev mailing list