diff options
author | Alan Maguire <alan.maguire@oracle.com> | 2020-09-28 14:31:04 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-09-29 04:26:58 +0300 |
commit | 31d0bc81637d8d974a6dad9827b765b4b70c89d7 (patch) | |
tree | 95012b4f5c189b4ae257f45f102c41ea92c519e9 /include/uapi/linux/openat2.h | |
parent | 76654e67f3a01c50dc13dd6dea75e58943413956 (diff) | |
download | linux-31d0bc81637d8d974a6dad9827b765b4b70c89d7.tar.xz |
bpf: Move to generic BTF show support, apply it to seq files/strings
generalize the "seq_show" seq file support in btf.c to support
a generic show callback of which we support two instances; the
current seq file show, and a show with snprintf() behaviour which
instead writes the type data to a supplied string.
Both classes of show function call btf_type_show() with different
targets; the seq file or the string to be written. In the string
case we need to track additional data - length left in string to write
and length to return that we would have written (a la snprintf).
By default show will display type information, field members and
their types and values etc, and the information is indented
based upon structure depth. Zeroed fields are omitted.
Show however supports flags which modify its behaviour:
BTF_SHOW_COMPACT - suppress newline/indent.
BTF_SHOW_NONAME - suppress show of type and member names.
BTF_SHOW_PTR_RAW - do not obfuscate pointer values.
BTF_SHOW_UNSAFE - do not copy data to safe buffer before display.
BTF_SHOW_ZERO - show zeroed values (by default they are not shown).
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/1601292670-1616-3-git-send-email-alan.maguire@oracle.com
Diffstat (limited to 'include/uapi/linux/openat2.h')
0 files changed, 0 insertions, 0 deletions