summaryrefslogtreecommitdiff
path: root/kernel/trace
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2020-06-23 16:08:07 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-06-24 18:37:58 -0700
commitc06b0229579806f5b5e14af64cf9c5dc771445b3 (patch)
treeeadac4c9a80ace4d56b40d116fdf6ef2fc4d7ad4 /kernel/trace
parent52d87d5f6418ba1b8b449ed5eea1532664896851 (diff)
downloadlinux-c06b0229579806f5b5e14af64cf9c5dc771445b3.tar.gz
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/trace')
-rw-r--r--kernel/trace/bpf_trace.c3
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;
}