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 <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Wang Nan <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
Arnaldo Carvalho de Melo committed 2018-08-08 15:55:56 -03:00
1 parent 92bbe8d834
commit aa31be3a48
2 files changed
+11 -8

No files matched your search

+2 -2
View File
@@ -1791,8 +1791,8 @@ int bpf__strerror_apply_obj_config(int err, char *buf, size_t size)
return 0;
}
int bpf__strerror_setup_stdout(struct perf_evlist *evlist __maybe_unused,
int err, char *buf, size_t size)
int bpf__strerror_setup_output_event(struct perf_evlist *evlist __maybe_unused,
int err, char *buf, size_t size)
{
bpf__strerror_head(err, buf, size);
bpf__strerror_end(buf, size);
+9 -6
View File
@@ -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_output_event(struct perf_evlist *evlist, const char *name);
int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err,
char *buf, size_t size);
int bpf__strerror_setup_output_event(struct perf_evlist *evlist, int err, char *buf, size_t size);
#else
#include <errno.h>
@@ -200,11 +198,16 @@ bpf__strerror_apply_obj_config(int err __maybe_unused,
}
static inline int
bpf__strerror_setup_stdout(struct perf_evlist *evlist __maybe_unused,
int err __maybe_unused, char *buf,
size_t size)
bpf__strerror_setup_output_event(struct perf_evlist *evlist __maybe_unused,
int err __maybe_unused, char *buf, size_t size)
{
return __bpf_strerror(buf, size);
}
#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