blob: 1e4bcd13e9a3f1d92b5994b5a907e1db47699408 [file] [log] [blame]
// Copyright (c) PLUMgrid, Inc.
// Licensed under the Apache License, Version 2.0 (the "License")
#include "kprobe.b"
struct Ptr { u64 ptr:64; };
struct Counters { u64 stat1:64; };
Table<Ptr, Counters, FIXED_MATCH, AUTO> stats(1024);
u32 count_sched (struct proto::pt_regs *ctx) {
struct Ptr key = {.ptr=ctx->bx};
atomic_add(stats[key].stat1, 1);
}