Revision ed99d3673e082b78b20208f346d2cd375483a779 authored by Linus Torvalds on 28 October 2016, 18:47:45 UTC, committed by Linus Torvalds on 28 October 2016, 18:47:45 UTC
Pull libnvdimm fixes from Dan Williams:
 "A build fix, a NULL de-reference found by static analysis, a misuse of
  the percpu_ref_exit() (tagged for -stable), and notification of failed
  attempts to clear media errors.

  These patches have received a build success notification from the
  0day- kbuild-robot and appeared in next-20161028"

* 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  device-dax: fix percpu_ref_exit ordering
  nvdimm: make CONFIG_NVDIMM_DAX 'bool'
  pmem: report error on clear poison failure
  libnvdimm, namespace: potential NULL deref on allocation error
2 parent s b92d964 + 52e73eb
Raw File
tracex6_kern.c
#include <linux/ptrace.h>
#include <linux/version.h>
#include <uapi/linux/bpf.h>
#include "bpf_helpers.h"

struct bpf_map_def SEC("maps") my_map = {
	.type = BPF_MAP_TYPE_PERF_EVENT_ARRAY,
	.key_size = sizeof(int),
	.value_size = sizeof(u32),
	.max_entries = 32,
};

SEC("kprobe/sys_write")
int bpf_prog1(struct pt_regs *ctx)
{
	u64 count;
	u32 key = bpf_get_smp_processor_id();
	char fmt[] = "CPU-%d   %llu\n";

	count = bpf_perf_event_read(&my_map, key);
	bpf_trace_printk(fmt, sizeof(fmt), key, count);

	return 0;
}

char _license[] SEC("license") = "GPL";
u32 _version SEC("version") = LINUX_VERSION_CODE;
back to top