#include #include #include #include #include #include #include #include #include #include #include "libbpf.h" #include "bpf_load.h" #include "perf-sys.h" #define SAMPLE_PERIOD 0x7fffffffffffffffULL static void test_bpf_perf_event(void) { int nr_cpus = sysconf(_SC_NPROCESSORS_CONF); int *pmu_fd = malloc(nr_cpus * sizeof(int)); int status, i; struct perf_event_attr attr_insn_pmu = { .freq = 0, .sample_period = SAMPLE_PERIOD, .inherit = 0, .type = PERF_TYPE_HARDWARE, .read_format = 0, .sample_type = 0, .config = 0,/* PMU: cycles */ }; for (i = 0; i < nr_cpus; i++) { pmu_fd[i] = sys_perf_event_open(&attr_insn_pmu, -1/*pid*/, i/*cpu*/, -1/*group_fd*/, 0); if (pmu_fd[i] < 0) { printf("event syscall failed\n"); goto exit; } bpf_map_update_elem(map_fd[0], &i, &pmu_fd[i], BPF_ANY); ioctl(pmu_fd[i], PERF_EVENT_IOC_ENABLE, 0); } status = system("ls > /dev/null"); if (status) goto exit; status = system("sleep 2"); if (status) goto exit; exit: for (i = 0; i < nr_cpus; i++) close(pmu_fd[i]); close(map_fd[0]); free(pmu_fd); } int main(int argc, char **argv) { char filename[256]; snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]); if (load_bpf_file(filename)) { printf("%s", bpf_log_buf); return 1; } test_bpf_perf_event(); read_trace_pipe(); return 0; } ass='tabs'> summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2016-10-21 15:48:41 -0700
committerJiri Kosina <jkosina@suse.cz>2016-11-05 15:57:38 +0100
commit021afd55e2191248b471b29b9d0a96c267939a4d (patch)
tree32d7dbbc6c7d2aaf4316e2dc7d9c5e8d49cf2ef6
parent2a1e3b932c5606e2b3671b82eb63929937eb1e0b (diff)
HID: intel-ish-hid: request_irq failure
On some platforms ISH interrupt is shared, which causes request_irq to fail. This requires IRQF_SHARED irq flag. But IRQF_NO_SUSPEND and IRQF_SHARED should not be used together, so removed IRQF_NO_SUSPEND flag. Anyway this driver doesn't require IRQF_NO_SUSPEND, as this interrupt is not required during "noirq" phases of suspending and resuming devices as well as during the time when nonboot CPUs are taken offline and brought back online. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>