|
@@ -21,6 +21,7 @@
|
|
#include "builtin.h"
|
|
#include "builtin.h"
|
|
#include "util/color.h"
|
|
#include "util/color.h"
|
|
#include "util/debug.h"
|
|
#include "util/debug.h"
|
|
|
|
+#include "util/env.h"
|
|
#include "util/event.h"
|
|
#include "util/event.h"
|
|
#include "util/evlist.h"
|
|
#include "util/evlist.h"
|
|
#include <subcmd/exec-cmd.h>
|
|
#include <subcmd/exec-cmd.h>
|
|
@@ -45,14 +46,12 @@
|
|
|
|
|
|
#include <errno.h>
|
|
#include <errno.h>
|
|
#include <inttypes.h>
|
|
#include <inttypes.h>
|
|
-#include <libaudit.h> /* FIXME: Still needed for audit_errno_to_name */
|
|
|
|
#include <poll.h>
|
|
#include <poll.h>
|
|
#include <signal.h>
|
|
#include <signal.h>
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <string.h>
|
|
#include <linux/err.h>
|
|
#include <linux/err.h>
|
|
#include <linux/filter.h>
|
|
#include <linux/filter.h>
|
|
-#include <linux/audit.h>
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/random.h>
|
|
#include <linux/random.h>
|
|
#include <linux/stringify.h>
|
|
#include <linux/stringify.h>
|
|
@@ -545,6 +544,7 @@ static size_t syscall_arg__scnprintf_getrandom_flags(char *bf, size_t size,
|
|
{ .scnprintf = SCA_STRARRAY, \
|
|
{ .scnprintf = SCA_STRARRAY, \
|
|
.parm = &strarray__##array, }
|
|
.parm = &strarray__##array, }
|
|
|
|
|
|
|
|
+#include "trace/beauty/arch_errno_names.c"
|
|
#include "trace/beauty/eventfd.c"
|
|
#include "trace/beauty/eventfd.c"
|
|
#include "trace/beauty/flock.c"
|
|
#include "trace/beauty/flock.c"
|
|
#include "trace/beauty/futex_op.c"
|
|
#include "trace/beauty/futex_op.c"
|
|
@@ -1660,6 +1660,14 @@ static int trace__fprintf_callchain(struct trace *trace, struct perf_sample *sam
|
|
return sample__fprintf_callchain(sample, 38, print_opts, &callchain_cursor, trace->output);
|
|
return sample__fprintf_callchain(sample, 38, print_opts, &callchain_cursor, trace->output);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static const char *errno_to_name(struct perf_evsel *evsel, int err)
|
|
|
|
+{
|
|
|
|
+ struct perf_env *env = perf_evsel__env(evsel);
|
|
|
|
+ const char *arch_name = perf_env__arch(env);
|
|
|
|
+
|
|
|
|
+ return arch_syscalls__strerrno(arch_name, err);
|
|
|
|
+}
|
|
|
|
+
|
|
static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel,
|
|
static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel,
|
|
union perf_event *event __maybe_unused,
|
|
union perf_event *event __maybe_unused,
|
|
struct perf_sample *sample)
|
|
struct perf_sample *sample)
|
|
@@ -1730,7 +1738,7 @@ signed_print:
|
|
errno_print: {
|
|
errno_print: {
|
|
char bf[STRERR_BUFSIZE];
|
|
char bf[STRERR_BUFSIZE];
|
|
const char *emsg = str_error_r(-ret, bf, sizeof(bf)),
|
|
const char *emsg = str_error_r(-ret, bf, sizeof(bf)),
|
|
- *e = audit_errno_to_name(-ret);
|
|
|
|
|
|
+ *e = errno_to_name(evsel, -ret);
|
|
|
|
|
|
fprintf(trace->output, ") = -1 %s %s", e, emsg);
|
|
fprintf(trace->output, ") = -1 %s %s", e, emsg);
|
|
}
|
|
}
|