unsigned long pfmaj, pfmin;
char *entry_str;
double runtime_ms;
- size_t (*ret_scnprintf)(unsigned long value, char *bf, size_t size);
+ size_t (*ret_scnprintf)(char *bf, size_t size, struct syscall_arg *arg);
struct {
unsigned long ptr;
short int entry_str_pos;
void syscall_arg__set_ret_scnprintf(struct syscall_arg *arg,
- size_t (*ret_scnprintf)(unsigned long val, char *bf, size_t size))
+ size_t (*ret_scnprintf)(char *bf, size_t size, struct syscall_arg *arg))
{
struct thread_trace *ttrace = thread__priv(arg->thread);
fprintf(trace->output, ") = 0 Timeout");
else if (ttrace->ret_scnprintf) {
char bf[1024];
- ttrace->ret_scnprintf(ret, bf, sizeof(bf));
+ struct syscall_arg arg = {
+ .val = ret,
+ .thread = thread,
+ .trace = trace,
+ };
+ ttrace->ret_scnprintf(bf, sizeof(bf), &arg);
ttrace->ret_scnprintf = NULL;
fprintf(trace->output, ") = %s", bf);
} else if (sc->fmt->hexret)
size_t syscall_arg__scnprintf_fcntl_arg(char *bf, size_t size, struct syscall_arg *arg);
#define SCA_FCNTL_ARG syscall_arg__scnprintf_fcntl_arg
+size_t syscall_arg__scnprintf_open_flags(char *bf, size_t size, struct syscall_arg *arg);
+#define SCA_OPEN_FLAGS syscall_arg__scnprintf_open_flags
+
size_t syscall_arg__scnprintf_statx_flags(char *bf, size_t size, struct syscall_arg *arg);
#define SCA_STATX_FLAGS syscall_arg__scnprintf_statx_flags
size_t open__scnprintf_flags(unsigned long flags, char *bf, size_t size);
void syscall_arg__set_ret_scnprintf(struct syscall_arg *arg,
- size_t (*ret_scnprintf)(unsigned long val, char *bf, size_t size));
+ size_t (*ret_scnprintf)(char *bf, size_t size, struct syscall_arg *arg));
#endif /* _PERF_TRACE_BEAUTY_H */
return scnprintf(bf, size, "%s", val ? "CLOEXEC" : "0");
}
+static size_t syscall_arg__scnprintf_fcntl_getfd(char *bf, size_t size, struct syscall_arg *arg)
+{
+ return fcntl__scnprintf_getfd(arg->val, bf, size);
+}
+
size_t syscall_arg__scnprintf_fcntl_cmd(char *bf, size_t size, struct syscall_arg *arg)
{
if (arg->val == F_GETFL) {
- syscall_arg__set_ret_scnprintf(arg, open__scnprintf_flags);
+ syscall_arg__set_ret_scnprintf(arg, syscall_arg__scnprintf_open_flags);
goto mask_arg;
}
if (arg->val == F_GETFD) {
- syscall_arg__set_ret_scnprintf(arg, fcntl__scnprintf_getfd);
+ syscall_arg__set_ret_scnprintf(arg, syscall_arg__scnprintf_fcntl_getfd);
goto mask_arg;
}
/*
return printed;
}
-static size_t syscall_arg__scnprintf_open_flags(char *bf, size_t size, struct syscall_arg *arg)
+size_t syscall_arg__scnprintf_open_flags(char *bf, size_t size, struct syscall_arg *arg)
{
int flags = arg->val;
return open__scnprintf_flags(flags, bf, size);
}
-
-
-#define SCA_OPEN_FLAGS syscall_arg__scnprintf_open_flags