// Copyright (C) 2019 Marko Myllynen <myllynen@redhat.com>
// Licensed under the Apache License, Version 2.0 (the "License")

#include <uapi/linux/ptrace.h>
#include <linux/sched.h>

DEFINE_DETAILS
DEFINE_LATENCY

struct kprobe_t {
    char kprobe[32];
};

struct details_t {
    char kprobe[32];
    u32 pid;
};

BPF_HASH(stats_ok, struct kprobe_t, u64, KPROBE_COUNT);
BPF_HASH(stats_fail, struct kprobe_t, u64, KPROBE_COUNT);
#ifdef LATENCY
BPF_HASH(latstats, struct details_t, u64, KPROBE_COUNT);
BPF_HASH(start, u64, u64);
#endif

#ifdef DETAILS
BPF_HASH(pidstats, struct details_t, u64, MAX_PIDS * KPROBE_COUNT);
#ifdef LATENCY
BPF_HASH(pidlatstats, struct details_t, u64, MAX_PIDS * KPROBE_COUNT);
#endif
#endif
