From 5d1646d90e1f2cceb9f0828f4b28318cd0ec7744 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 12:05:51 +0200 Subject: Adding upstream version 5.10.209. Signed-off-by: Daniel Baumann --- tools/perf/include/bpf/stdio.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tools/perf/include/bpf/stdio.h (limited to 'tools/perf/include/bpf/stdio.h') diff --git a/tools/perf/include/bpf/stdio.h b/tools/perf/include/bpf/stdio.h new file mode 100644 index 000000000..316af5b2f --- /dev/null +++ b/tools/perf/include/bpf/stdio.h @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include + +struct bpf_map SEC("maps") __bpf_stdout__ = { + .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY, + .key_size = sizeof(int), + .value_size = sizeof(u32), + .max_entries = __NR_CPUS__, +}; + +#define puts(from) \ + ({ const int __len = sizeof(from); \ + char __from[__len] = from; \ + perf_event_output(args, &__bpf_stdout__, BPF_F_CURRENT_CPU, \ + &__from, __len & (sizeof(from) - 1)); }) -- cgit v1.2.3