Lines Matching +full:libbpf +full:- +full:tools
1 // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
4 // Based on readahead(8) from BPF-Perf-Tools-Book by Brendan Gregg.
5 // 8-Jun-2020 Wenbo Zhang Created this.
10 #include <bpf/libbpf.h>
20 .duration = -1
27 "https://github.com/iovisor/bcc/tree/master/libbpf-tools";
29 "Show fs automatic read-ahead usage.\n"
31 "USAGE: readahead [--help] [-d DURATION]\n"
34 " readahead # summarize on-CPU time as a histogram"
35 " readahead -d 10 # trace for 10 seconds only\n";
93 bpf_program__name(prog), strerror(-err)); in readahead__set_attach_target()
122 * Starting from v5.10-rc1 (8238287), __do_page_cache_readahead has in main()
125 err = readahead__set_attach_target(obj->progs.do_page_cache_ra); in main()
128 err = readahead__set_attach_target(obj->progs.do_page_cache_ra_ret); in main()
138 if (!obj->bss) { in main()
139 …fprintf(stderr, "Memory-mapping BPF maps is supported starting from Linux 5.7, please upgrade.\n"); in main()
151 printf("Tracing fs read-ahead ... Hit Ctrl-C to end.\n"); in main()
156 histp = &obj->bss->hist; in main()
159 histp->unused, histp->total); in main()
160 print_log2_hist(histp->slots, MAX_SLOTS, "msecs"); in main()