From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] I-pipe hosted tracing service
Date: Wed, 28 Dec 2005 12:35:59 +0100 [thread overview]
Message-ID: <43B2789F.2090104@domain.hid> (raw)
In-Reply-To: <43B26587.9090809@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2243 bytes --]
Philippe Gerum wrote:
>> ...
>> +#ifdef CONFIG_IPIPE_TRACE
>> +extern void __ipipe_init_trace_proc(void);
>> +#else /* !CONFIG_IPIPE_TRACE */
>> +# define __ipipe_init_trace_proc()
>> +#endif /* CONFIG_IPIPE_TRACE */
>> +
>
>
> Better move this to linux/ipipe.h.
Ok.
>> +
>> +#include <linux/kernel.h>
>> +#include <linux/module.h>
>> +#include <linux/version.h>
>> +#include <linux/kallsyms.h>
>> +#include <linux/seq_file.h>
>> +#include <linux/proc_fs.h>
>> +#include <linux/ctype.h>
>> +#include <linux/ipipe_trace.h>
>> +#include <asm/uaccess.h>
>> +
>> +#ifndef CONFIG_ARM
>
>
> Eeek... Any chance to have such arch-dependent stuff out of the generic
> core? I'd better see this in asm/ipipe.h.
>
>> +# define __CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
>> +# define __CALLER_ADDR1 ((unsigned long)__builtin_return_address(1))
>> +#else
>> +# error Implement ipipe_arm_return_addr!
>> + unsigned long ipipe_arm_return_addr(int level);
>> +# define __CALLER_ADDR0 ipipe_arm_return_addr(0)
>> +# define __CALLER_ADDR1 ipipe_arm_return_addr(1)
>> +#endif
>> +
Ok. Will add something like
#ifndef BROKEN_BUILTIN_RETURN_ADDRESS
#define __BUILTIN_RETURN_ADDRESS0 \
((unsigned long)__builtin_return_address(0))
...
#endif
to linux/ipipe.h and we may later add
unsigned long ipipe_arm_return_addr(int level);
#define BROKEN_BUILTIN_RETURN_ADDRESS 1
#define __BUILTIN_RETURN_ADDRESS0 ipipe_arm_return_addr(0)
...
to an upcoming asm-arm/ipipe.h. Ack?
>> +
>> +static inline unsigned long ipipe_tsc2us(unsigned long long delta)
>> +{
>> +#ifdef CONFIG_X86
>> + do_div(delta, cpu_khz/1000+1);
>> +#elif defined(CONFIG_PPC)
>> + delta = mulhwu(tb_to_us, delta);
>> +#elif defined(CONFIG_ARM)
>> + delta = mach_cycles_to_usecs(delta);
>> +#else
>> + #error Implement ipipe_tsc2us.
>> +#endif
>
>
> Ditto. Actually, recent ipipe patches implement ipipe_tsc2ns already.
>
Hmm, switching to ipipe_tsc2ns/1000 for the microsecond calculation may
work without loosing too much precision (the only exception would be a
trace over more than a few seconds - not very common). But is
ipipe_tsc2ns supposed to work on signed arguments on all archs, or do I
have to continue handling this separately?
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
next prev parent reply other threads:[~2005-12-28 11:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-27 12:48 [Xenomai-core] [PATCH] I-pipe hosted tracing service Jan Kiszka
2005-12-28 10:14 ` Philippe Gerum
2005-12-28 11:35 ` Jan Kiszka [this message]
2005-12-28 11:58 ` Philippe Gerum
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=43B2789F.2090104@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=rpm@xenomai.org \
--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.