From: Wolfgang Grandegger <wg@grandegger.com>
To: Mohamed HAMZAOUI <requinham@gmail.com>
Cc: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>,
linux-can Mailing List <linux-can@vger.kernel.org>
Subject: Re: [SocketCan] Problem of accuracy
Date: Sat, 07 Jul 2012 12:32:12 +0200 [thread overview]
Message-ID: <4FF8102C.8030609@grandegger.com> (raw)
In-Reply-To: <CABMxt4h2mm+FDKBKAGW=UvgOZJVUEmkrH9yKULZaJz5P5HvyBQ@mail.gmail.com>
On 07/07/2012 12:02 PM, Mohamed HAMZAOUI wrote:
> Hi,
>
> I recompiled the Kernel with activate preemption. I test cangen and
> tst-bcm-cycle but i have the same result around accuracy. I tried to
> change the application priority with nice command to high priority but
> the problem persist !
This problem is not CAN related. Anyway, you can read/try/check:
- are high-resolution timers enabled in your kernel?
- use cyclictest [1] to measure user-space timing accuracy.
- use clock_nanosleep for periodic tasks.
- try to start cangen with "chrt -f 10 cangen can0".
- read "man sched_setscheduler" for a description of the Linux
scheduling scheme.
[1] https://rt.wiki.kernel.org/index.php/Cyclictest
Wolfgang.
> Le jeudi 5 juillet 2012, Oliver Hartkopp a écrit :
>>
>> On 05.07.2012 10:12, Mohamed HAMZAOUI wrote:
>>>
>>> Hi,
>>>
>>> i'm a new user of socketcan and, i cross compile can-utils for my craneboard
>>> card (a card with CAN).
>>> When i run cangen with 1 ms period, the period is not respected (1,407, 1.399,
>>> ...) !
>>>
>>> How can i fix this problem ?
>>>
>>> my can version in /proc/net/can/version is "rev 20090105 abi 8" and i'm on
>>> : Linux am3517-crane 2.6.32 #1 Mon Apr 23 00:13:28 CEST 2012 armv7l GNU/Linux
>>>
>>
>> Hello Mohamed,
>>
>> first please move to the new CAN mailing list (see CC) - and don't use HTML-mails (text-only is better) ;-)
>>
>> Regarding your problem:
>>
>> Usually i get smaller derivations on my system - but your Linux box is probably not very fast, so that you can see these scheduling influences with cangen ...
>>
>> cangen is a userpace app and therefore it is usually not that precise as hrtimers inside the Linux kernel (if you don't use any realtime Linux).
>>
>> But you may try the Broadcast-Manager to place a 'cyclic sending job' inside the Linux kernel. See an example here:
>>
>> http://svn.berlios.de/wsvn/socketcan/trunk/test/tst-bcm-cycle.c
>>
>> Regards,
>> Oliver
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
next prev parent reply other threads:[~2012-07-07 10:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CABMxt4ijuTMYFYXx0n4AYBO6-=SRD0U3F4BTA2=rWE80Z4-yOA@mail.gmail.com>
2012-07-05 8:38 ` Problem of accuracy Oliver Hartkopp
2012-07-07 10:02 ` [SocketCan] " Mohamed HAMZAOUI
2012-07-07 10:32 ` Wolfgang Grandegger [this message]
2012-07-08 19:43 ` Mohamed HAMZAOUI
2012-07-08 20:13 ` Wolfgang Grandegger
2012-07-08 20:30 ` Mohamed HAMZAOUI
2012-07-09 7:18 ` Wolfgang Grandegger
2012-07-09 8:14 ` Mohamed HAMZAOUI
2012-07-09 8:20 ` Wolfgang Grandegger
2012-07-09 9:19 ` Mohamed HAMZAOUI
2012-07-09 9:22 ` Wolfgang Grandegger
[not found] ` <CABMxt4jnztXqAmLFcBnqp3001QXds1nX3xA2y_ka=xCNr0cjjA@mail.gmail.com>
[not found] ` <4FFAB09F.6090800@grandegger.com>
[not found] ` <CABMxt4jLRKz8xKNbH3Qa=P0k1aEjMsqmo2vArGDo2O1Wf0=wGQ@mail.gmail.com>
2012-07-09 11:26 ` Fwd: " Mohamed HAMZAOUI
2012-07-09 11:40 ` Wolfgang Grandegger
2012-07-09 11:57 ` Mohamed HAMZAOUI
2012-07-09 12:15 ` Wolfgang Grandegger
2012-07-09 13:19 ` Pavel Pisa
2012-07-09 14:29 ` Mohamed HAMZAOUI
2012-07-09 14:35 ` Mohamed HAMZAOUI
2012-07-09 14:40 ` Kurt Van Dijck
2012-07-09 14:57 ` Alexander Stein
2012-07-09 15:39 ` Mohamed HAMZAOUI
2012-07-09 17:08 ` Oliver Hartkopp
2012-07-09 20:50 ` Wolfgang Grandegger
2012-07-10 22:11 ` Mohamed HAMZAOUI
2012-07-11 12:35 ` Mohamed HAMZAOUI
2012-07-11 22:22 ` Wolfgang Grandegger
2012-07-11 22:19 ` Wolfgang Grandegger
2012-07-09 6:55 ` Kurt Van Dijck
[not found] ` <1341488146.2416.9.camel@slaptop>
2012-07-05 13:57 ` [Socketcan-users] back to back can frames Kurt Van Dijck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FF8102C.8030609@grandegger.com \
--to=wg@grandegger.com \
--cc=linux-can@vger.kernel.org \
--cc=oliver.hartkopp@volkswagen.de \
--cc=requinham@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.