• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) PLUMgrid, Inc.
2// Licensed under the Apache License, Version 2.0 (the "License")
3#include "kprobe.b"
4struct Ptr { u64 ptr:64; };
5struct Counters { u64 stat1:64; };
6Table<Ptr, Counters, FIXED_MATCH, AUTO> stats(1024);
7
8u32 count_sched (struct proto::pt_regs *ctx) {
9  struct Ptr key = {.ptr=ctx->bx};
10  atomic_add(stats[key].stat1, 1);
11}
12