Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp907781imm; Wed, 15 Aug 2018 08:08:58 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyDGqTSHEJMf8/V9SiH6MWsYzNr4C5nrDaG0+8KMClhGtjFTnc4YuQ4rZuggL9qBvX2sV/0 X-Received: by 2002:a17:902:7883:: with SMTP id q3-v6mr24293197pll.264.1534345738543; Wed, 15 Aug 2018 08:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534345738; cv=none; d=google.com; s=arc-20160816; b=Avw8foR25r0aG8fcX3wZbmAnDa9lF6Rd8Vwwezr5wzQI6kAlwzmjBim4jgnFZmvw92 0oZ1Sog1IIdbwwalVxLTAB5CFW3zbiqHSpnY9H0HgYWgJ7m36JJIzm7LmTcM/J28NJ85 stJVjEGtcwrOCZTIzeFkmHh9o/z31/BwTbpT1QSTwBxyUWDwbaVyXTi2eu9RGoSwNgoB K10IfbWYy/FcpjxGeqJIs21D7vs9DRMely1kQ/ZPiDwthhHZXxBuSB8qln10FjsUtZLu yFoO4X+jKHB1l/TKJrc8upJqHVFWr8F6hkWskdU/n6ydSd/AQztIyW939LIHwFC8TSYt 40uw== 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=ArsyEdjglehzRh9CuV3jjPb+U5eZjjHLYbl398Lh5I8=; b=O/BmhRkRwUVeeArdRwJIQWuGsTEhlViRJ6rCT7+ui3XUPw7BcSkudmOV64/3y4naI2 +hxIU9UPzI1GB0Y21itZdJaVJsPhjODY5iQXpnr8MohUyKEK9qoo/YLCzDPaLmrdjc4Q xSZhouvaz43Fel54ls5DMCBQ5RZYkQAfF8Vu0CJDktro8g9NWT3XlBgu4qkx6J72T00C cIwuZIRKKsT2BuqnjdMAI0as35c4AbUjPtldEeTAL6RubZWFq2L/2bnCeN3z1FvvfdQ9 o69bFolxdz8XtpL9k228NkRU7b262Yko1tq6FwR7A3ohcbryBaDl2BCWsMI9DOOaNNH8 owTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fsz8jhQD; 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 v71-v6si27052431pfj.354.2018.08.15.08.08.43; Wed, 15 Aug 2018 08:08:58 -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=fsz8jhQD; 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 S1730100AbeHOSAF (ORCPT + 99 others); Wed, 15 Aug 2018 14:00:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:50010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729386AbeHOSAE (ORCPT ); Wed, 15 Aug 2018 14:00:04 -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 61FDF20C09; Wed, 15 Aug 2018 15:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1534345652; bh=ceHnJaK+yEMdFZUoOL+bMBlJoZO6o9xo/0D3I6LuezM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fsz8jhQD0+GSqKpsTSizxsEEdZxkZyBGkD8PPLlQv9vkk+9JZcj1OlREY1pjYWmpM wu21EZqHt8vCkNcoi2Rqx7Mpx7R/a+qbVBr+dvPnflVGo8tIupm5Vh+Sgd5oeSiPvj mGdD3NbEAHDAmuJtg6S/9YvyOA+SW00C1aF942Yg= 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 10/35] tools lib traceevent, perf tools: Rename pevent_register_* APIs Date: Wed, 15 Aug 2018 12:05:46 -0300 Message-Id: <20180815150611.32080-11-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_register_comm, pevent_register_print_string 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/20180808180700.948980691@goodmis.org Signed-off-by: Steven Rostedt Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/event-parse.c | 10 +++++----- tools/lib/traceevent/event-parse.h | 6 +++--- tools/lib/traceevent/plugin_sched_switch.c | 2 +- tools/perf/util/trace-event-parse.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 4220b15781c8..cab411b99087 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -288,7 +288,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid) } /** - * pevent_register_comm - register a pid / comm mapping + * tep_register_comm - register a pid / comm mapping * @pevent: handle for the pevent * @comm: the command line to register * @pid: the pid to map the command line to @@ -296,7 +296,7 @@ static int add_new_comm(struct tep_handle *pevent, const char *comm, int pid) * This adds a mapping to search for command line names with * a given pid. The comm is duplicated. */ -int pevent_register_comm(struct tep_handle *pevent, const char *comm, int pid) +int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid) { struct cmdline_list *item; @@ -685,7 +685,7 @@ find_printk(struct tep_handle *pevent, unsigned long long addr) } /** - * pevent_register_print_string - register a string by its address + * tep_register_print_string - register a string by its address * @pevent: handle for the pevent * @fmt: the string format to register * @addr: the address the string was located at @@ -693,8 +693,8 @@ find_printk(struct tep_handle *pevent, unsigned long long addr) * This registers a string by the address it was stored in the kernel. * The @fmt passed in is duplicated. */ -int pevent_register_print_string(struct tep_handle *pevent, const char *fmt, - unsigned long long addr) +int tep_register_print_string(struct tep_handle *pevent, const char *fmt, + unsigned long long addr) { struct printk_list *item = malloc(sizeof(*item)); char *p; diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index 58d9f0dedf05..399dea66b80e 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h @@ -618,12 +618,12 @@ enum trace_flag_type { int pevent_set_function_resolver(struct tep_handle *pevent, tep_func_resolver_t *func, void *priv); void pevent_reset_function_resolver(struct tep_handle *pevent); -int pevent_register_comm(struct tep_handle *pevent, const char *comm, int pid); +int tep_register_comm(struct tep_handle *pevent, const char *comm, int pid); int pevent_register_trace_clock(struct tep_handle *pevent, const char *trace_clock); int pevent_register_function(struct tep_handle *pevent, char *name, unsigned long long addr, char *mod); -int pevent_register_print_string(struct tep_handle *pevent, const char *fmt, - unsigned long long addr); +int tep_register_print_string(struct tep_handle *pevent, const char *fmt, + unsigned long long addr); int pevent_pid_is_registered(struct tep_handle *pevent, int pid); void tep_print_event_task(struct tep_handle *pevent, struct trace_seq *s, diff --git a/tools/lib/traceevent/plugin_sched_switch.c b/tools/lib/traceevent/plugin_sched_switch.c index 90d2ef293cf9..4d8eaab6ac15 100644 --- a/tools/lib/traceevent/plugin_sched_switch.c +++ b/tools/lib/traceevent/plugin_sched_switch.c @@ -61,7 +61,7 @@ static void write_and_save_comm(struct format_field *field, comm = &s->buffer[len]; /* Help out the comm to ids. This will handle dups */ - pevent_register_comm(field->event->pevent, comm, pid); + tep_register_comm(field->event->pevent, comm, pid); } static int sched_wakeup_handler(struct trace_seq *s, diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index a0e2b2c54567..920b1d58a068 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c @@ -157,7 +157,7 @@ void parse_ftrace_printk(struct tep_handle *pevent, /* fmt still has a space, skip it */ printk = strdup(fmt+1); line = strtok_r(NULL, "\n", &next); - pevent_register_print_string(pevent, printk, addr); + tep_register_print_string(pevent, printk, addr); } } @@ -172,7 +172,7 @@ void parse_saved_cmdline(struct tep_handle *pevent, line = strtok_r(file, "\n", &next); while (line) { sscanf(line, "%d %ms", &pid, &comm); - pevent_register_comm(pevent, comm, pid); + tep_register_comm(pevent, comm, pid); free(comm); line = strtok_r(NULL, "\n", &next); } -- 2.14.4