diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-08-06 10:35:37 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-08-08 14:55:56 -0400 |
commit | aa31be3a4874d91fb40d872f1865805ab411035c (patch) | |
tree | 59c32921d52f595a0127c99a0ef7c4fde39d4804 | |
parent | 92bbe8d834d293c4db7a70fd53884ec1c95d61dc (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.c | 4 | ||||
-rw-r--r-- | tools/perf/util/bpf-loader.h | 15 |
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 | ||
1794 | int bpf__strerror_setup_stdout(struct perf_evlist *evlist __maybe_unused, | 1794 | int 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 | ||
84 | int bpf__setup_stdout(struct perf_evlist *evlist); | 84 | int bpf__setup_stdout(struct perf_evlist *evlist); |
85 | int bpf__setup_output_event(struct perf_evlist *evlist, const char *name); | 85 | int bpf__setup_output_event(struct perf_evlist *evlist, const char *name); |
86 | int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err, | 86 | int 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 | ||
202 | static inline int | 200 | static inline int |
203 | bpf__strerror_setup_stdout(struct perf_evlist *evlist __maybe_unused, | 201 | bpf__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 | |||
209 | static 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 |