Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1234769
| From | Jiri Olsa <jolsa@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [tip:perf/core] tools: Add err.h with ERR_PTR PTR_ERR interface |
| Date | 2015-09-29 09:30 +0200 |
| Message-ID | <qdXwl-878-1@gated-at.bofh.it> (permalink) |
| References | <q6082-ic-17@gated-at.bofh.it> <q9fke-63y-27@gated-at.bofh.it> <qbj0m-4WL-5@gated-at.bofh.it> <qdWJY-6XG-15@gated-at.bofh.it> <qdXmG-7W4-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Sep 29, 2015 at 09:14:10AM +0200, Jiri Olsa wrote:
SNIP
> > > $ gcc --version
> > > gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
> > > Copyright (C) 2010 Free Software Foundation, Inc.
> > > This is free software; see the source for copying conditions. There is NO
> > > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> > >
> > > Cheers,
> > > Vinson
> >
> > Hi.
> >
> > This build error still occurs with next-20150929.
>
> attached patch should fix it
>
> FYI there's another instance of this bug in parse-events.c in
> Arnaldo's perf/core due to recent fixes, I'll send out fix shortly
and here it is..
He Kuang,
this might collide with your recent fixes..
jirka
---
The error variable breaks build on CentOS 6.7, due to
collision with global error symbol:
CC util/parse-events.o
cc1: warnings being treated as errors
util/parse-events.c:419: error: declaration of ‘error’ shadows a global
declaration
util/util.h:135: error: shadowed declaration is here
util/parse-events.c: In function ‘add_tracepoint_multi_event’:
...
Using different argument names instead to fix it.
Reported-by: Vinson Lee <vlee@twopensource.com>
Link: http://lkml.kernel.org/n/tip-ujp5f63wvy70jlzeh3rt5f98@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/util/parse-events.c | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 61c2bc2..626bf85 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -387,7 +387,7 @@ int parse_events_add_cache(struct list_head *list, int *idx,
return add_event(list, idx, &attr, name, NULL);
}
-static void tracepoint_error(struct parse_events_error *error, int err,
+static void tracepoint_error(struct parse_events_error *e, int err,
char *sys, char *name)
{
char help[BUFSIZ];
@@ -400,29 +400,29 @@ static void tracepoint_error(struct parse_events_error *error, int err,
switch (err) {
case EACCES:
- error->str = strdup("can't access trace events");
+ e->str = strdup("can't access trace events");
break;
case ENOENT:
- error->str = strdup("unknown tracepoint");
+ e->str = strdup("unknown tracepoint");
break;
default:
- error->str = strdup("failed to add tracepoint");
+ e->str = strdup("failed to add tracepoint");
break;
}
tracing_path__strerror_open_tp(err, help, sizeof(help), sys, name);
- error->help = strdup(help);
+ e->help = strdup(help);
}
static int add_tracepoint(struct list_head *list, int *idx,
char *sys_name, char *evt_name,
- struct parse_events_error *error __maybe_unused)
+ struct parse_events_error *err __maybe_unused)
{
struct perf_evsel *evsel;
evsel = perf_evsel__newtp_idx(sys_name, evt_name, (*idx)++);
if (IS_ERR(evsel)) {
- tracepoint_error(error, PTR_ERR(evsel), sys_name, evt_name);
+ tracepoint_error(err, PTR_ERR(evsel), sys_name, evt_name);
return PTR_ERR(evsel);
}
@@ -432,7 +432,7 @@ static int add_tracepoint(struct list_head *list, int *idx,
static int add_tracepoint_multi_event(struct list_head *list, int *idx,
char *sys_name, char *evt_name,
- struct parse_events_error *error)
+ struct parse_events_error *err)
{
char evt_path[MAXPATHLEN];
struct dirent *evt_ent;
@@ -442,7 +442,7 @@ static int add_tracepoint_multi_event(struct list_head *list, int *idx,
snprintf(evt_path, MAXPATHLEN, "%s/%s", tracing_events_path, sys_name);
evt_dir = opendir(evt_path);
if (!evt_dir) {
- tracepoint_error(error, errno, sys_name, evt_name);
+ tracepoint_error(err, errno, sys_name, evt_name);
return -1;
}
@@ -456,7 +456,7 @@ static int add_tracepoint_multi_event(struct list_head *list, int *idx,
if (!strglobmatch(evt_ent->d_name, evt_name))
continue;
- ret = add_tracepoint(list, idx, sys_name, evt_ent->d_name, error);
+ ret = add_tracepoint(list, idx, sys_name, evt_ent->d_name, err);
}
closedir(evt_dir);
@@ -465,16 +465,16 @@ static int add_tracepoint_multi_event(struct list_head *list, int *idx,
static int add_tracepoint_event(struct list_head *list, int *idx,
char *sys_name, char *evt_name,
- struct parse_events_error *error)
+ struct parse_events_error *err)
{
return strpbrk(evt_name, "*?") ?
- add_tracepoint_multi_event(list, idx, sys_name, evt_name, error) :
- add_tracepoint(list, idx, sys_name, evt_name, error);
+ add_tracepoint_multi_event(list, idx, sys_name, evt_name, err) :
+ add_tracepoint(list, idx, sys_name, evt_name, err);
}
static int add_tracepoint_multi_sys(struct list_head *list, int *idx,
char *sys_name, char *evt_name,
- struct parse_events_error *error)
+ struct parse_events_error *err)
{
struct dirent *events_ent;
DIR *events_dir;
@@ -482,7 +482,7 @@ static int add_tracepoint_multi_sys(struct list_head *list, int *idx,
events_dir = opendir(tracing_events_path);
if (!events_dir) {
- tracepoint_error(error, errno, sys_name, evt_name);
+ tracepoint_error(err, errno, sys_name, evt_name);
return -1;
}
@@ -498,7 +498,7 @@ static int add_tracepoint_multi_sys(struct list_head *list, int *idx,
continue;
ret = add_tracepoint_event(list, idx, events_ent->d_name,
- evt_name, error);
+ evt_name, err);
}
closedir(events_dir);
@@ -507,12 +507,12 @@ static int add_tracepoint_multi_sys(struct list_head *list, int *idx,
int parse_events_add_tracepoint(struct list_head *list, int *idx,
char *sys, char *event,
- struct parse_events_error *error)
+ struct parse_events_error *err)
{
if (strpbrk(sys, "*?"))
- return add_tracepoint_multi_sys(list, idx, sys, event, error);
+ return add_tracepoint_multi_sys(list, idx, sys, event, err);
else
- return add_tracepoint_event(list, idx, sys, event, error);
+ return add_tracepoint_event(list, idx, sys, event, err);
}
static int
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [tip:perf/core] tools: Add err.h with ERR_PTR PTR_ERR interface Vinson Lee <vlee@twopensource.com> - 2015-09-29 08:40 +0200
Re: [tip:perf/core] tools: Add err.h with ERR_PTR PTR_ERR interface Jiri Olsa <jolsa@redhat.com> - 2015-09-29 09:20 +0200
Re: [tip:perf/core] tools: Add err.h with ERR_PTR PTR_ERR interface Jiri Olsa <jolsa@redhat.com> - 2015-09-29 09:30 +0200
Re: [tip:perf/core] tools: Add err.h with ERR_PTR PTR_ERR interface Jiri Olsa <jolsa@redhat.com> - 2015-09-29 10:00 +0200
Re: [tip:perf/core] tools: Add err.h with ERR_PTR PTR_ERR interface He Kuang <hekuang@huawei.com> - 2015-09-29 10:30 +0200
Re: [tip:perf/core] tools: Add err.h with ERR_PTR PTR_ERR interface Jiri Olsa <jolsa@redhat.com> - 2015-09-29 12:50 +0200
Re: [tip:perf/core] tools: Add err.h with ERR_PTR PTR_ERR interface Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-09-29 17:00 +0200
[PATCH] perf tool: Fix shadowed declaration in parse-events.c Jiri Olsa <jolsa@redhat.com> - 2015-09-29 17:10 +0200
[tip:perf/core] perf tools: Fix shadowed declaration in parse-events.c tip-bot for Jiri Olsa <tipbot@zytor.com> - 2015-10-01 09:20 +0200
Re: [tip:perf/core] tools: Add err.h with ERR_PTR PTR_ERR interface He Kuang <hekuang@huawei.com> - 2015-09-29 10:00 +0200
csiph-web