From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH] trace-cmd: Fix build with gcc-10
Date: Fri, 17 Apr 2020 21:39:14 +0100 [thread overview]
Message-ID: <20200417203914.26358-1-sudipm.mukherjee@gmail.com> (raw)
The build fails while building with gcc-10 with the error:
multiple definition of `common_type_field'
Rename the field in trace-hist.c and trace-mem.c to satisfy gcc-10.
Bug-Link: https://bugs.debian.org/957879
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
tracecmd/trace-hist.c | 8 ++++----
tracecmd/trace-mem.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index c458c25..c4d8b40 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -27,7 +27,7 @@ static int kernel_stack_type;
static int long_size;
-static struct tep_format_field *common_type_field;
+static struct tep_format_field *common_type_hist;
static struct tep_format_field *common_pid_field;
static struct tep_format_field *sched_wakeup_comm_field;
static struct tep_format_field *sched_wakeup_new_comm_field;
@@ -568,7 +568,7 @@ process_record(struct tep_handle *pevent, struct tep_record *record)
unsigned long long val;
int type;
- tep_read_number_field(common_type_field, record->data, &val);
+ tep_read_number_field(common_type_hist, record->data, &val);
type = val;
if (type == function_type)
@@ -956,8 +956,8 @@ static void do_trace_hist(struct tracecmd_input *handle)
long_size = tracecmd_long_size(handle);
- common_type_field = tep_find_common_field(event, "common_type");
- if (!common_type_field)
+ common_type_hist = tep_find_common_field(event, "common_type");
+ if (!common_type_hist)
die("Can't find a 'type' field?");
common_pid_field = tep_find_common_field(event, "common_pid");
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index 465b182..76f38fa 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -30,7 +30,7 @@ static int kmem_cache_alloc_type;
static int kmem_cache_alloc_node_type;
static int kmem_cache_free_type;
-static struct tep_format_field *common_type_field;
+static struct tep_format_field *common_type_mem;
static struct tep_format_field *kmalloc_callsite_field;
static struct tep_format_field *kmalloc_bytes_req_field;
@@ -369,7 +369,7 @@ process_record(struct tep_handle *pevent, struct tep_record *record)
unsigned long long val;
int type;
- tep_read_number_field(common_type_field, record->data, &val);
+ tep_read_number_field(common_type_mem, record->data, &val);
type = val;
if (type == kmalloc_type)
@@ -490,8 +490,8 @@ static void do_trace_mem(struct tracecmd_input *handle)
ret = tep_data_type(pevent, record);
event = tep_find_event(pevent, ret);
- common_type_field = tep_find_common_field(event, "common_type");
- if (!common_type_field)
+ common_type_mem = tep_find_common_field(event, "common_type");
+ if (!common_type_mem)
die("Can't find a 'type' field?");
update_kmalloc(pevent);
--
2.11.0
next reply other threads:[~2020-04-17 20:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-17 20:39 Sudip Mukherjee [this message]
2020-04-20 19:43 ` [PATCH] trace-cmd: Fix build with gcc-10 Steven Rostedt
2020-04-20 19:53 ` Steven Rostedt
2020-04-20 22:37 ` Sudip Mukherjee
2020-05-08 12:46 ` Sudip Mukherjee
2020-05-08 14:11 ` Steven Rostedt
2020-05-09 18:30 ` Sudip Mukherjee
2020-05-09 18:48 ` Steven Rostedt
2020-05-09 19:11 ` Sudip Mukherjee
2020-05-09 21:12 ` Steven Rostedt
2020-05-09 23:27 ` Sudip Mukherjee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200417203914.26358-1-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).