bench.c (1175f8dea349e5999d99727346db24f38306a793) bench.c (7df4e597ea2cfd677e65730948153d5544986a10)
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2020 Facebook */
3#define _GNU_SOURCE
4#include <argp.h>
5#include <linux/compiler.h>
6#include <sys/time.h>
7#include <sched.h>
8#include <fcntl.h>

--- 266 unchanged lines hidden (view full) ---

275extern struct argp bench_bloom_map_argp;
276extern struct argp bench_bpf_loop_argp;
277extern struct argp bench_local_storage_argp;
278extern struct argp bench_local_storage_rcu_tasks_trace_argp;
279extern struct argp bench_strncmp_argp;
280extern struct argp bench_hashmap_lookup_argp;
281extern struct argp bench_local_storage_create_argp;
282extern struct argp bench_htab_mem_argp;
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2020 Facebook */
3#define _GNU_SOURCE
4#include <argp.h>
5#include <linux/compiler.h>
6#include <sys/time.h>
7#include <sched.h>
8#include <fcntl.h>

--- 266 unchanged lines hidden (view full) ---

275extern struct argp bench_bloom_map_argp;
276extern struct argp bench_bpf_loop_argp;
277extern struct argp bench_local_storage_argp;
278extern struct argp bench_local_storage_rcu_tasks_trace_argp;
279extern struct argp bench_strncmp_argp;
280extern struct argp bench_hashmap_lookup_argp;
281extern struct argp bench_local_storage_create_argp;
282extern struct argp bench_htab_mem_argp;
283extern struct argp bench_trigger_batch_argp;
283
284static const struct argp_child bench_parsers[] = {
285 { &bench_ringbufs_argp, 0, "Ring buffers benchmark", 0 },
286 { &bench_bloom_map_argp, 0, "Bloom filter map benchmark", 0 },
287 { &bench_bpf_loop_argp, 0, "bpf_loop helper benchmark", 0 },
288 { &bench_local_storage_argp, 0, "local_storage benchmark", 0 },
289 { &bench_strncmp_argp, 0, "bpf_strncmp helper benchmark", 0 },
290 { &bench_local_storage_rcu_tasks_trace_argp, 0,
291 "local_storage RCU Tasks Trace slowdown benchmark", 0 },
292 { &bench_hashmap_lookup_argp, 0, "Hashmap lookup benchmark", 0 },
293 { &bench_local_storage_create_argp, 0, "local-storage-create benchmark", 0 },
294 { &bench_htab_mem_argp, 0, "hash map memory benchmark", 0 },
284
285static const struct argp_child bench_parsers[] = {
286 { &bench_ringbufs_argp, 0, "Ring buffers benchmark", 0 },
287 { &bench_bloom_map_argp, 0, "Bloom filter map benchmark", 0 },
288 { &bench_bpf_loop_argp, 0, "bpf_loop helper benchmark", 0 },
289 { &bench_local_storage_argp, 0, "local_storage benchmark", 0 },
290 { &bench_strncmp_argp, 0, "bpf_strncmp helper benchmark", 0 },
291 { &bench_local_storage_rcu_tasks_trace_argp, 0,
292 "local_storage RCU Tasks Trace slowdown benchmark", 0 },
293 { &bench_hashmap_lookup_argp, 0, "Hashmap lookup benchmark", 0 },
294 { &bench_local_storage_create_argp, 0, "local-storage-create benchmark", 0 },
295 { &bench_htab_mem_argp, 0, "hash map memory benchmark", 0 },
296 { &bench_trigger_batch_argp, 0, "BPF triggering benchmark", 0 },
295 {},
296};
297
298/* Make pos_args global, so that we can run argp_parse twice, if necessary */
299static int pos_args;
300
301static error_t parse_arg(int key, char *arg, struct argp_state *state)
302{

--- 200 unchanged lines hidden (view full) ---

503extern const struct bench bench_trig_kretprobe;
504extern const struct bench bench_trig_kprobe_multi;
505extern const struct bench bench_trig_kretprobe_multi;
506extern const struct bench bench_trig_fentry;
507extern const struct bench bench_trig_fexit;
508extern const struct bench bench_trig_fentry_sleep;
509extern const struct bench bench_trig_fmodret;
510
297 {},
298};
299
300/* Make pos_args global, so that we can run argp_parse twice, if necessary */
301static int pos_args;
302
303static error_t parse_arg(int key, char *arg, struct argp_state *state)
304{

--- 200 unchanged lines hidden (view full) ---

505extern const struct bench bench_trig_kretprobe;
506extern const struct bench bench_trig_kprobe_multi;
507extern const struct bench bench_trig_kretprobe_multi;
508extern const struct bench bench_trig_fentry;
509extern const struct bench bench_trig_fexit;
510extern const struct bench bench_trig_fentry_sleep;
511extern const struct bench bench_trig_fmodret;
512
513/* batched, staying mostly in-kernel benchmarks */
514extern const struct bench bench_trig_kernel_count;
515extern const struct bench bench_trig_kprobe_batch;
516extern const struct bench bench_trig_kretprobe_batch;
517extern const struct bench bench_trig_kprobe_multi_batch;
518extern const struct bench bench_trig_kretprobe_multi_batch;
519extern const struct bench bench_trig_fentry_batch;
520extern const struct bench bench_trig_fexit_batch;
521
511/* uprobe/uretprobe benchmarks */
512extern const struct bench bench_trig_uprobe_nop;
513extern const struct bench bench_trig_uretprobe_nop;
514extern const struct bench bench_trig_uprobe_push;
515extern const struct bench bench_trig_uretprobe_push;
516extern const struct bench bench_trig_uprobe_ret;
517extern const struct bench bench_trig_uretprobe_ret;
518

--- 24 unchanged lines hidden (view full) ---

543 &bench_rename_base,
544 &bench_rename_kprobe,
545 &bench_rename_kretprobe,
546 &bench_rename_rawtp,
547 &bench_rename_fentry,
548 &bench_rename_fexit,
549 /* pure counting benchmarks for establishing theoretical limits */
550 &bench_trig_usermode_count,
522/* uprobe/uretprobe benchmarks */
523extern const struct bench bench_trig_uprobe_nop;
524extern const struct bench bench_trig_uretprobe_nop;
525extern const struct bench bench_trig_uprobe_push;
526extern const struct bench bench_trig_uretprobe_push;
527extern const struct bench bench_trig_uprobe_ret;
528extern const struct bench bench_trig_uretprobe_ret;
529

--- 24 unchanged lines hidden (view full) ---

554 &bench_rename_base,
555 &bench_rename_kprobe,
556 &bench_rename_kretprobe,
557 &bench_rename_rawtp,
558 &bench_rename_fentry,
559 &bench_rename_fexit,
560 /* pure counting benchmarks for establishing theoretical limits */
561 &bench_trig_usermode_count,
551 &bench_trig_base,
562 &bench_trig_kernel_count,
552 /* syscall-driven triggering benchmarks */
553 &bench_trig_tp,
554 &bench_trig_rawtp,
555 &bench_trig_kprobe,
556 &bench_trig_kretprobe,
557 &bench_trig_kprobe_multi,
558 &bench_trig_kretprobe_multi,
559 &bench_trig_fentry,
560 &bench_trig_fexit,
561 &bench_trig_fentry_sleep,
562 &bench_trig_fmodret,
563 /* syscall-driven triggering benchmarks */
564 &bench_trig_tp,
565 &bench_trig_rawtp,
566 &bench_trig_kprobe,
567 &bench_trig_kretprobe,
568 &bench_trig_kprobe_multi,
569 &bench_trig_kretprobe_multi,
570 &bench_trig_fentry,
571 &bench_trig_fexit,
572 &bench_trig_fentry_sleep,
573 &bench_trig_fmodret,
574 /* batched, staying mostly in-kernel triggers */
575 &bench_trig_kprobe_batch,
576 &bench_trig_kretprobe_batch,
577 &bench_trig_kprobe_multi_batch,
578 &bench_trig_kretprobe_multi_batch,
579 &bench_trig_fentry_batch,
580 &bench_trig_fexit_batch,
563 /* uprobes */
564 &bench_trig_uprobe_nop,
565 &bench_trig_uretprobe_nop,
566 &bench_trig_uprobe_push,
567 &bench_trig_uretprobe_push,
568 &bench_trig_uprobe_ret,
569 &bench_trig_uretprobe_ret,
581 /* uprobes */
582 &bench_trig_uprobe_nop,
583 &bench_trig_uretprobe_nop,
584 &bench_trig_uprobe_push,
585 &bench_trig_uretprobe_push,
586 &bench_trig_uprobe_ret,
587 &bench_trig_uretprobe_ret,
588 /* ringbuf/perfbuf benchmarks */
570 &bench_rb_libbpf,
571 &bench_rb_custom,
572 &bench_pb_libbpf,
573 &bench_pb_custom,
574 &bench_bloom_lookup,
575 &bench_bloom_update,
576 &bench_bloom_false_positive,
577 &bench_hashmap_without_bloom,

--- 149 unchanged lines hidden ---
589 &bench_rb_libbpf,
590 &bench_rb_custom,
591 &bench_pb_libbpf,
592 &bench_pb_custom,
593 &bench_bloom_lookup,
594 &bench_bloom_update,
595 &bench_bloom_false_positive,
596 &bench_hashmap_without_bloom,

--- 149 unchanged lines hidden ---