Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp908808imm; Wed, 15 Aug 2018 08:09:44 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyj0Jg+UnuEOYUe73n2jymfckGdmvvnTWbiM8CfWw9I6GnogH7wu7+LvsW4eKX/cGev7Dg4 X-Received: by 2002:a63:2dc1:: with SMTP id t184-v6mr25462601pgt.62.1534345784824; Wed, 15 Aug 2018 08:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534345784; cv=none; d=google.com; s=arc-20160816; b=DorQG4e0D8AvniUvt7PAoANw+aW2XZaP1kCA3cebOZ/0pUmO7j1yu2dEXXEjHZCtUN eHZM9YJvbl//XhnhNo/6uj520uN+39L7Atm6R9R6SkCvqH/G13TtRyp1PLrySy8zBWOp cY33YQiatX2xOg22y5sDcqio1+/RaLntH93VCnh0kDwmnNCRZJjvHzoRwEpINCQb96CU RGjBwOK/zw9sHJPh+wjvSIg5cg+hufYWtkt+/JAmOdxUCSLd5BFQxidyaq/RyR4c/M3k go+0fh6sBZU5uxtMG296EJ6hq66RU7jMPVZmhvhjbHGJYkCQiNv1YKuHN2nC8qd7OIF5 XchQ== 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=QSmKN9hYXPpz6rqLOtNiGTgj5pvm/HSBtkroCw7DwxA=; b=TQGwEeD/8RLeBgfiZdxnNzAkr5mP0jOTz5C79kX+mejygsKUiHHaI8ikoSXbJ/UdZn f9B3rUNE6n4oWkCL4XRHi6quv06h344wu7Jfi/8Fh3/bsYStbv19jQtFB4PErlU6mUsC MHxYaAuoAOY/FsekEJlExBcaj35ddyIOg8yQRNT1iS40/p5XQvA4MYKc0poNGlq51Lli 7CsecETIuDEUsbFm1atwbuJhfMaI7SFFPhWnW4A7xNH7aFOEY0RiH34o51ezQrpkjwO/ R5yZLqOOTweAg3n3gSK6zqjpW4hVHYnpO0QOJR9M7vW7T8xv6DzZj8Cn/xmPXOI5qsNC S2gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n1d4Bc1l; 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 z6-v6si19045390plo.503.2018.08.15.08.09.30; Wed, 15 Aug 2018 08:09:44 -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=n1d4Bc1l; 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 S1730459AbeHOSAl (ORCPT + 99 others); Wed, 15 Aug 2018 14:00:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:50548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729293AbeHOSAk (ORCPT ); Wed, 15 Aug 2018 14:00:40 -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 ADF28214C1; Wed, 15 Aug 2018 15:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1534345687; bh=GU/Yp3PCLm/qZow16Rd8FifJws1/Q5R7S2R9Bsy2KKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n1d4Bc1lmVjuWPhya+g5XJ9hmotvLeWNmp9pdTqK80D2M8r5sRU7dyGpDhCDg/Uzm mexbPS+5+/iN5EBwj22eMi3Qx7eDHrKIBAL0+Rg4YE2+Jaodkpl2caQr4XtsWeGX8A 76NdBZrYzhV24XVm5e+aMNBNNDdM3+Aha0p+waKc= 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 21/35] tools lib traceevent: Rename pevent_find_* APIs Date: Wed, 15 Aug 2018 12:05:57 -0300 Message-Id: <20180815150611.32080-22-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_find_function, pevent_find_function_address, pevent_find_event_by_name, pevent_find_event_by_record 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/20180808180702.966965051@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 | 8 ++++---- tools/lib/traceevent/parse-filter.c | 10 +++++----- tools/lib/traceevent/plugin_function.c | 4 ++-- tools/lib/traceevent/plugin_kmem.c | 4 ++-- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 652b8ef6f4c7..53d866434478 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -503,7 +503,7 @@ find_func(struct tep_handle *pevent, unsigned long long addr) } /** - * pevent_find_function - find a function by a given address + * tep_find_function - find a function by a given address * @pevent: handle for the pevent * @addr: the address to find the function with * @@ -511,7 +511,7 @@ find_func(struct tep_handle *pevent, unsigned long long addr) * address. Note, the address does not have to be exact, it * will select the function that would contain the address. */ -const char *pevent_find_function(struct tep_handle *pevent, unsigned long long addr) +const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr) { struct func_map *map; @@ -523,16 +523,16 @@ const char *pevent_find_function(struct tep_handle *pevent, unsigned long long a } /** - * pevent_find_function_address - find a function address by a given address + * tep_find_function_address - find a function address by a given address * @pevent: handle for the pevent * @addr: the address to find the function with * * Returns the address the function starts at. This can be used in - * conjunction with pevent_find_function to print both the function + * conjunction with tep_find_function to print both the function * name and the function offset. */ unsigned long long -pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr) +tep_find_function_address(struct tep_handle *pevent, unsigned long long addr) { struct func_map *map; @@ -3498,7 +3498,7 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id) } /** - * pevent_find_event_by_name - find an event by given name + * tep_find_event_by_name - find an event by given name * @pevent: a handle to the pevent * @sys: the system name to search for * @name: the name of the event to search for @@ -3507,8 +3507,8 @@ struct event_format *tep_find_event(struct tep_handle *pevent, int id) * @sys. If @sys is NULL the first event with @name is returned. */ struct event_format * -pevent_find_event_by_name(struct tep_handle *pevent, - const char *sys, const char *name) +tep_find_event_by_name(struct tep_handle *pevent, + const char *sys, const char *name) { struct event_format *event; int i; @@ -5433,7 +5433,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock) } /** - * pevent_find_event_by_record - return the event from a given record + * tep_find_event_by_record - return the event from a given record * @pevent: a handle to the pevent * @record: The record to get the event from * @@ -5441,7 +5441,7 @@ static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock) * is found. */ struct event_format * -pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record) +tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record) { int type; @@ -5564,7 +5564,7 @@ void tep_print_event(struct tep_handle *pevent, struct trace_seq *s, { struct event_format *event; - event = pevent_find_event_by_record(pevent, record); + event = tep_find_event_by_record(pevent, record); if (!event) { int i; int type = trace_parse_common_type(pevent, record->data); @@ -6607,7 +6607,7 @@ static struct event_format *pevent_search_event(struct tep_handle *pevent, int i if (sys_name && (strcmp(sys_name, event->system) != 0)) return NULL; } else { - event = pevent_find_event_by_name(pevent, sys_name, event_name); + event = tep_find_event_by_name(pevent, sys_name, event_name); if (!event) return NULL; } diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index 04ffc6e508cf..63ec6d419219 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h @@ -690,9 +690,9 @@ struct format_field *tep_find_common_field(struct event_format *event, const cha struct format_field *tep_find_field(struct event_format *event, const char *name); struct format_field *tep_find_any_field(struct event_format *event, const char *name); -const char *pevent_find_function(struct tep_handle *pevent, unsigned long long addr); +const char *tep_find_function(struct tep_handle *pevent, unsigned long long addr); unsigned long long -pevent_find_function_address(struct tep_handle *pevent, unsigned long long addr); +tep_find_function_address(struct tep_handle *pevent, unsigned long long addr); unsigned long long tep_read_number(struct tep_handle *pevent, const void *ptr, int size); int tep_read_number_field(struct format_field *field, const void *data, unsigned long long *value); @@ -700,10 +700,10 @@ int tep_read_number_field(struct format_field *field, const void *data, struct event_format *tep_find_event(struct tep_handle *pevent, int id); struct event_format * -pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name); +tep_find_event_by_name(struct tep_handle *pevent, const char *sys, const char *name); struct event_format * -pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record); +tep_find_event_by_record(struct tep_handle *pevent, struct tep_record *record); void tep_data_lat_fmt(struct tep_handle *pevent, struct trace_seq *s, struct tep_record *record); diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index 474d820e97e1..3efab9b4298f 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c @@ -1478,7 +1478,7 @@ static int copy_filter_type(struct event_filter *filter, /* Can't assume that the pevent's are the same */ sys = filter_type->event->system; name = filter_type->event->name; - event = pevent_find_event_by_name(filter->pevent, sys, name); + event = tep_find_event_by_name(filter->pevent, sys, name); if (!event) return -1; @@ -1578,9 +1578,9 @@ int tep_update_trivial(struct event_filter *dest, struct event_filter *source, if (src_pevent != dest_pevent) { /* do a look up */ - event = pevent_find_event_by_name(src_pevent, - event->system, - event->name); + event = tep_find_event_by_name(src_pevent, + event->system, + event->name); if (!event) return -1; } @@ -1909,7 +1909,7 @@ static const char *get_field_str(struct filter_arg *arg, struct tep_record *reco if (arg->str.field->flags & (FIELD_IS_POINTER | FIELD_IS_LONG)) /* convert to a kernel symbol */ - val = pevent_find_function(pevent, addr); + val = tep_find_function(pevent, addr); if (val == NULL) { /* just use the hex of the string name */ diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c index 0962120960eb..424747475d37 100644 --- a/tools/lib/traceevent/plugin_function.c +++ b/tools/lib/traceevent/plugin_function.c @@ -135,12 +135,12 @@ static int function_handler(struct trace_seq *s, struct tep_record *record, if (tep_get_field_val(s, event, "ip", record, &function, 1)) return trace_seq_putc(s, '!'); - func = pevent_find_function(pevent, function); + func = tep_find_function(pevent, function); if (tep_get_field_val(s, event, "parent_ip", record, &pfunction, 1)) return trace_seq_putc(s, '!'); - parent = pevent_find_function(pevent, pfunction); + parent = tep_find_function(pevent, pfunction); if (parent && ftrace_indent->set) index = add_and_get_index(parent, func, record->cpu); diff --git a/tools/lib/traceevent/plugin_kmem.c b/tools/lib/traceevent/plugin_kmem.c index 6d5938d82c66..73966b05abce 100644 --- a/tools/lib/traceevent/plugin_kmem.c +++ b/tools/lib/traceevent/plugin_kmem.c @@ -38,11 +38,11 @@ static int call_site_handler(struct trace_seq *s, struct tep_record *record, if (tep_read_number_field(field, data, &val)) return 1; - func = pevent_find_function(event->pevent, val); + func = tep_find_function(event->pevent, val); if (!func) return 1; - addr = pevent_find_function_address(event->pevent, val); + addr = tep_find_function_address(event->pevent, val); trace_seq_printf(s, "(%s+0x%x) ", func, (int)(val - addr)); return 1; -- 2.14.4