You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
354 B

// 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);
}