Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] [RFC PATCH lttng-tools 13/18] Add serialized versions of lttng_event structs
Date: Thu, 18 Apr 2019 15:45:26 -0400 (EDT)	[thread overview]
Message-ID: <1616121401.1570.1555616726710.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <20190418161850.1536-14-ylamarre@efficios.com>

----- On Apr 18, 2019, at 12:18 PM, Yannick Lamarre ylamarre at efficios.com wrote:

> Serialized versions of lttng_event, lttng_event_function_attr and
> lttng_event_probe_attr are packed structures to be used in communication
> protocols for consistent sizes across platforms. The serialized versions are
> stripped of pointers and padding.
> 
> Pointers are removed since their size can vary on platforms supporting
> variable sized registers (x86-64).

Same question about explanation as prior commits.

> Padding is also removed since it defeats the purpose of a packed struct.

Same question about documenting how the protocol is expected to be extended
as prior commits.

Thanks,

Mathieu

> 
> Signed-off-by: Yannick Lamarre <ylamarre at efficios.com>
> ---
> include/lttng/event-internal.h | 38 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 38 insertions(+)
> 
> diff --git a/include/lttng/event-internal.h b/include/lttng/event-internal.h
> index 09b4d232..a43007de 100644
> --- a/include/lttng/event-internal.h
> +++ b/include/lttng/event-internal.h
> @@ -27,6 +27,44 @@
> 
> struct lttng_userspace_probe_location;
> 
> +struct lttng_event_probe_attr_serialized {
> +	uint64_t addr;
> +
> +	uint64_t offset;
> +	char symbol_name[LTTNG_SYMBOL_NAME_LEN];
> +} LTTNG_PACKED;
> +
> +struct lttng_event_function_attr_serialized {
> +	char symbol_name[LTTNG_SYMBOL_NAME_LEN];
> +} LTTNG_PACKED;
> +
> +struct lttng_event_serialized {
> +	uint32_t type; /* enum lttng_event_type */
> +
> +	char name[LTTNG_SYMBOL_NAME_LEN];
> +
> +	uint32_t loglevel_type; /* enum lttng_loglevel_type */
> +
> +	int loglevel;
> +
> +	int32_t enabled;	/* Does not apply: -1 */
> +
> +	pid_t pid;
> +
> +	unsigned char filter;	/* filter enabled ? */
> +
> +	unsigned char exclusion; /* exclusions added ? */
> +
> +	/* Event flag, from 2.6 and above. */
> +	uint32_t flags; /* enum lttng_event_flag */
> +
> +	/* Per event type configuration */
> +	union {
> +		struct lttng_event_probe_attr_serialized probe;
> +		struct lttng_event_function_attr_serialized ftrace;
> +	} attr;
> +} LTTNG_PACKED;
> +
> struct lttng_event_perf_counter_ctx_serialized {
> 	uint32_t type;
> 	uint64_t config;
> --
> 2.11.0
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


  reply	other threads:[~2019-04-18 19:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 16:18 [lttng-dev] [RFC PATCH lttng-tools 00/18] Improvements in sessiond-comm Yannick Lamarre
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 01/18] Fix: Use platform-independant types in sessiond to consumerd communication Yannick Lamarre
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 02/18] Clean-up: Switch enum fields in lttcomm_consumer_msg Yannick Lamarre
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 03/18] Clean-up: Switch enum fields in lttcomm_consumer_status_msg Yannick Lamarre
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 04/18] Clean-up: Switch enum fields in lttcomm_consumer_status_channel Yannick Lamarre
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 05/18] Clean-up: Remove unused structure Yannick Lamarre
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 06/18] Clean-up: Removed deprecated field Yannick Lamarre
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 07/18] Add serialized versions of lttng_channel structs Yannick Lamarre
2019-04-18 19:38   ` Mathieu Desnoyers
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 08/18] Add serdes functions for lttng_channel Yannick Lamarre
2019-04-18 19:32   ` Mathieu Desnoyers
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 09/18] Integrate serialized communication in lttng-ctl and sessiond Yannick Lamarre
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 10/18] Add serialized versions of lttng_event_context structs Yannick Lamarre
2019-04-18 19:41   ` Mathieu Desnoyers
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 11/18] Add serdes functions for lttng_event_context Yannick Lamarre
2019-04-18 19:42   ` Mathieu Desnoyers
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 12/18] Integrate serialized communication in lttng-ctl and sessiond Yannick Lamarre
2019-04-18 19:44   ` Mathieu Desnoyers
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 13/18] Add serialized versions of lttng_event structs Yannick Lamarre
2019-04-18 19:45   ` Mathieu Desnoyers [this message]
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 14/18] Add serdes functions for lttng_event_context Yannick Lamarre
2019-04-18 19:46   ` Mathieu Desnoyers
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 15/18] Integrate serialized communication in lttng-ctl and sessiond Yannick Lamarre
2019-04-18 19:49   ` Mathieu Desnoyers
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 16/18] Add serialized versions of lttng_event structs Yannick Lamarre
2019-04-18 19:50   ` Mathieu Desnoyers
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 17/18] Add serdes functions for lttng_snapshot_output Yannick Lamarre
2019-04-18 19:52   ` Mathieu Desnoyers
2019-04-18 16:18 ` [lttng-dev] [RFC PATCH lttng-tools 18/18] Integrate serialized communication in lttng-ctl and sessiond Yannick Lamarre
2019-04-18 19:58   ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1616121401.1570.1555616726710.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox