#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:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-06-08 14:19:10 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-06-10 17:11:18 +0200
commit05c960e79dbcd751bbcae148a01121dddf997465 (patch)
tree814baa3f602b562e004cedc544e1754c90e4ed49
parent2bd6cc8c798c042610dc9341dac2e21a07704bb2 (diff)
drm/rockchip: Disarm vop->is_enabled
With atomic helpers there's no need to track the enabled state of a pipe any more, because atomic helpers track this accurately already. Just disable the early returns, since the debug checks might be useful. v2: Don't call drm_helper_disable_unused_functions, it blows up without this check. At least explains why rockchip still needed this old legacy-style state tracing - to work around issues from calling other legacy style functions! Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Cc: Mark yao <mark.yao@rock-chips.com> Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-18-git-send-email-daniel.vetter@ffwll.ch