From: Jan Kiszka <jan.kiszka@domain.hid>
To: Markus.Franke@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] parallelport module for measuring external interrupt latency
Date: Wed, 03 Jan 2007 11:48:57 +0100 [thread overview]
Message-ID: <459B8A19.2060809@domain.hid> (raw)
In-Reply-To: <459B8382.7060508@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2743 bytes --]
Markus Franke wrote:
> Jan Kiszka wrote:
>>> // ISR
>>> int parport_isr(xnintr_t* cookie)
>>> {
>>> rdtsc(t_end);
>>>
>>> outb(0x00,SPPDATAPORT);
>>>
>>> #ifdef DEBUG
>>> printk(KERN_INFO "parport_latency: Interrupt fired!!!\n");
>>> printk(KERN_INFO "parport_latency: interruptcount before = %d!!!\n",atomic_read(&interruptcount));
>>> #endif
>>>
>>> atomic_inc(&interruptcount);
>>>
>>> #ifdef DEBUG
>>> printk(KERN_INFO "parport_latency: interruptcount after= %d!!!\n",atomic_read(&interruptcount));
>>> #endif
>>>
>>> wake_up_interruptible(&intlatpar_queue);
>>
>> This is a hard-RT IRQ handler, thus any scheduling Linux service is
>> strictly forbidden.
>>
>> [Reminds me of the I-pipe debugging service that can catch such faults
>> but still needs some integration work...]
>
> Ok I understand. But somehow I have to notify the read()-call that it
> can compute the latency value. Do you have any suggestions how to do that?
Even if the notification is not time-critical, you first have to get out
of the Xenomai context in a sane manner. rtdm_nrtsig may help if you
don't want to use the RT scheduler for user task wakeup.
>
>>> if(register_chrdev(INTLAT_DEV_MAJOR,INTLAT_DEV_NAME,&intlat_fops) < 0)
>>> {
>>> printk(KERN_WARNING "intlat: parport_latency(): register_chrdev() failed.\n");
>>> rt_intr_disable(&intr);
>>> return -1;
>>> }
>>
>> Hmm, a Linux character device for this purpose... I guess you should
>> study the existing irqbench test a bit first. And if you don't see why
>> something is done the way it is - ask here.
>
> Yes of course I have already studied the irqbench test but it uses the
> RTDM skin. I also know that this skin should be used for developing hard
> realtime drivers. But I just need to measure latencies and I don't want
> to develop a huge realtime driver. I just need some values for
Well, irqbench contains a bunch of test cases. If you cut it down to
only your scenario, it wouldn't appear as that "huge", it would likely
be as long as your own driver.
> comparison with the driver working on plain linux. I was wondering
> whether it is possible to rewrite the driver working on plain linux by
> using the Xenomai native API.
> Why isn't it possible to use a Linux character device. I just want to
> transfer the latency values to the user space task which is out of any
> realtime context I think.
You can - if you keep a clean separation between RT and non-RT. Direct
wakeup from the Xenomai IRQ handler is forbidden, but indirect via a
rtdm_nrtsig trampoline would be feasible. [In that case you could also
drop all Xenomai functions from your user-space tool and use plain Linux.]
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2007-01-03 10:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-03 8:47 [Xenomai-help] parallelport module for measuring external interrupt latency Markus Franke
2007-01-03 9:50 ` Jan Kiszka
2007-01-03 10:20 ` Markus Franke
2007-01-03 10:48 ` Jan Kiszka [this message]
2007-01-03 20:36 ` Markus Franke
2007-01-03 20:58 ` Jan Kiszka
[not found] ` <459CC4D9.9080404@domain.hid>
2007-01-04 18:27 ` Markus Franke
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=459B8A19.2060809@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=Markus.Franke@domain.hid \
--cc=xenomai@xenomai.org \
/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.