diff mbox series

[ovs-dev] perf-counter: Split numbers in the output.

Message ID 20201118210559.1344917-1-i.maximets@ovn.org
State Accepted
Headers show
Series [ovs-dev] perf-counter: Split numbers in the output. | expand

Commit Message

Ilya Maximets Nov. 18, 2020, 9:05 p.m. UTC
While trying to benchmark big functions, values could be longer than
12 digits.  In this case all of them printed without spaces.  It's
hard ot read.

Fixes: 619c3a42dc1e ("lib: add a hardware performance counter access library")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 lib/perf-counter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gregory Rose Nov. 20, 2020, 5:59 p.m. UTC | #1
On 11/18/2020 1:05 PM, Ilya Maximets wrote:
> While trying to benchmark big functions, values could be longer than
> 12 digits.  In this case all of them printed without spaces.  It's
> hard ot read.
> 
> Fixes: 619c3a42dc1e ("lib: add a hardware performance counter access library")
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---
>   lib/perf-counter.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/perf-counter.c b/lib/perf-counter.c
> index 402fabe17..e4eca58d0 100644
> --- a/lib/perf-counter.c
> +++ b/lib/perf-counter.c
> @@ -111,7 +111,7 @@ perf_counter_to_ds(struct ds *ds, struct perf_counter *pfc)
>           ratio = 0.0;
>       }
>   
> -    ds_put_format(ds, "%-40s%12"PRIu64"%12"PRIu64"%12.1f\n",
> +    ds_put_format(ds, "%-40s %12"PRIu64" %12"PRIu64" %12.1f\n",
>                     pfc->name, pfc->n_events, pfc->total_count, ratio);
>   }
>   
> 

Seems straightforward enough.  LGTM

Acked-by: Greg Rose <gvrose8192@gmail.com>
Ilya Maximets Nov. 27, 2020, 11:38 p.m. UTC | #2
On 11/20/20 6:59 PM, Gregory Rose wrote:
> 
> 
> On 11/18/2020 1:05 PM, Ilya Maximets wrote:
>> While trying to benchmark big functions, values could be longer than
>> 12 digits.  In this case all of them printed without spaces.  It's
>> hard ot read.
>>
>> Fixes: 619c3a42dc1e ("lib: add a hardware performance counter access library")
>> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
>> ---
>>   lib/perf-counter.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/perf-counter.c b/lib/perf-counter.c
>> index 402fabe17..e4eca58d0 100644
>> --- a/lib/perf-counter.c
>> +++ b/lib/perf-counter.c
>> @@ -111,7 +111,7 @@ perf_counter_to_ds(struct ds *ds, struct perf_counter *pfc)
>>           ratio = 0.0;
>>       }
>>   -    ds_put_format(ds, "%-40s%12"PRIu64"%12"PRIu64"%12.1f\n",
>> +    ds_put_format(ds, "%-40s %12"PRIu64" %12"PRIu64" %12.1f\n",
>>                     pfc->name, pfc->n_events, pfc->total_count, ratio);
>>   }
>>  
> 
> Seems straightforward enough.  LGTM
> 
> Acked-by: Greg Rose <gvrose8192@gmail.com>

Thanks!

Applied to master.  I didn't backport that since it's not very
important and it's a code for developers only, so likely will
be used exclusively on master.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/lib/perf-counter.c b/lib/perf-counter.c
index 402fabe17..e4eca58d0 100644
--- a/lib/perf-counter.c
+++ b/lib/perf-counter.c
@@ -111,7 +111,7 @@  perf_counter_to_ds(struct ds *ds, struct perf_counter *pfc)
         ratio = 0.0;
     }
 
-    ds_put_format(ds, "%-40s%12"PRIu64"%12"PRIu64"%12.1f\n",
+    ds_put_format(ds, "%-40s %12"PRIu64" %12"PRIu64" %12.1f\n",
                   pfc->name, pfc->n_events, pfc->total_count, ratio);
 }