/* Copyright 2016 Netflix, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. */ #include #include #include #include #include "bpf_helpers.h" #define MAX_IPS 8192 struct bpf_map_def SEC("maps") ip_map = { .type = BPF_MAP_TYPE_HASH, .key_size = sizeof(u64), .value_size = sizeof(u32), .max_entries = MAX_IPS, }; SEC("perf_event") int do_sample(struct bpf_perf_event_data *ctx) { u64 ip; u32 *value, init_val = 1; ip = PT_REGS_IP(&ctx->regs); value = bpf_map_lookup_elem(&ip_map, &ip); if (value) *value += 1; else /* E2BIG not tested for this example only */ bpf_map_update_elem(&ip_map, &ip, &init_val, BPF_NOEXIST); return 0; } char _license[] SEC("license") = "GPL"; ='get'> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-10 09:47:13 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-10 09:47:13 -0800
commit045169816b31b10faed984b01c390db1b32ee4c1 (patch)
treeecb1d0c763f3d8cb0af749717b66ac47e6981d33 /drivers/usb/renesas_usbhs
parentcd6628953e4216b65e7d91ab70ff8e5b65c9fde9 (diff)
parent678b5c6b22fed89a13d5b2267f423069a9b11c80 (diff)
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This fixes the following issues: - Fix pointer size when caam is used with AArch64 boot loader on AArch32 kernel. - Fix ahash state corruption in marvell driver. - Fix buggy algif_aed tag handling. - Prevent mcryptd from being used with incompatible algorithms which can cause crashes" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: algif_aead - fix uninitialized variable warning crypto: mcryptd - Check mcryptd algorithm compatibility crypto: algif_aead - fix AEAD tag memory handling crypto: caam - fix pointer size for AArch64 boot loader, AArch32 kernel crypto: marvell - Don't corrupt state of an STD req for re-stepped ahash crypto: marvell - Don't copy hash operation twice into the SRAM
Diffstat (limited to 'drivers/usb/renesas_usbhs')