diff options
author | Ian Rogers <irogers@google.com> | 2022-11-29 22:29:35 -0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-12-14 11:16:12 -0300 |
commit | 4171925aa9f3f7bf57b100238f148b50c45c3b1b (patch) | |
tree | e0ce5c710110ee5c49ef466da9b70bb30ccb7d28 /tools/lib/traceevent/tep_strerror.c | |
parent | 378ef0f5d9d7f4652d7a40e0711e8b845ada1cbd (diff) | |
download | linux-4171925aa9f3f7bf57b100238f148b50c45c3b1b.tar.gz linux-4171925aa9f3f7bf57b100238f148b50c45c3b1b.tar.bz2 linux-4171925aa9f3f7bf57b100238f148b50c45c3b1b.zip |
tools lib traceevent: Remove libtraceevent
libtraceevent is now out-of-date and it is better to depend on the
system version. Remove this code that is no longer depended upon by
any builds.
Committer notes:
Removed the removed tools/lib/traceevent/ from tools/perf/MANIFEST, so
that 'make perf-tar-src-pkg' works.
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20221130062935.2219247-5-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/traceevent/tep_strerror.c')
-rw-r--r-- | tools/lib/traceevent/tep_strerror.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/tools/lib/traceevent/tep_strerror.c b/tools/lib/traceevent/tep_strerror.c deleted file mode 100644 index 4ac26445b2f6..000000000000 --- a/tools/lib/traceevent/tep_strerror.c +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1 -#undef _GNU_SOURCE -#include <string.h> -#include <stdio.h> - -#include "event-parse.h" - -#undef _PE -#define _PE(code, str) str -static const char * const tep_error_str[] = { - TEP_ERRORS -}; -#undef _PE - -/* - * The tools so far have been using the strerror_r() GNU variant, that returns - * a string, be it the buffer passed or something else. - * - * But that, besides being tricky in cases where we expect that the function - * using strerror_r() returns the error formatted in a provided buffer (we have - * to check if it returned something else and copy that instead), breaks the - * build on systems not using glibc, like Alpine Linux, where musl libc is - * used. - * - * So, introduce yet another wrapper, str_error_r(), that has the GNU - * interface, but uses the portable XSI variant of strerror_r(), so that users - * rest asured that the provided buffer is used and it is what is returned. - */ -int tep_strerror(struct tep_handle *tep __maybe_unused, - enum tep_errno errnum, char *buf, size_t buflen) -{ - const char *msg; - int idx; - - if (!buflen) - return 0; - - if (errnum >= 0) { - int err = strerror_r(errnum, buf, buflen); - buf[buflen - 1] = 0; - return err; - } - - if (errnum <= __TEP_ERRNO__START || - errnum >= __TEP_ERRNO__END) - return -1; - - idx = errnum - __TEP_ERRNO__START - 1; - msg = tep_error_str[idx]; - snprintf(buf, buflen, "%s", msg); - - return 0; -} |