ARM - events lost and cmpxchg
Gunnar Larisch <[email protected]>
| Newsgroups | gmane.linux.kernel.tracing |
|---|---|
| Message-ID | <[email protected]> |
Hi,
on ARM I noticed significant loss of events. At the
end of a trace I get
a printk message of over 100 lost events per second:
LTT : cpu_ : 122 events lost in cpu_ channel (cpu 0).
I have traced them to the place in ltt/ltt-relay.c
where the check
"*tsc == 0" is located. Is it normal that there are so
much events lost?
Which events are lost here?
To get it compile clean, I had to add the function
cmpxchg, which was
missing on arm, needed in ltt/ltt-relay.c. I don't
know, if it is
possible to avoid locking interrupts on arm:
static inline long cmpxchg(atomic_long_t *v, long old,
long new)
{
long ret;
unsigned long flags;
raw_local_irq_save(flags);
ret = v->counter;
if (likely(ret == old))
v->counter = new;
raw_local_irq_restore(flags);
return ret;
}
For this to work I also adapted the function
atomic_long_cmpxchg
in include/asm-generic/atomic.h. This will propably
break it for other
architectures, but I think "(l)->counter" should be
placed in the
architecture specific files.
#define atomic_long_cmpxchg(l, old, new) \
- ((long)cmpxchg(&((l)->counter), (old), (new)))
+ ((long)cmpxchg(l, (old), (new)))
Any suggestions?
Thanks,
Gunnar
___________________________________________________________
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de