diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-12-14 19:08:40 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-12-18 20:07:42 +0100 |
commit | 2e3d7fac9db5e80d1cc26bb1453b85245c26d657 (patch) | |
tree | 8dcae752eae3df3f51d81a2b0af78679cbbbc23a /tools/perf/trace/beauty/beauty.h | |
parent | perf trace: Enclose strings with double quotes (diff) | |
download | linux-2e3d7fac9db5e80d1cc26bb1453b85245c26d657.tar.xz linux-2e3d7fac9db5e80d1cc26bb1453b85245c26d657.zip |
perf trace: Add a prefix member to the strarray class
So that the user, in an upcoming patch, can select printing it to get
the full string as used in the source code, not one with a common prefix
chopped off so as to make the output more compact.
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-zypczc88gzbmeqx7b372s138@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/trace/beauty/beauty.h')
-rw-r--r-- | tools/perf/trace/beauty/beauty.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h index 48ff3ce05325..452e9c006d4f 100644 --- a/tools/perf/trace/beauty/beauty.h +++ b/tools/perf/trace/beauty/beauty.h @@ -9,18 +9,21 @@ struct strarray { int offset; int nr_entries; + const char *prefix; const char **entries; }; -#define DEFINE_STRARRAY(array) struct strarray strarray__##array = { \ +#define DEFINE_STRARRAY(array, _prefix) struct strarray strarray__##array = { \ .nr_entries = ARRAY_SIZE(array), \ .entries = array, \ + .prefix = _prefix, \ } -#define DEFINE_STRARRAY_OFFSET(array, off) struct strarray strarray__##array = { \ +#define DEFINE_STRARRAY_OFFSET(array, _prefix, off) struct strarray strarray__##array = { \ .offset = off, \ .nr_entries = ARRAY_SIZE(array), \ .entries = array, \ + .prefix = _prefix, \ } size_t strarray__scnprintf(struct strarray *sa, char *bf, size_t size, const char *intfmt, int val); |