diff options
author | Yonghong Song <yhs@fb.com> | 2020-06-24 01:08:07 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-06-25 03:37:58 +0200 |
commit | c06b0229579806f5b5e14af64cf9c5dc771445b3 (patch) | |
tree | eadac4c9a80ace4d56b40d116fdf6ef2fc4d7ad4 /kernel | |
parent | net: bpf: Implement bpf iterator for tcp (diff) | |
download | linux-c06b0229579806f5b5e14af64cf9c5dc771445b3.tar.xz linux-c06b0229579806f5b5e14af64cf9c5dc771445b3.zip |
bpf: Support 'X' in bpf_seq_printf() helper
'X' tells kernel to print hex with upper case letters.
/proc/net/tcp{4,6} seq_file show() used this, and
supports it in bpf_seq_printf() helper too.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200623230807.3988014-1-yhs@fb.com
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/bpf_trace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index a3ac7de98baa..b44505f56b6d 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -681,7 +681,8 @@ BPF_CALL_5(bpf_seq_printf, struct seq_file *, m, char *, fmt, u32, fmt_size, } if (fmt[i] != 'i' && fmt[i] != 'd' && - fmt[i] != 'u' && fmt[i] != 'x') { + fmt[i] != 'u' && fmt[i] != 'x' && + fmt[i] != 'X') { err = -EINVAL; goto out; } |