perf trace beauty: Add the glue for the autogenerated MSR arrays

We need to wrap those autogenerated string arrays with the
strarrays__scnprintf() formatter, do it.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-wqjz4kwi4a0ot6lsis3kc65j@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 5d88099b
...@@ -17,3 +17,4 @@ perf-y += sockaddr.o ...@@ -17,3 +17,4 @@ perf-y += sockaddr.o
perf-y += socket.o perf-y += socket.o
perf-y += statx.o perf-y += statx.o
perf-y += sync_file_range.o perf-y += sync_file_range.o
perf-y += tracepoints/
...@@ -114,6 +114,9 @@ unsigned long syscall_arg__val(struct syscall_arg *arg, u8 idx); ...@@ -114,6 +114,9 @@ unsigned long syscall_arg__val(struct syscall_arg *arg, u8 idx);
size_t syscall_arg__scnprintf_strarray_flags(char *bf, size_t size, struct syscall_arg *arg); size_t syscall_arg__scnprintf_strarray_flags(char *bf, size_t size, struct syscall_arg *arg);
#define SCA_STRARRAY_FLAGS syscall_arg__scnprintf_strarray_flags #define SCA_STRARRAY_FLAGS syscall_arg__scnprintf_strarray_flags
size_t syscall_arg__scnprintf_x86_MSR(char *bf, size_t size, struct syscall_arg *arg);
#define SCA_X86_MSR syscall_arg__scnprintf_x86_MSR
size_t syscall_arg__scnprintf_strarrays(char *bf, size_t size, struct syscall_arg *arg); size_t syscall_arg__scnprintf_strarrays(char *bf, size_t size, struct syscall_arg *arg);
#define SCA_STRARRAYS syscall_arg__scnprintf_strarrays #define SCA_STRARRAYS syscall_arg__scnprintf_strarrays
......
// SPDX-License-Identifier: LGPL-2.1
/*
* trace/beauty/x86_msr.c
*
* Copyright (C) 2019, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
*/
#include "trace/beauty/beauty.h"
#include "trace/beauty/generated/x86_arch_MSRs_array.c"
static DEFINE_STRARRAY(x86_MSRs, "MSR_");
static DEFINE_STRARRAY_OFFSET(x86_64_specific_MSRs, "MSR_", x86_64_specific_MSRs_offset);
static DEFINE_STRARRAY_OFFSET(x86_AMD_V_KVM_MSRs, "MSR_", x86_AMD_V_KVM_MSRs_offset);
static struct strarray *x86_MSRs_tables[] = {
&strarray__x86_MSRs,
&strarray__x86_64_specific_MSRs,
&strarray__x86_AMD_V_KVM_MSRs,
};
static DEFINE_STRARRAYS(x86_MSRs_tables);
static size_t x86_MSR__scnprintf(unsigned long msr, char *bf, size_t size, bool show_prefix)
{
return strarrays__scnprintf(&strarrays__x86_MSRs_tables, bf, size, "%#x", show_prefix, msr);
}
size_t syscall_arg__scnprintf_x86_MSR(char *bf, size_t size, struct syscall_arg *arg)
{
unsigned long flags = arg->val;
return x86_MSR__scnprintf(flags, bf, size, arg->show_string_prefix);
}
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