Message ID | 20190222180539.27439-3-kaslevs@vmware.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | Add VM kernel tracing over vsockets and FIFOs | expand |
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index 8beefab..88b4a55 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -3106,13 +3106,14 @@ static void print_stat(struct buffer_instance *instance) { int cpu; + if (quiet) + return; + if (!is_top_instance(instance)) - if (!quiet) - printf("\nBuffer: %s\n\n", instance->name); + printf("\nBuffer: %s\n\n", instance->name); for (cpu = 0; cpu < instance->cpu_count; cpu++) - if (!quiet) - trace_seq_do_printf(&instance->s_print[cpu]); + trace_seq_do_printf(&instance->s_print[cpu]); } enum {
Do an early out in print_stat() when `quiet` is set instead of rechecking it on each loop iteration. No changes in behavior intended. Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com> --- tracecmd/trace-record.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)