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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 92bbe8d8
...@@ -1791,8 +1791,8 @@ int bpf__strerror_apply_obj_config(int err, char *buf, size_t size) ...@@ -1791,8 +1791,8 @@ int bpf__strerror_apply_obj_config(int err, char *buf, size_t size)
return 0; return 0;
} }
int bpf__strerror_setup_stdout(struct perf_evlist *evlist __maybe_unused, int bpf__strerror_setup_output_event(struct perf_evlist *evlist __maybe_unused,
int err, char *buf, size_t size) int err, char *buf, size_t size)
{ {
bpf__strerror_head(err, buf, size); bpf__strerror_head(err, buf, size);
bpf__strerror_end(buf, size); bpf__strerror_end(buf, size);
......
...@@ -83,9 +83,7 @@ int bpf__strerror_apply_obj_config(int err, char *buf, size_t size); ...@@ -83,9 +83,7 @@ int bpf__strerror_apply_obj_config(int err, char *buf, size_t size);
int bpf__setup_stdout(struct perf_evlist *evlist); int bpf__setup_stdout(struct perf_evlist *evlist);
int bpf__setup_output_event(struct perf_evlist *evlist, const char *name); int bpf__setup_output_event(struct perf_evlist *evlist, const char *name);
int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err, int bpf__strerror_setup_output_event(struct perf_evlist *evlist, int err, char *buf, size_t size);
char *buf, size_t size);
#else #else
#include <errno.h> #include <errno.h>
...@@ -200,11 +198,16 @@ bpf__strerror_apply_obj_config(int err __maybe_unused, ...@@ -200,11 +198,16 @@ bpf__strerror_apply_obj_config(int err __maybe_unused,
} }
static inline int static inline int
bpf__strerror_setup_stdout(struct perf_evlist *evlist __maybe_unused, bpf__strerror_setup_output_event(struct perf_evlist *evlist __maybe_unused,
int err __maybe_unused, char *buf, int err __maybe_unused, char *buf, size_t size)
size_t size)
{ {
return __bpf_strerror(buf, size); return __bpf_strerror(buf, size);
} }
#endif #endif
static inline int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err, char *buf, size_t size)
{
return bpf__strerror_setup_output_event(evlist, err, buf, size);
}
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment