cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

test_perf_link.c (311B)


      1// SPDX-License-Identifier: GPL-2.0
      2/* Copyright (c) 2021 Facebook */
      3#include "vmlinux.h"
      4#include <bpf/bpf_helpers.h>
      5#include <bpf/bpf_tracing.h>
      6
      7int run_cnt = 0;
      8
      9SEC("perf_event")
     10int handler(struct pt_regs *ctx)
     11{
     12	__sync_fetch_and_add(&run_cnt, 1);
     13	return 0;
     14}
     15
     16char _license[] SEC("license") = "GPL";