Skip to contentSkip to conversation

xen/trace: remove duplicate check for tb_init_done

PATCH New Olaf Hering 1 participant 1 message Jun 16, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/trace: remove duplicate check for tb_init_done

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?

---
 xen/common/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/trace.c +1 -1
index 582c58c884..8d56124ec9 100644
@@ -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 )