diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-12-18 14:25:28 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-12-18 20:15:19 +0100 |
commit | 1f2d085e0f25a40eeb0ac032fd399be94f866adb (patch) | |
tree | ce0707e15a7a5eb8801772152572e6ee6e2651dc /tools/perf/trace | |
parent | perf beauty: Wire up the x86_arch prctl code table generator (diff) | |
download | linux-1f2d085e0f25a40eeb0ac032fd399be94f866adb.tar.xz linux-1f2d085e0f25a40eeb0ac032fd399be94f866adb.zip |
perf trace: Move strarrays to beauty.h for further reuse
We'll use it in the upcoming arch_prctl() 'code' arg beautifier.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-6e4tj2fjen8qa73gy4u49vav@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/trace')
-rw-r--r-- | tools/perf/trace/beauty/beauty.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h index 1a93d9c626ef..58e734b27958 100644 --- a/tools/perf/trace/beauty/beauty.h +++ b/tools/perf/trace/beauty/beauty.h @@ -32,6 +32,18 @@ size_t strarray__scnprintf_flags(struct strarray *sa, char *bf, size_t size, boo struct trace; struct thread; +struct strarrays { + int nr_entries; + struct strarray **entries; +}; + +#define DEFINE_STRARRAYS(array) struct strarrays strarrays__##array = { \ + .nr_entries = ARRAY_SIZE(array), \ + .entries = array, \ +} + +size_t strarrays__scnprintf(struct strarrays *sas, char *bf, size_t size, const char *intfmt, bool show_prefix, int val); + size_t pid__scnprintf_fd(struct trace *trace, pid_t pid, int fd, char *bf, size_t size); extern struct strarray strarray__socket_families; |