* [PATCH] tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c
@ 2018-11-22 11:29 Adrian Hunter
2018-11-26 20:04 ` Arnaldo Carvalho de Melo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Adrian Hunter @ 2018-11-22 11:29 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Jiri Olsa, Steven Rostedt, Tzvetomir Stoyanov, linux-kernel
Fix following warnings:
event-parse.c: In function ‘tep_find_event_by_name’:
event-parse.c:3521:21: warning: ‘event’ may be used uninitialized in this function [-Wmaybe-uninitialized]
pevent->last_event = event;
~~~~~~~~~~~~~~~~~~~^~~~~~~
CC ui/gtk/hists.o
LINK plugin_mac80211.so
CC nlattr.o
event-parse.c: In function ‘tep_data_lat_fmt’:
event-parse.c:5200:4: warning: ‘migrate_disable’ may be used uninitialized in this function [-Wmaybe-uninitialized]
trace_seq_printf(s, "%d", migrate_disable);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
event-parse.c:5207:4: warning: ‘lock_depth’ may be used uninitialized in this function [-Wmaybe-uninitialized]
trace_seq_printf(s, "%d", lock_depth);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LINK plugin_sched_switch.so
LINK plugin_function.so
LINK plugin_xen.so
event-parse.c: In function ‘tep_event_info’:
event-parse.c:5047:7: warning: ‘len_arg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
trace_seq_printf(s, format, len_arg, (char)val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
event-parse.c:4884:6: note: ‘len_arg’ was declared here
int len_arg;
^~~~~~~
event-parse.c:4338:11: warning: ‘vsize’ may be used uninitialized in this function [-Wmaybe-uninitialized]
val = tep_read_number(pevent, bptr, vsize);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
event-parse.c:4224:6: note: ‘vsize’ was declared here
int vsize;
^~~~~
$ gcc --version
gcc (Clear Linux OS for Intel Architecture) 8.2.1 20180502
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/lib/traceevent/event-parse.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 3692f29fee46..fbd6d6813fab 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -3498,7 +3498,7 @@ struct tep_event_format *
tep_find_event_by_name(struct tep_handle *pevent,
const char *sys, const char *name)
{
- struct tep_event_format *event;
+ struct tep_event_format *event = NULL;
int i;
if (pevent->last_event &&
@@ -4221,7 +4221,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
unsigned long long ip, val;
char *ptr;
void *bptr;
- int vsize;
+ int vsize = 0;
field = pevent->bprint_buf_field;
ip_field = pevent->bprint_ip_field;
@@ -4881,7 +4881,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
char format[32];
int show_func;
int len_as_arg;
- int len_arg;
+ int len_arg = 0;
int len;
int ls;
@@ -5146,8 +5146,8 @@ void tep_data_lat_fmt(struct tep_handle *pevent,
static int migrate_disable_exists;
unsigned int lat_flags;
unsigned int pc;
- int lock_depth;
- int migrate_disable;
+ int lock_depth = 0;
+ int migrate_disable = 0;
int hardirq;
int softirq;
void *data = record->data;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c
2018-11-22 11:29 [PATCH] tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c Adrian Hunter
@ 2018-11-26 20:04 ` Arnaldo Carvalho de Melo
2018-12-14 20:24 ` [tip:perf/core] " tip-bot for Adrian Hunter
2018-12-18 13:51 ` tip-bot for Adrian Hunter
2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-11-26 20:04 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Adrian Hunter, Jiri Olsa, Tzvetomir Stoyanov, linux-kernel
Em Thu, Nov 22, 2018 at 01:29:37PM +0200, Adrian Hunter escreveu:
> Fix following warnings:
Steven, any problem if I apply these? I think I've hit these warnings on
Clear Linux too.
- Arnaldo
> event-parse.c: In function ‘tep_find_event_by_name’:
> event-parse.c:3521:21: warning: ‘event’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> pevent->last_event = event;
> ~~~~~~~~~~~~~~~~~~~^~~~~~~
> CC ui/gtk/hists.o
> LINK plugin_mac80211.so
> CC nlattr.o
> event-parse.c: In function ‘tep_data_lat_fmt’:
> event-parse.c:5200:4: warning: ‘migrate_disable’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> trace_seq_printf(s, "%d", migrate_disable);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> event-parse.c:5207:4: warning: ‘lock_depth’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> trace_seq_printf(s, "%d", lock_depth);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> LINK plugin_sched_switch.so
> LINK plugin_function.so
> LINK plugin_xen.so
> event-parse.c: In function ‘tep_event_info’:
> event-parse.c:5047:7: warning: ‘len_arg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> trace_seq_printf(s, format, len_arg, (char)val);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> event-parse.c:4884:6: note: ‘len_arg’ was declared here
> int len_arg;
> ^~~~~~~
> event-parse.c:4338:11: warning: ‘vsize’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> val = tep_read_number(pevent, bptr, vsize);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> event-parse.c:4224:6: note: ‘vsize’ was declared here
> int vsize;
> ^~~~~
>
> $ gcc --version
> gcc (Clear Linux OS for Intel Architecture) 8.2.1 20180502
>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> tools/lib/traceevent/event-parse.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index 3692f29fee46..fbd6d6813fab 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -3498,7 +3498,7 @@ struct tep_event_format *
> tep_find_event_by_name(struct tep_handle *pevent,
> const char *sys, const char *name)
> {
> - struct tep_event_format *event;
> + struct tep_event_format *event = NULL;
> int i;
>
> if (pevent->last_event &&
> @@ -4221,7 +4221,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
> unsigned long long ip, val;
> char *ptr;
> void *bptr;
> - int vsize;
> + int vsize = 0;
>
> field = pevent->bprint_buf_field;
> ip_field = pevent->bprint_ip_field;
> @@ -4881,7 +4881,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
> char format[32];
> int show_func;
> int len_as_arg;
> - int len_arg;
> + int len_arg = 0;
> int len;
> int ls;
>
> @@ -5146,8 +5146,8 @@ void tep_data_lat_fmt(struct tep_handle *pevent,
> static int migrate_disable_exists;
> unsigned int lat_flags;
> unsigned int pc;
> - int lock_depth;
> - int migrate_disable;
> + int lock_depth = 0;
> + int migrate_disable = 0;
> int hardirq;
> int softirq;
> void *data = record->data;
> --
> 2.17.1
--
- Arnaldo
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:perf/core] tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c
2018-11-22 11:29 [PATCH] tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c Adrian Hunter
2018-11-26 20:04 ` Arnaldo Carvalho de Melo
@ 2018-12-14 20:24 ` tip-bot for Adrian Hunter
2018-12-18 13:51 ` tip-bot for Adrian Hunter
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Adrian Hunter @ 2018-12-14 20:24 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, adrian.hunter, rostedt, hpa, tglx, linux-kernel,
tz.stoyanov, mingo, jolsa
Commit-ID: 6e33c250a88f8dfc9858819dc6d02a788da9af74
Gitweb: https://git.kernel.org/tip/6e33c250a88f8dfc9858819dc6d02a788da9af74
Author: Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Thu, 22 Nov 2018 13:29:37 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 29 Nov 2018 20:42:48 -0300
tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c
Fix following warnings:
event-parse.c: In function ‘tep_find_event_by_name’:
event-parse.c:3521:21: warning: ‘event’ may be used uninitialized in this function [-Wmaybe-uninitialized]
pevent->last_event = event;
~~~~~~~~~~~~~~~~~~~^~~~~~~
CC ui/gtk/hists.o
LINK plugin_mac80211.so
CC nlattr.o
event-parse.c: In function ‘tep_data_lat_fmt’:
event-parse.c:5200:4: warning: ‘migrate_disable’ may be used uninitialized in this function [-Wmaybe-uninitialized]
trace_seq_printf(s, "%d", migrate_disable);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
event-parse.c:5207:4: warning: ‘lock_depth’ may be used uninitialized in this function [-Wmaybe-uninitialized]
trace_seq_printf(s, "%d", lock_depth);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LINK plugin_sched_switch.so
LINK plugin_function.so
LINK plugin_xen.so
event-parse.c: In function ‘tep_event_info’:
event-parse.c:5047:7: warning: ‘len_arg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
trace_seq_printf(s, format, len_arg, (char)val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
event-parse.c:4884:6: note: ‘len_arg’ was declared here
int len_arg;
^~~~~~~
event-parse.c:4338:11: warning: ‘vsize’ may be used uninitialized in this function [-Wmaybe-uninitialized]
val = tep_read_number(pevent, bptr, vsize);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
event-parse.c:4224:6: note: ‘vsize’ was declared here
int vsize;
^~~~~
$ gcc --version
gcc (Clear Linux OS for Intel Architecture) 8.2.1 20180502
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Link: http://lkml.kernel.org/r/20181122112937.10582-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/event-parse.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 3692f29fee46..fbd6d6813fab 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -3498,7 +3498,7 @@ struct tep_event_format *
tep_find_event_by_name(struct tep_handle *pevent,
const char *sys, const char *name)
{
- struct tep_event_format *event;
+ struct tep_event_format *event = NULL;
int i;
if (pevent->last_event &&
@@ -4221,7 +4221,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
unsigned long long ip, val;
char *ptr;
void *bptr;
- int vsize;
+ int vsize = 0;
field = pevent->bprint_buf_field;
ip_field = pevent->bprint_ip_field;
@@ -4881,7 +4881,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
char format[32];
int show_func;
int len_as_arg;
- int len_arg;
+ int len_arg = 0;
int len;
int ls;
@@ -5146,8 +5146,8 @@ void tep_data_lat_fmt(struct tep_handle *pevent,
static int migrate_disable_exists;
unsigned int lat_flags;
unsigned int pc;
- int lock_depth;
- int migrate_disable;
+ int lock_depth = 0;
+ int migrate_disable = 0;
int hardirq;
int softirq;
void *data = record->data;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [tip:perf/core] tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c
2018-11-22 11:29 [PATCH] tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c Adrian Hunter
2018-11-26 20:04 ` Arnaldo Carvalho de Melo
2018-12-14 20:24 ` [tip:perf/core] " tip-bot for Adrian Hunter
@ 2018-12-18 13:51 ` tip-bot for Adrian Hunter
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Adrian Hunter @ 2018-12-18 13:51 UTC (permalink / raw)
To: linux-tip-commits
Cc: rostedt, acme, hpa, tglx, tz.stoyanov, adrian.hunter,
linux-kernel, mingo, jolsa
Commit-ID: 0631ca3a6e6edd23a2ca7cab707d1abf291a097d
Gitweb: https://git.kernel.org/tip/0631ca3a6e6edd23a2ca7cab707d1abf291a097d
Author: Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Thu, 22 Nov 2018 13:29:37 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 17 Dec 2018 14:54:21 -0300
tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c
Fix following warnings:
event-parse.c: In function ‘tep_find_event_by_name’:
event-parse.c:3521:21: warning: ‘event’ may be used uninitialized in this function [-Wmaybe-uninitialized]
pevent->last_event = event;
~~~~~~~~~~~~~~~~~~~^~~~~~~
CC ui/gtk/hists.o
LINK plugin_mac80211.so
CC nlattr.o
event-parse.c: In function ‘tep_data_lat_fmt’:
event-parse.c:5200:4: warning: ‘migrate_disable’ may be used uninitialized in this function [-Wmaybe-uninitialized]
trace_seq_printf(s, "%d", migrate_disable);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
event-parse.c:5207:4: warning: ‘lock_depth’ may be used uninitialized in this function [-Wmaybe-uninitialized]
trace_seq_printf(s, "%d", lock_depth);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LINK plugin_sched_switch.so
LINK plugin_function.so
LINK plugin_xen.so
event-parse.c: In function ‘tep_event_info’:
event-parse.c:5047:7: warning: ‘len_arg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
trace_seq_printf(s, format, len_arg, (char)val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
event-parse.c:4884:6: note: ‘len_arg’ was declared here
int len_arg;
^~~~~~~
event-parse.c:4338:11: warning: ‘vsize’ may be used uninitialized in this function [-Wmaybe-uninitialized]
val = tep_read_number(pevent, bptr, vsize);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
event-parse.c:4224:6: note: ‘vsize’ was declared here
int vsize;
^~~~~
$ gcc --version
gcc (Clear Linux OS for Intel Architecture) 8.2.1 20180502
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Link: http://lkml.kernel.org/r/20181122112937.10582-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/event-parse.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 3692f29fee46..fbd6d6813fab 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -3498,7 +3498,7 @@ struct tep_event_format *
tep_find_event_by_name(struct tep_handle *pevent,
const char *sys, const char *name)
{
- struct tep_event_format *event;
+ struct tep_event_format *event = NULL;
int i;
if (pevent->last_event &&
@@ -4221,7 +4221,7 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
unsigned long long ip, val;
char *ptr;
void *bptr;
- int vsize;
+ int vsize = 0;
field = pevent->bprint_buf_field;
ip_field = pevent->bprint_ip_field;
@@ -4881,7 +4881,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
char format[32];
int show_func;
int len_as_arg;
- int len_arg;
+ int len_arg = 0;
int len;
int ls;
@@ -5146,8 +5146,8 @@ void tep_data_lat_fmt(struct tep_handle *pevent,
static int migrate_disable_exists;
unsigned int lat_flags;
unsigned int pc;
- int lock_depth;
- int migrate_disable;
+ int lock_depth = 0;
+ int migrate_disable = 0;
int hardirq;
int softirq;
void *data = record->data;
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-18 13:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-22 11:29 [PATCH] tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c Adrian Hunter
2018-11-26 20:04 ` Arnaldo Carvalho de Melo
2018-12-14 20:24 ` [tip:perf/core] " tip-bot for Adrian Hunter
2018-12-18 13:51 ` tip-bot for Adrian Hunter
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).