From: Jérémie Galarneau Date: Tue, 8 Mar 2016 15:59:09 +0000 (-0500) Subject: Rename filter string to filter expression in liblttng-ctl X-Git-Tag: v2.8.0-rc1~107 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=134e72ede7c667571e24f63cd45cdc52e12c7de8;p=lttng-tools.git Rename filter string to filter expression in liblttng-ctl Signed-off-by: Jérémie Galarneau --- diff --git a/include/lttng/event.h b/include/lttng/event.h index a97f8ffaa..b2e4b7d89 100644 --- a/include/lttng/event.h +++ b/include/lttng/event.h @@ -296,15 +296,16 @@ extern int lttng_list_events(struct lttng_handle *handle, const char *channel_name, struct lttng_event **events); /* - * Get the filter string of a specific LTTng event. + * Get the filter expression of a specific LTTng event. * - * If the call is successful, then the filter string's address is put - * in *filter_string. If the event has no filter string, *filter_string - * is set to NULL. The caller does NOT own *filter_string. + * If the call is successful, then the filter expression's address is put + * in *filter_expression. If the event has no filter expression, + * *filter_expression is set to NULL. The caller does NOT own + * *filter_expression. * * Returns 0 on success, or a negative LTTng error code on error. */ -extern int lttng_event_get_filter_string(struct lttng_event *event, +extern int lttng_event_get_filter_expression(struct lttng_event *event, const char **filter_string); /* diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 8e69e09ef..1cce29b71 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -278,7 +278,7 @@ static void print_events(struct lttng_event *event) char *filter_msg = NULL; char *exclusion_msg = NULL; - ret = lttng_event_get_filter_string(event, &filter_str); + ret = lttng_event_get_filter_expression(event, &filter_str); if (ret) { filter_msg = strdup(" [failed to retrieve filter]"); @@ -1072,7 +1072,8 @@ static int list_session_agent_events(void) char *filter_msg = NULL; struct lttng_event *event = &events[i]; - ret = lttng_event_get_filter_string(event, &filter_str); + ret = lttng_event_get_filter_expression(event, + &filter_str); if (ret) { filter_msg = strdup(" [failed to retrieve filter]"); } else if (filter_str) { diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c index 5530acee9..8401c2671 100644 --- a/src/common/mi-lttng.c +++ b/src/common/mi-lttng.c @@ -1022,7 +1022,7 @@ int mi_lttng_event_common_attributes(struct mi_writer *writer, } /* Event filter expression */ - ret = lttng_event_get_filter_string(event, &filter_expression); + ret = lttng_event_get_filter_expression(event, &filter_expression); if (ret) { goto end; } diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 157d9a433..fe0527d42 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1809,13 +1809,13 @@ error: return ret; } -int lttng_event_get_filter_string(struct lttng_event *event, - const char **filter_string) +int lttng_event_get_filter_expression(struct lttng_event *event, + const char **filter_expression) { int ret = 0; struct lttcomm_event_extended_header *ext_header; - if (!event || !filter_string) { + if (!event || !filter_expression) { ret = -LTTNG_ERR_INVALID; goto end; } @@ -1827,15 +1827,15 @@ int lttng_event_get_filter_string(struct lttng_event *event, * This can happen since the lttng_event structure is * used for other tasks where this pointer is never set. */ - *filter_string = NULL; + *filter_expression = NULL; goto end; } if (ext_header->filter_len) { - *filter_string = ((const char *) (ext_header)) + - sizeof(*ext_header); + *filter_expression = ((const char *) (ext_header)) + + sizeof(*ext_header); } else { - *filter_string = NULL; + *filter_expression = NULL; } end: