[lttng-dev] Question about performance and tracepoint structure
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Wed Jul 10 13:25:54 EDT 2013
* Amit Margalit (AMITM at il.ibm.com) wrote:
> Hi,
>
> This may be a bit of a noob question, and I think I read about this
> somewhere but I can't find it now.
>
> When I declare a tracepoint that's made up of a uint8_t, followed by a
> uint16_t followed by a uint32_t, for example, there are 2 ways to handle
> this - packed or unpacked.
>
> If we're doing packed, then we have to include some code that does the
> packing properly as alignment issues can creep up. This code causes us to
> incur some CPU cycles at that point.
it's not code. it's just that cpus are slightly slower at doing
unaligned accesses than aligned accesses.
> If we're doing unpacked, then we incur some cycles on passing the event to
> the sessiond, and sessiond suffers by having to write down some extra
> bytes, which is less efficient.
yes
>
> Either way, I think it means I can gain some minor performance
> improvements if I reorder my tracepoint arguments to a more efficient
> order - alignment-wise.
Well, yes. You will want to reorder the tracepoint "TP_FIELDS" so the
largest fields come first, followed by the smaller fields.
The order of arguments (TP_ARGS) does not matter.
Thanks,
Mathieu
>
> Am I barking up the wrong tree here?
>
> Thanks,
>
> Amit Margalit
> IBM XIV - Storage Reinvented
> XIV-NAS Development Team
> Tel. 03-689-7774
> Fax. 03-689-7230
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list