[ltt-dev] net extended trace openin error with LTTV (without attachment)
Mathieu Desnoyers
compudj at krystal.dyndns.org
Wed Feb 10 16:25:01 EST 2010
* Benjamin Poirier (benjamin.poirier at polymtl.ca) wrote:
>
> Mathieu Desnoyers wrote:
> > * Mathieu Desnoyers (compudj at krystal.dyndns.org) wrote:
> >
[..]
> >> I found the culprit:
> >>
> >> include/linux/ltt-type-serializer.h:
> >>
> >> /*
> >> * Statically check that 0 < largest_align < sizeof(void *) to make sure it is
> >> * dumb-proof. It will make sure 0 is changed into 1 and unsigned long long is
> >> * changed into sizeof(void *) on 32-bit architectures.
> >> */
> >> static inline void ltt_specialized_trace(const struct marker *mdata,
> >> void *probe_data,
> >> void *serialize_private, unsigned int data_size,
> >> unsigned int largest_align)
> >> {
> >> largest_align = min_t(unsigned int, largest_align, sizeof(void *));
> >> largest_align = max_t(unsigned int, largest_align, 1);
> >> _ltt_specialized_trace(mdata, probe_data, serialize_private, data_size,
> >> largest_align);
> >> }
> >>
> >> It caps the alignment to the architecture size. I'll remove the min_t()
> >> line and it should be allright for the next release. Can you test it
> >> meanwhile ?
> >>
> >
> > LTTng 0.190 should fix this alignment problem. Feedback would be welcome.
> >
> > Thanks,
> >
> Nope, same problem I believe:
I just spent the afternoon looking at this problem, and noticed that the
alignment change introduced by trace format 2.4 does not follow the gcc
alignment. So I'll revert to the previous behavior and bump the trace
format version to 2.6.
Basically, alignment of uint64_t and unsigned long long will be on
32 bits (and not 64) on 32-bit architectures.
This will be fixed in the upcoming lttng and lttv versions.
Thanks,
Mathieu
>
> metadata.core_marker_id: 40.870000627 (/tmp/trace3/metadata_0), 0, 0, ,
> , 0, 0x0, MODE_UNKNOWN { channel = "net", name = "udpv4_rcv_extended",
> event_id = 2, int = 4, long = 4, pointer = 4, size_t = 4, alignment = 4 }
> metadata.core_marker_format: 40.870002196 (/tmp/trace3/metadata_0), 0,
> 0, , , 0, 0x0, MODE_UNKNOWN { channel = "net", name =
> "udpv4_rcv_extended", format = "skb 0x%lX saddr #n4u%lu daddr #n4u%lu
> unicast #1u%u ulen #n2u%hu source #n2u%hu dest #n2u%hu data_start #8u%lx" }
> [...]
> net.udpv4_rcv_extended: 44.175529809 (/tmp/trace3/net_0), 0, 0, swapper,
> , 0, 0x0, SOFTIRQ { skb = 0xDA225A80, saddr = 2228195330, daddr =
> 2228200116, unicast = 1, ulen = 188, source = 53, dest = 45569,
> data_start = a2068db001000100 }
> **
> ERROR:tracefile.c:1582:ltt_update_event_size: assertion failed: (info !=
> NULL)
> > Mathieu
> >
> >
> >> Thanks,
> >>
> >> Mathieu
> >>
> >>
> >>
> >>> -Ben
> >>>
> >>>> Thanks,
> >>>>
> >>>> Mathieu
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>> diff --git a/ltt/probes/net-extended-trace.c b/ltt/probes/net-extended-trace.c
> >>>>> index 074bfec..88410f8 100644
> >>>>> --- a/ltt/probes/net-extended-trace.c
> >>>>> +++ b/ltt/probes/net-extended-trace.c
> >>>>> @@ -130,14 +130,14 @@ notrace void probe_udpv4_rcv_extended(struct sk_buff *skb)
> >>>>> * bytes of UDP data if they are not in a fragment*/
> >>>>> data.f8 = 0;
> >>>>> if (skb_headlen(skb) >= sizeof(struct udphdr) + 8)
> >>>>> - data.f8 = *(unsigned long long *)(skb->data + sizeof(*uh));
> >>>>> + data.f8 = *(uint64_t *)(skb->data + sizeof(*uh));
> >>>>> else if (skb_headlen(skb) >= sizeof(struct udphdr))
> >>>>> memcpy(&data.f8, skb->data + sizeof(struct udphdr),
> >>>>> skb_headlen(skb) - sizeof(struct udphdr));
> >>>>>
> >>>>> marker = &GET_MARKER(net, udpv4_rcv_extended);
> >>>>> ltt_specialized_trace(marker, marker->single.probe_private,
> >>>>> - &data, serialize_sizeof(data), sizeof(unsigned long long));
> >>>>> + &data, serialize_sizeof(data), sizeof(uint64_t));
> >>>>> }
> >>>>>
> >>>>> MODULE_LICENSE("GPL and additional rights");
> >>>>>
> >>>>>
> >>>>>
> >>>>>> Thanks,
> >>>>>> Gergely
> >>>>>>
> >>>>>>
> >>>>>> ------------------------------------------------------------------------
> >>>>>>
> >>>>>> _______________________________________________
> >>>>>> ltt-dev mailing list
> >>>>>> ltt-dev at lists.casi.polymtl.ca
> >>>>>> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> >>>>>>
> >>>>>>
> >>>>> _______________________________________________
> >>>>> ltt-dev mailing list
> >>>>> ltt-dev at lists.casi.polymtl.ca
> >>>>> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >> --
> >> Mathieu Desnoyers
> >> OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
> >>
> >> _______________________________________________
> >> ltt-dev mailing list
> >> ltt-dev at lists.casi.polymtl.ca
> >> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> >>
> >>
> >
> >
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
More information about the lttng-dev
mailing list