memcpy of non-packed struct into packed struct (possible layout mismatch)
memcpy(&lsm.u.enable.event, ev, sizeof(lsm.u.enable.event));
copy "ev" (non-packed) into a packed structure.
We should copy each field one by one (create a copy_event_to_event_packed() helper to do so).
Updated by Michael Jeanson over 4 years ago
The "lttng_event" struct is not defined with the packed attribute, this attribute is only added when "lttng_event" is declared as a member of the "lttcomm_session_msg" struct. Adding the packed attribute to an already defined struct is ignored by the compiler, when it's done outside of a parent struct it generates a warning.
What this all means is that we are not copying a non-packed struct into a packed struct because there is no packed version of lttng_event. This also means we are using unpacked structures in the communication protocol between the client and the sessiond.