diff mbox series

[v1] xen/trace: remove duplicate check for tb_init_done

Message ID 20230616123938.12458-1-olaf@aepfle.de (mailing list archive)
State New, archived
Headers show
Series [v1] xen/trace: remove duplicate check for tb_init_done | expand

Commit Message

Olaf Hering June 16, 2023, 12:39 p.m. UTC
The single caller of next_record already checked for
tb_init_done. The functions are called with t_lock
held. The call stack look like this:

__trace_var
  tb_init_done?
  insert_wrap_record
  insert_lost_records
    __insert_record
      next_record
        tb_init_done?

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 xen/common/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/xen/common/trace.c b/xen/common/trace.c
index 582c58c884..8d56124ec9 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -514,7 +514,7 @@  static unsigned char *next_record(const struct t_buf *buf, uint32_t *next,
 
     barrier(); /* must read buf->prod and buf->cons only once */
     *next = x;
-    if ( !tb_init_done || bogus(x, cons) )
+    if ( bogus(x, cons) )
         return NULL;
 
     if ( x >= data_size )