From patchwork Wed Sep 19 11:12:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tzvetomir Stoyanov (VMware)" X-Patchwork-Id: 10759293 Return-Path: Received: from mail-wr1-f68.google.com ([209.85.221.68]:37462 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731230AbeISQu3 (ORCPT ); Wed, 19 Sep 2018 12:50:29 -0400 Received: by mail-wr1-f68.google.com with SMTP id u12-v6so5361823wrr.4 for ; Wed, 19 Sep 2018 04:13:03 -0700 (PDT) From: "Tzvetomir Stoyanov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 2/2] tools/lib/traceevent: Add prefix tep_ to enum filter_trivial_type and all its members Date: Wed, 19 Sep 2018 14:12:59 +0300 Message-Id: <20180919111259.5020-2-tz.stoyanov@gmail.com> In-Reply-To: <20180919111259.5020-1-tz.stoyanov@gmail.com> References: <20180918223712.0ade106b@vmware.local.home> <20180919111259.5020-1-tz.stoyanov@gmail.com> Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 5153 In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. That prefix will be "tep_". This adds prefix tep_ to enum filter_trivial_type and all its members. Signed-off-by: Tzvetomir Stoyanov (VMware) --- tools/lib/traceevent/event-parse.h | 14 +++++++------- tools/lib/traceevent/parse-filter.c | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index 2551fefcb413..4b0ab69f6b3a 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h @@ -947,10 +947,10 @@ struct tep_event_filter *tep_filter_alloc(struct tep_handle *pevent); #define FILTER_MISS TEP_ERRNO__FILTER_MISS #define FILTER_MATCH TEP_ERRNO__FILTER_MATCH -enum filter_trivial_type { - FILTER_TRIVIAL_FALSE, - FILTER_TRIVIAL_TRUE, - FILTER_TRIVIAL_BOTH, +enum tep_filter_trivial_type { + TEP_FILTER_TRIVIAL_FALSE, + TEP_FILTER_TRIVIAL_TRUE, + TEP_FILTER_TRIVIAL_BOTH, }; enum tep_errno tep_filter_add_filter_str(struct tep_event_filter *filter, @@ -968,7 +968,7 @@ int tep_event_filtered(struct tep_event_filter *filter, void tep_filter_reset(struct tep_event_filter *filter); int tep_filter_clear_trivial(struct tep_event_filter *filter, - enum filter_trivial_type type); + enum tep_filter_trivial_type type); void tep_filter_free(struct tep_event_filter *filter); @@ -979,12 +979,12 @@ int tep_filter_remove_event(struct tep_event_filter *filter, int tep_filter_event_has_trivial(struct tep_event_filter *filter, int event_id, - enum filter_trivial_type type); + enum tep_filter_trivial_type type); int tep_filter_copy(struct tep_event_filter *dest, struct tep_event_filter *source); int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *source, - enum filter_trivial_type type); + enum tep_filter_trivial_type type); int tep_filter_compare(struct tep_event_filter *filter1, struct tep_event_filter *filter2); diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index daa205d9a930..c4a5404f5f2b 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c @@ -1548,7 +1548,7 @@ int tep_filter_copy(struct tep_event_filter *dest, struct tep_event_filter *sour * events may have still been updated on error. */ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *source, - enum filter_trivial_type type) + enum tep_filter_trivial_type type) { struct tep_handle *src_pevent; struct tep_handle *dest_pevent; @@ -1570,8 +1570,8 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s arg = filter_type->filter; if (arg->type != TEP_FILTER_ARG_BOOLEAN) continue; - if ((arg->boolean.value && type == FILTER_TRIVIAL_FALSE) || - (!arg->boolean.value && type == FILTER_TRIVIAL_TRUE)) + if ((arg->boolean.value && type == TEP_FILTER_TRIVIAL_FALSE) || + (!arg->boolean.value && type == TEP_FILTER_TRIVIAL_TRUE)) continue; event = filter_type->event; @@ -1607,7 +1607,7 @@ int tep_update_trivial(struct tep_event_filter *dest, struct tep_event_filter *s * Returns 0 on success and -1 if there was a problem. */ int tep_filter_clear_trivial(struct tep_event_filter *filter, - enum filter_trivial_type type) + enum tep_filter_trivial_type type) { struct tep_filter_type *filter_type; int count = 0; @@ -1628,11 +1628,11 @@ int tep_filter_clear_trivial(struct tep_event_filter *filter, if (filter_type->filter->type != TEP_FILTER_ARG_BOOLEAN) continue; switch (type) { - case FILTER_TRIVIAL_FALSE: + case TEP_FILTER_TRIVIAL_FALSE: if (filter_type->filter->boolean.value) continue; break; - case FILTER_TRIVIAL_TRUE: + case TEP_FILTER_TRIVIAL_TRUE: if (!filter_type->filter->boolean.value) continue; default: @@ -1670,7 +1670,7 @@ int tep_filter_clear_trivial(struct tep_event_filter *filter, */ int tep_filter_event_has_trivial(struct tep_event_filter *filter, int event_id, - enum filter_trivial_type type) + enum tep_filter_trivial_type type) { struct tep_filter_type *filter_type; @@ -1686,10 +1686,10 @@ int tep_filter_event_has_trivial(struct tep_event_filter *filter, return 0; switch (type) { - case FILTER_TRIVIAL_FALSE: + case TEP_FILTER_TRIVIAL_FALSE: return !filter_type->filter->boolean.value; - case FILTER_TRIVIAL_TRUE: + case TEP_FILTER_TRIVIAL_TRUE: return filter_type->filter->boolean.value; default: return 1; @@ -2423,8 +2423,8 @@ int tep_filter_compare(struct tep_event_filter *filter1, struct tep_event_filter if (filter_type1->filter->type != filter_type2->filter->type) break; switch (filter_type1->filter->type) { - case FILTER_TRIVIAL_FALSE: - case FILTER_TRIVIAL_TRUE: + case TEP_FILTER_TRIVIAL_FALSE: + case TEP_FILTER_TRIVIAL_TRUE: /* trivial types just need the type compared */ continue; default: