aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-08-06 10:35:37 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-08-08 14:55:56 -0400
commitaa31be3a4874d91fb40d872f1865805ab411035c (patch)
tree59c32921d52f595a0127c99a0ef7c4fde39d4804
parent92bbe8d834d293c4db7a70fd53884ec1c95d61dc (diff)
perf bpf: Add bpf__setup_output_event() strerror() counterpart
That is just bpf__strerror_setup_stdout() renamed to the more general "setup_output_event" method, keep the existing stdout() as a wrapper. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-nwnveo428qn0b48axj50vkc7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/bpf-loader.c4
-rw-r--r--tools/perf/util/bpf-loader.h15
2 files changed, 11 insertions, 8 deletions
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 95a27bb6f1a1..80dead642719 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -1791,8 +1791,8 @@ int bpf__strerror_apply_obj_config(int err, char *buf, size_t size)
1791 return 0; 1791 return 0;
1792} 1792}
1793 1793
1794int bpf__strerror_setup_stdout(struct perf_evlist *evlist __maybe_unused, 1794int bpf__strerror_setup_output_event(struct perf_evlist *evlist __maybe_unused,
1795 int err, char *buf, size_t size) 1795 int err, char *buf, size_t size)
1796{ 1796{
1797 bpf__strerror_head(err, buf, size); 1797 bpf__strerror_head(err, buf, size);
1798 bpf__strerror_end(buf, size); 1798 bpf__strerror_end(buf, size);
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h
index 6be0eec043c6..8eca75145ac2 100644
--- a/tools/perf/util/bpf-loader.h
+++ b/tools/perf/util/bpf-loader.h
@@ -83,9 +83,7 @@ int bpf__strerror_apply_obj_config(int err, char *buf, size_t size);
83 83
84int bpf__setup_stdout(struct perf_evlist *evlist); 84int bpf__setup_stdout(struct perf_evlist *evlist);
85int bpf__setup_output_event(struct perf_evlist *evlist, const char *name); 85int bpf__setup_output_event(struct perf_evlist *evlist, const char *name);
86int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err, 86int bpf__strerror_setup_output_event(struct perf_evlist *evlist, int err, char *buf, size_t size);
87 char *buf, size_t size);
88
89#else 87#else
90#include <errno.h> 88#include <errno.h>
91 89
@@ -200,11 +198,16 @@ bpf__strerror_apply_obj_config(int err __maybe_unused,
200} 198}
201 199
202static inline int 200static inline int
203bpf__strerror_setup_stdout(struct perf_evlist *evlist __maybe_unused, 201bpf__strerror_setup_output_event(struct perf_evlist *evlist __maybe_unused,
204 int err __maybe_unused, char *buf, 202 int err __maybe_unused, char *buf, size_t size)
205 size_t size)
206{ 203{
207 return __bpf_strerror(buf, size); 204 return __bpf_strerror(buf, size);
208} 205}
206
209#endif 207#endif
208
209static inline int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err, char *buf, size_t size)
210{
211 return bpf__strerror_setup_output_event(evlist, err, buf, size);
212}
210#endif 213#endif