Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp908605imm; Wed, 15 Aug 2018 08:09:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxqNdtH14QGIoAooBwvKEmTo1pwkexjq09mvMzxJSPSmnStsJojtLWqe7zZq77GFVMzsiJ/ X-Received: by 2002:a62:c505:: with SMTP id j5-v6mr27597807pfg.153.1534345775385; Wed, 15 Aug 2018 08:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534345775; cv=none; d=google.com; s=arc-20160816; b=B3yPNR9aerJVk4uaNN4wE1FWUb3VTSMt+Q3ef4h/2AHqyAj96vkhqJgSRDvtjuPwFQ IXOHVePw8LTq4V64fvTuNVRXVCxIirDKctJ0YSwoUH722/XXgi/q7F1jDOiB6xOhC2ga Pbm+PcimWZRyCi4L1SbPEDen+69q6Pog1LZr+MIC3bGpAMDEf9QPYLid54u+x992ATOJ p/Bw6R+JSwUGlC1Zh7/zEL5PhOrbpKhifo8N+B3bx7qRw7Iz5zRKdhQ4qSAvQXRljNNA AttTYsNeVSK3jZTwuc1FJ51hAsYXmLLmLT85gDgCuUUorzYMfZLaBDh3CV4cUXl6Nqly yfXA== 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=UHfc+FM1BMEvxAL0+lVPuFmU0kHM/XN+XkUPtuPE0VU=; b=uInbYMdR/bZ5OcvaFAZJq/9/yUWb/XXyiJv092I/Rm08RwcwMR/zWusK4Qb7m4MlxC nkQ7Y67c4/FP4ts6opeL9Mye1Odh72qIDKQhzaFuWDq2t3CjaAe4XDCh2c3ZNYfSdVAa /P0jyvq7cIGS+uVrMqaCQnS9aGbgncsX90nQkol6E+mQW6SEpIcVkR2k5OscAVhcaOIT 7Mu0wxo/MC5GRM0BQdQfG7BqNxXfRl1AzvClXgktUV+uhaJXrGf1gRZuu+RjDcrDP8jb 5aLwXpgQjkSHEhbO8RZWgHBDyBPAp3k2+54dr0cXOf1nMQPOo9vaXg/FbjhrgzgKzOOZ xZ4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cWDShjxa; 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 b4-v6si5700352plb.215.2018.08.15.08.09.20; Wed, 15 Aug 2018 08:09:35 -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=cWDShjxa; 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 S1730393AbeHOSAe (ORCPT + 99 others); Wed, 15 Aug 2018 14:00:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:50464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729293AbeHOSAe (ORCPT ); Wed, 15 Aug 2018 14:00:34 -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 6FE0920C09; Wed, 15 Aug 2018 15:07:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1534345681; bh=j9+7e0xt4JJcW5eoM3djUee5LEpLcnGpWz+m+NnZ8lU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cWDShjxaUs5uf+HwT3dsKs487LjDeYTKn+yUmNB05uHbvjIZZzHIUFXW+DcWm1yLQ SE60ZfYhy7D4DQ7p/8gJRtq0RbictAuP7pP2+kHBo1dRTgNC1B9n1m3UYyc7hv3bhy qkViSiXHOaK3N2CAiqdpaIL2SlGrPIexzlAgrw6o= 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 19/35] tools lib traceevent: Rename pevent_data_ APIs Date: Wed, 15 Aug 2018 12:05:55 -0300 Message-Id: <20180815150611.32080-20-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_data_lat_fmt, pevent_data_type, pevent_data_event_from_type, pevent_data_pid, pevent_data_preempt_count, pevent_data_flags, pevent_data_comm_from_pid, pevent_data_pid_from_comm, pevent_cmdline_pid 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.678020020@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/event-parse.c | 44 ++++++++++++++++++------------------- tools/lib/traceevent/event-parse.h | 22 +++++++++---------- tools/lib/traceevent/parse-filter.c | 6 ++--- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 0de470c07be9..4f924bf42b92 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -5140,7 +5140,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event } /** - * pevent_data_lat_fmt - parse the data for the latency format + * tep_data_lat_fmt - parse the data for the latency format * @pevent: a handle to the pevent * @s: the trace_seq to write to * @record: the record to read from @@ -5149,8 +5149,8 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event * need rescheduling, in hard/soft interrupt, preempt count * and lock depth) and places it into the trace_seq. */ -void pevent_data_lat_fmt(struct tep_handle *pevent, - struct trace_seq *s, struct tep_record *record) +void tep_data_lat_fmt(struct tep_handle *pevent, + struct trace_seq *s, struct tep_record *record) { static int check_lock_depth = 1; static int check_migrate_disable = 1; @@ -5223,55 +5223,55 @@ void pevent_data_lat_fmt(struct tep_handle *pevent, } /** - * pevent_data_type - parse out the given event type + * tep_data_type - parse out the given event type * @pevent: a handle to the pevent * @rec: the record to read from * * This returns the event id from the @rec. */ -int pevent_data_type(struct tep_handle *pevent, struct tep_record *rec) +int tep_data_type(struct tep_handle *pevent, struct tep_record *rec) { return trace_parse_common_type(pevent, rec->data); } /** - * pevent_data_event_from_type - find the event by a given type + * tep_data_event_from_type - find the event by a given type * @pevent: a handle to the pevent * @type: the type of the event. * * This returns the event form a given @type; */ -struct event_format *pevent_data_event_from_type(struct tep_handle *pevent, int type) +struct event_format *tep_data_event_from_type(struct tep_handle *pevent, int type) { return tep_find_event(pevent, type); } /** - * pevent_data_pid - parse the PID from record + * tep_data_pid - parse the PID from record * @pevent: a handle to the pevent * @rec: the record to parse * * This returns the PID from a record. */ -int pevent_data_pid(struct tep_handle *pevent, struct tep_record *rec) +int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec) { return parse_common_pid(pevent, rec->data); } /** - * pevent_data_preempt_count - parse the preempt count from the record + * tep_data_preempt_count - parse the preempt count from the record * @pevent: a handle to the pevent * @rec: the record to parse * * This returns the preempt count from a record. */ -int pevent_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec) +int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec) { return parse_common_pc(pevent, rec->data); } /** - * pevent_data_flags - parse the latency flags from the record + * tep_data_flags - parse the latency flags from the record * @pevent: a handle to the pevent * @rec: the record to parse * @@ -5279,20 +5279,20 @@ int pevent_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec) * * Use trace_flag_type enum for the flags (see event-parse.h). */ -int pevent_data_flags(struct tep_handle *pevent, struct tep_record *rec) +int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec) { return parse_common_flags(pevent, rec->data); } /** - * pevent_data_comm_from_pid - return the command line from PID + * tep_data_comm_from_pid - return the command line from PID * @pevent: a handle to the pevent * @pid: the PID of the task to search for * * This returns a pointer to the command line that has the given * @pid. */ -const char *pevent_data_comm_from_pid(struct tep_handle *pevent, int pid) +const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid) { const char *comm; @@ -5317,7 +5317,7 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne } /** - * pevent_data_pid_from_comm - return the pid from a given comm + * tep_data_pid_from_comm - return the pid from a given comm * @pevent: a handle to the pevent * @comm: the cmdline to find the pid from * @next: the cmdline structure to find the next comm @@ -5329,8 +5329,8 @@ pid_from_cmdlist(struct tep_handle *pevent, const char *comm, struct cmdline *ne * next pid. * Also, it does a linear seach, so it may be slow. */ -struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char *comm, - struct cmdline *next) +struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm, + struct cmdline *next) { struct cmdline *cmdline; @@ -5365,13 +5365,13 @@ struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char } /** - * pevent_cmdline_pid - return the pid associated to a given cmdline + * tep_cmdline_pid - return the pid associated to a given cmdline * @cmdline: The cmdline structure to get the pid from * * Returns the pid for a give cmdline. If @cmdline is NULL, then * -1 is returned. */ -int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) +int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) { struct cmdline_list *cmdlist = (struct cmdline_list *)cmdline; @@ -5391,7 +5391,7 @@ int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline) } /** - * pevent_data_comm_from_pid - parse the data into the print format + * tep_event_info - parse the data into the print format * @s: the trace_seq to write to * @event: the handle to the event * @record: the record to read from @@ -5511,7 +5511,7 @@ void tep_print_event_time(struct tep_handle *pevent, struct trace_seq *s, } if (pevent->latency_format) { - pevent_data_lat_fmt(pevent, s, record); + tep_data_lat_fmt(pevent, s, record); } if (use_usec_format) { diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index dc0d2d3b7c33..2c4da2f1d4ed 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h @@ -705,18 +705,18 @@ pevent_find_event_by_name(struct tep_handle *pevent, const char *sys, const char struct event_format * pevent_find_event_by_record(struct tep_handle *pevent, struct tep_record *record); -void pevent_data_lat_fmt(struct tep_handle *pevent, - struct trace_seq *s, struct tep_record *record); -int pevent_data_type(struct tep_handle *pevent, struct tep_record *rec); -struct event_format *pevent_data_event_from_type(struct tep_handle *pevent, int type); -int pevent_data_pid(struct tep_handle *pevent, struct tep_record *rec); -int pevent_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec); -int pevent_data_flags(struct tep_handle *pevent, struct tep_record *rec); -const char *pevent_data_comm_from_pid(struct tep_handle *pevent, int pid); +void tep_data_lat_fmt(struct tep_handle *pevent, + struct trace_seq *s, struct tep_record *record); +int tep_data_type(struct tep_handle *pevent, struct tep_record *rec); +struct event_format *tep_data_event_from_type(struct tep_handle *pevent, int type); +int tep_data_pid(struct tep_handle *pevent, struct tep_record *rec); +int tep_data_preempt_count(struct tep_handle *pevent, struct tep_record *rec); +int tep_data_flags(struct tep_handle *pevent, struct tep_record *rec); +const char *tep_data_comm_from_pid(struct tep_handle *pevent, int pid); struct cmdline; -struct cmdline *pevent_data_pid_from_comm(struct tep_handle *pevent, const char *comm, - struct cmdline *next); -int pevent_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline); +struct cmdline *tep_data_pid_from_comm(struct tep_handle *pevent, const char *comm, + struct cmdline *next); +int tep_cmdline_pid(struct tep_handle *pevent, struct cmdline *cmdline); void tep_print_field(struct trace_seq *s, void *data, struct format_field *field); diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index f3d812676169..474d820e97e1 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c @@ -1705,8 +1705,8 @@ get_comm(struct event_format *event, struct tep_record *record) const char *comm; int pid; - pid = pevent_data_pid(event->pevent, record); - comm = pevent_data_comm_from_pid(event->pevent, pid); + pid = tep_data_pid(event->pevent, record); + comm = tep_data_comm_from_pid(event->pevent, pid); return comm; } @@ -2060,7 +2060,7 @@ enum tep_errno tep_filter_match(struct event_filter *filter, if (!filter->filters) return TEP_ERRNO__NO_FILTER; - event_id = pevent_data_type(pevent, record); + event_id = tep_data_type(pevent, record); filter_type = find_filter_type(filter, event_id); if (!filter_type) -- 2.14.4