[PATCH v2] service: extend service function call statistics

Mattias Rönnblom hofors at lysator.liu.se
Wed Oct 2 20:56:59 CEST 2024


On 2024-10-02 20:26, David Marchand wrote:
> Hello Mattias,
> 
> On Mon, Sep 9, 2024 at 9:28 PM Mattias Rönnblom
> <mattias.ronnblom at ericsson.com> wrote:
>> @@ -46,9 +49,21 @@ testsuite_teardown(void)
>>   static int32_t dummy_cb(void *args)
>>   {
>>          RTE_SET_USED(args);
>> -       service_tick++;
>> +
>> +       service_calls++;
>> +
>> +       switch (rte_rand_max(3)) {
>> +       case 0:
>> +               return 0;
>> +       case 1:
>> +               service_idle_calls++;
>> +               return -EAGAIN;
>> +       default:
>> +               service_error_calls++;
>> +               return -ENOENT;
>> +       }
>> +
>>          rte_delay_ms(SERVICE_DELAY);
>> -       return 0;
>>   }
>>
>>   static int32_t dummy_mt_unsafe_cb(void *args)
> 
> Coverity flagged this patch with issue #445158.
> rte_delay_ms() is now unreachable.
> 
> I suppose this delay is not that important for the unit test and we
> can remove it, but as I am not sure I'll let you have a look and send
> a fix.
> 

It works without it I think, but I would keep it, and add it to the 
"case 0" branch.

Let me know if you want a v2.


> Thanks.
> 
> 



More information about the dev mailing list