Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp909048imm; Wed, 15 Aug 2018 08:09:56 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyRl58mh9eFh113n7tNE1yOj3eSLwwVWF28z+NWA1SIDeanMUkdUZotRr+daJbk1Ou1j8i7 X-Received: by 2002:aa7:8591:: with SMTP id w17-v6mr28355843pfn.77.1534345796615; Wed, 15 Aug 2018 08:09:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534345796; cv=none; d=google.com; s=arc-20160816; b=FBm1vFWPN6nNfDmUA8Q1vKDOHixb4HKfn4wuJ+kjxxufHK4GyIRJ0tpvMo45htvTYe hKXhIE5/ypbJyVTU470FkpS7Qhfk68Gim4qsWFxGLP7VtScQbIukEd6AOyEMrlkF6apq z2t+O53B823ORzm7rSXRgYCHJ192vZgKoLEdZgb64TMkp/rb7XWQZeEU4IjtTa72J3PM VmNhQlifvzLGhLOWj3x5yH0NEewWBInuhxIzEE+8ojNVOHV/n06jR/NboLqpADUYyMtO UC5G8USXrDyRCWc7dEAa3KTNKJuEwkD5yHDxw5WzEyHoUJWnvs4ck9Uxw8rUlISiyHe/ C6Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=6DMM6pp/lzbCPWp+3gsUhe1p59hLMN84kPt2VL6olCk=; b=VgsiFykRiqDoY7Nyt2VFRmzogO4ikrus8elcJEHQyRzGGjNvkU8GsLMQpbkjqtaphL NFsrA5be8JE8W5NAVLbLTb6rJiLOKyNQdpc9eh8RyWbekED7lo/ctV+NSdB86uhvGC/E bf3CGxWAADF9AghCCrW+cWSfDvC0sczyMgSQmPMey//5pfVu35GxfSFFktLLprBsDnXU DI01F4eE5FR0LqIecUjTgXyfwNvjePf3b7Lef7sHbC4J0iAvPkiHLTRjO6EtYS1YMxu3 vpPzbcxKp3opeJs7krdTtgPlNEpME91EgVs8bLOGcmtKkxj7allj6FhCAUjdmVz/8Z5j J6WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="lgfHZ3Y/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p21-v6si5377203plq.338.2018.08.15.08.09.41; Wed, 15 Aug 2018 08:09:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="lgfHZ3Y/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730507AbeHOSAr (ORCPT + 99 others); Wed, 15 Aug 2018 14:00:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:50644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730492AbeHOSAr (ORCPT ); Wed, 15 Aug 2018 14:00:47 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 12C8C20C0E; Wed, 15 Aug 2018 15:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1534345693; bh=kaSoyWxQZOFSr1hPJCgPbgfhqpnv+6za7eqgW6vRgMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lgfHZ3Y/n6kUFGN4+7HEPBgUNcd1LmN/XZE/vJamrtjetuvbbgR5k4WILPZZY2pfS Rucx8vVcfK6gfrbw4xKbbSNnvNaIk8lsX5L5aRk76mG5pQOfafsU05vceATk56sN9c fhelfngxoTF45NNoF1OzMvKX+EV6Yfh78XG3M+Ts= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, "Tzvetomir Stoyanov (VMware)" , Andrew Morton , Peter Zijlstra , Yordan Karadzhov , linux-trace-devel@vger.kernel.org, Steven Rostedt , Arnaldo Carvalho de Melo Subject: [PATCH 23/35] tools lib traceevent: Rename internal parser related APIs Date: Wed, 15 Aug 2018 12:05:59 -0300 Message-Id: <20180815150611.32080-24-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180815150611.32080-1-acme@kernel.org> References: <20180815150611.32080-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Tzvetomir Stoyanov (VMware)" 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_" and not "pevent_". This changes APIs: pevent_buffer_init, pevent_read_token, pevent_free_token, pevent_peek_char, pevent_get_input_buf, pevent_get_input_buf_ptr Signed-off-by: Tzvetomir Stoyanov (VMware) Cc: Andrew Morton Cc: Peter Zijlstra Cc: Yordan Karadzhov (VMware) Cc: linux-trace-devel@vger.kernel.org Link: http://lkml.kernel.org/r/20180808180703.275281085@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/event-parse.c | 24 ++++++++++++------------ tools/lib/traceevent/event-parse.h | 12 ++++++------ tools/lib/traceevent/parse-filter.c | 16 ++++++++-------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index d367f7f2f2fc..8215e6ff36eb 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -73,12 +73,12 @@ static void init_input_buf(const char *buf, unsigned long long size) input_buf_ptr = 0; } -const char *pevent_get_input_buf(void) +const char *tep_get_input_buf(void) { return input_buf; } -unsigned long long pevent_get_input_buf_ptr(void) +unsigned long long tep_get_input_buf_ptr(void) { return input_buf_ptr; } @@ -113,14 +113,14 @@ process_defined_func(struct trace_seq *s, void *data, int size, static void free_func_handle(struct tep_function_handler *func); /** - * pevent_buffer_init - init buffer for parsing + * tep_buffer_init - init buffer for parsing * @buf: buffer to parse * @size: the size of the buffer * - * For use with pevent_read_token(), this initializes the internal - * buffer that pevent_read_token() will parse. + * For use with tep_read_token(), this initializes the internal + * buffer that tep_read_token() will parse. */ -void pevent_buffer_init(const char *buf, unsigned long long size) +void tep_buffer_init(const char *buf, unsigned long long size) { init_input_buf(buf, size); } @@ -913,11 +913,11 @@ static int __peek_char(void) } /** - * pevent_peek_char - peek at the next character that will be read + * tep_peek_char - peek at the next character that will be read * * Returns the next character read, or -1 if end of buffer. */ -int pevent_peek_char(void) +int tep_peek_char(void) { return __peek_char(); } @@ -1157,7 +1157,7 @@ static enum event_type read_token(char **tok) } /** - * pevent_read_token - access to utilites to use the pevent parser + * tep_read_token - access to utilites to use the pevent parser * @tok: The token to return * * This will parse tokens from the string given by @@ -1165,16 +1165,16 @@ static enum event_type read_token(char **tok) * * Returns the token type. */ -enum event_type pevent_read_token(char **tok) +enum event_type tep_read_token(char **tok) { return read_token(tok); } /** - * pevent_free_token - free a token returned by pevent_read_token + * tep_free_token - free a token returned by tep_read_token * @token: the token to free */ -void pevent_free_token(char *token) +void tep_free_token(char *token) { free_token(token); } diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index 7f8921431cf1..c41547353b4c 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h @@ -797,12 +797,12 @@ void pevent_ref(struct tep_handle *pevent); void pevent_unref(struct tep_handle *pevent); /* access to the internal parser */ -void pevent_buffer_init(const char *buf, unsigned long long size); -enum event_type pevent_read_token(char **tok); -void pevent_free_token(char *token); -int pevent_peek_char(void); -const char *pevent_get_input_buf(void); -unsigned long long pevent_get_input_buf_ptr(void); +void tep_buffer_init(const char *buf, unsigned long long size); +enum event_type tep_read_token(char **tok); +void tep_free_token(char *token); +int tep_peek_char(void); +const char *tep_get_input_buf(void); +unsigned long long tep_get_input_buf_ptr(void); /* for debugging */ void tep_print_funcs(struct tep_handle *pevent); diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index 3efab9b4298f..5e3f29736a25 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c @@ -51,8 +51,8 @@ static void show_error(char *error_buf, const char *fmt, ...) int len; int i; - input = pevent_get_input_buf(); - index = pevent_get_input_buf_ptr(); + input = tep_get_input_buf(); + index = tep_get_input_buf_ptr(); len = input ? strlen(input) : 0; if (len) { @@ -72,7 +72,7 @@ static void show_error(char *error_buf, const char *fmt, ...) static void free_token(char *token) { - pevent_free_token(token); + tep_free_token(token); } static enum event_type read_token(char **tok) @@ -82,13 +82,13 @@ static enum event_type read_token(char **tok) do { free_token(token); - type = pevent_read_token(&token); + type = tep_read_token(&token); } while (type == EVENT_NEWLINE || type == EVENT_SPACE); /* If token is = or ! check to see if the next char is ~ */ if (token && (strcmp(token, "=") == 0 || strcmp(token, "!") == 0) && - pevent_peek_char() == '~') { + tep_peek_char() == '~') { /* append it */ *tok = malloc(3); if (*tok == NULL) { @@ -98,7 +98,7 @@ static enum event_type read_token(char **tok) sprintf(*tok, "%c%c", *token, '~'); free_token(token); /* Now remove the '~' from the buffer */ - pevent_read_token(&token); + tep_read_token(&token); free_token(token); } else *tok = token; @@ -1198,7 +1198,7 @@ process_event(struct event_format *event, const char *filter_str, { int ret; - pevent_buffer_init(filter_str, strlen(filter_str)); + tep_buffer_init(filter_str, strlen(filter_str)); ret = process_filter(event, parg, error_str, 0); if (ret < 0) @@ -1254,7 +1254,7 @@ filter_event(struct event_filter *filter, struct event_format *event, static void filter_init_error_buf(struct event_filter *filter) { /* clear buffer to reset show error */ - pevent_buffer_init("", 0); + tep_buffer_init("", 0); filter->error_buffer[0] = '\0'; } -- 2.14.4