--- /dev/null
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2020 Facebook */
+#include <fcntl.h>
+#include "bench.h"
+#include "test_overhead.skel.h"
+
+/* BPF triggering benchmarks */
+static struct ctx {
+       struct test_overhead *skel;
+       struct counter hits;
+       int fd;
+} ctx;
+
+static void validate()
+{
+       if (env.producer_cnt != 1) {
+               fprintf(stderr, "benchmark doesn't support multi-producer!\n");
+               exit(1);
+       }
+       if (env.consumer_cnt != 1) {
+               fprintf(stderr, "benchmark doesn't support multi-consumer!\n");
+               exit(1);
+       }
+}
+
+static void *producer(void *input)
+{
+       char buf[] = "test_overhead";
+       int err;
+
+       while (true) {
+               err = write(ctx.fd, buf, sizeof(buf));
+               if (err < 0) {
+                       fprintf(stderr, "write failed\n");
+                       exit(1);
+               }
+               atomic_inc(&ctx.hits.value);
+       }
+}
+
+static void measure(struct bench_res *res)
+{
+       res->hits = atomic_swap(&ctx.hits.value, 0);
+}
+
+static void setup_ctx()
+{
+       setup_libbpf();
+
+       ctx.skel = test_overhead__open_and_load();
+       if (!ctx.skel) {
+               fprintf(stderr, "failed to open skeleton\n");
+               exit(1);
+       }
+
+       ctx.fd = open("/proc/self/comm", O_WRONLY|O_TRUNC);
+       if (ctx.fd < 0) {
+               fprintf(stderr, "failed to open /proc/self/comm: %d\n", -errno);
+               exit(1);
+       }
+}
+
+static void attach_bpf(struct bpf_program *prog)
+{
+       struct bpf_link *link;
+
+       link = bpf_program__attach(prog);
+       if (IS_ERR(link)) {
+               fprintf(stderr, "failed to attach program!\n");
+               exit(1);
+       }
+}
+
+static void setup_base()
+{
+       setup_ctx();
+}
+
+static void setup_kprobe()
+{
+       setup_ctx();
+       attach_bpf(ctx.skel->progs.prog1);
+}
+
+static void setup_kretprobe()
+{
+       setup_ctx();
+       attach_bpf(ctx.skel->progs.prog2);
+}
+
+static void setup_rawtp()
+{
+       setup_ctx();
+       attach_bpf(ctx.skel->progs.prog3);
+}
+
+static void setup_fentry()
+{
+       setup_ctx();
+       attach_bpf(ctx.skel->progs.prog4);
+}
+
+static void setup_fexit()
+{
+       setup_ctx();
+       attach_bpf(ctx.skel->progs.prog5);
+}
+
+static void setup_fmodret()
+{
+       setup_ctx();
+       attach_bpf(ctx.skel->progs.prog6);
+}
+
+static void *consumer(void *input)
+{
+       return NULL;
+}
+
+const struct bench bench_rename_base = {
+       .name = "rename-base",
+       .validate = validate,
+       .setup = setup_base,
+       .producer_thread = producer,
+       .consumer_thread = consumer,
+       .measure = measure,
+       .report_progress = hits_drops_report_progress,
+       .report_final = hits_drops_report_final,
+};
+
+const struct bench bench_rename_kprobe = {
+       .name = "rename-kprobe",
+       .validate = validate,
+       .setup = setup_kprobe,
+       .producer_thread = producer,
+       .consumer_thread = consumer,
+       .measure = measure,
+       .report_progress = hits_drops_report_progress,
+       .report_final = hits_drops_report_final,
+};
+
+const struct bench bench_rename_kretprobe = {
+       .name = "rename-kretprobe",
+       .validate = validate,
+       .setup = setup_kretprobe,
+       .producer_thread = producer,
+       .consumer_thread = consumer,
+       .measure = measure,
+       .report_progress = hits_drops_report_progress,
+       .report_final = hits_drops_report_final,
+};
+
+const struct bench bench_rename_rawtp = {
+       .name = "rename-rawtp",
+       .validate = validate,
+       .setup = setup_rawtp,
+       .producer_thread = producer,
+       .consumer_thread = consumer,
+       .measure = measure,
+       .report_progress = hits_drops_report_progress,
+       .report_final = hits_drops_report_final,
+};
+
+const struct bench bench_rename_fentry = {
+       .name = "rename-fentry",
+       .validate = validate,
+       .setup = setup_fentry,
+       .producer_thread = producer,
+       .consumer_thread = consumer,
+       .measure = measure,
+       .report_progress = hits_drops_report_progress,
+       .report_final = hits_drops_report_final,
+};
+
+const struct bench bench_rename_fexit = {
+       .name = "rename-fexit",
+       .validate = validate,
+       .setup = setup_fexit,
+       .producer_thread = producer,
+       .consumer_thread = consumer,
+       .measure = measure,
+       .report_progress = hits_drops_report_progress,
+       .report_final = hits_drops_report_final,
+};
+
+const struct bench bench_rename_fmodret = {
+       .name = "rename-fmodret",
+       .validate = validate,
+       .setup = setup_fmodret,
+       .producer_thread = producer,
+       .consumer_thread = consumer,
+       .measure = measure,
+       .report_progress = hits_drops_report_progress,
+       .report_final = hits_drops_report_final,
+};
 
        const char *raw_tp_name = "raw_tp/task_rename";
        const char *fentry_name = "fentry/__set_task_comm";
        const char *fexit_name = "fexit/__set_task_comm";
+       const char *fmodret_name = "fmod_ret/__set_task_comm";
        const char *kprobe_func = "__set_task_comm";
        struct bpf_program *kprobe_prog, *kretprobe_prog, *raw_tp_prog;
-       struct bpf_program *fentry_prog, *fexit_prog;
+       struct bpf_program *fentry_prog, *fexit_prog, *fmodret_prog;
        struct bpf_object *obj;
        struct bpf_link *link;
        int err, duration = 0;
        if (CHECK(!fexit_prog, "find_probe",
                  "prog '%s' not found\n", fexit_name))
                goto cleanup;
+       fmodret_prog = bpf_object__find_program_by_title(obj, fmodret_name);
+       if (CHECK(!fmodret_prog, "find_probe",
+                 "prog '%s' not found\n", fmodret_name))
+               goto cleanup;
 
        err = bpf_object__load(obj);
        if (CHECK(err, "obj_load", "err %d\n", err))
                goto cleanup;
        test_run("fexit");
        bpf_link__destroy(link);
+
+       /* attach fmod_ret */
+       link = bpf_program__attach_trace(fmodret_prog);
+       if (CHECK(IS_ERR(link), "attach fmod_ret", "err %ld\n", PTR_ERR(link)))
+               goto cleanup;
+       test_run("fmod_ret");
+       bpf_link__destroy(link);
 cleanup:
        prctl(PR_SET_NAME, comm, 0L, 0L, 0L);
        bpf_object__close(obj);