On 09/01/2015 02:23 PM, Maxim Uvarov wrote:
> On 09/01/15 15:07, Nicolas Morey-Chaisemartin wrote:
>>
>> On 09/01/2015 12:39 PM, Maxim Uvarov wrote:
>>> On 09/01/15 11:45, Nicolas Morey-Chaisemartin wrote:
Hi,
I'm having a small issue with the performance/scheduler test. It requires
clock_gettime which is not necessary available on every platform
(including some of our compilation modes).
The config.h file generated by configure contains a define
HAVE_CLOCK_GETTIME which could be used. But it doesn't seem any file is
currently depending on this one and I'm not sure what the proper way to
include it would be.
Any insight on this?
Nicolas
>>> For linux-generic it will be nice to have something runnable on every
>>> platform. What alternative is? gettimeofday() ?
>>>
>>> Maxim.
>>>
>> I agree. This test actually only display the difference between odp_cycle
>> counters and the clock_gettime.
>> It is not really needed for the test !
>> Couldn't we split this in two ?
>>
>> Still it would be nice to be able to use the config.h file.
>> Things like this:
>> if (appl_args->interval <= 200 && geteuid() != 0) {
>> EXAMPLE_ERR("should be root user\n");
>> exit(EXIT_FAILURE);
>> }
>> are very Linux oriented and just adding a ifdef around is probably enough.
>>
>> Nicolas
> geteuid() migth not work on bare metal. For pktio we check for root in bash
> script. But in fact yes some pktio (raw sockets) need root permissions. I
> think geteuid() can
> be inside linux-generic pktio code, under .init. For other apis somewhere
> also under implementation init.
>
> Maxim.
>
>
init isn't a good place because it will also be called during make check and
all runs using only loop interfaces.
open might be a better place, but I don't think it is even necessary.
If the user is not root (or does not have the raw net something capabilities),
the socket creating will fail with an errno that should be helpful enough for
the user.
Nicolas
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp