[lttng-dev] Question about performance and tracepoint structure
mathieu.desnoyers at efficios.com
Wed Jul 10 13:25:54 EDT 2013
* Amit Margalit (AMITM at il.ibm.com) wrote:
> 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.
> 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.
> Am I barking up the wrong tree here?
> 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
More information about the lttng-dev