#include <stdio.h>
#include <unistd.h>
#include "hello.skel.h"

int main(void)
{
    struct hello_bpf *skel = hello_bpf__open_and_load();
    if (!skel)
        return 1;

    int err = hello_bpf__attach(skel);
    if (!err) {
        sleep(1);
        int ran = skel->bss->ran;
        puts(ran ? "sched_switch: BPF ran!" : "sched_switch: no event observed");
        err = !ran;
    }
    hello_bpf__destroy(skel);
    return err ? 1 : 0;
}
