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