• Home
  • Raw
  • Download

Lines Matching refs:cpu_buf

9974 				      struct perf_cpu_buf *cpu_buf)  in perf_buffer__free_cpu_buf()  argument
9976 if (!cpu_buf) in perf_buffer__free_cpu_buf()
9978 if (cpu_buf->base && in perf_buffer__free_cpu_buf()
9979 munmap(cpu_buf->base, pb->mmap_size + pb->page_size)) in perf_buffer__free_cpu_buf()
9980 pr_warn("failed to munmap cpu_buf #%d\n", cpu_buf->cpu); in perf_buffer__free_cpu_buf()
9981 if (cpu_buf->fd >= 0) { in perf_buffer__free_cpu_buf()
9982 ioctl(cpu_buf->fd, PERF_EVENT_IOC_DISABLE, 0); in perf_buffer__free_cpu_buf()
9983 close(cpu_buf->fd); in perf_buffer__free_cpu_buf()
9985 free(cpu_buf->buf); in perf_buffer__free_cpu_buf()
9986 free(cpu_buf); in perf_buffer__free_cpu_buf()
9997 struct perf_cpu_buf *cpu_buf = pb->cpu_bufs[i]; in perf_buffer__free() local
9999 if (!cpu_buf) in perf_buffer__free()
10002 bpf_map_delete_elem(pb->map_fd, &cpu_buf->map_key); in perf_buffer__free()
10003 perf_buffer__free_cpu_buf(pb, cpu_buf); in perf_buffer__free()
10017 struct perf_cpu_buf *cpu_buf; in perf_buffer__open_cpu_buf() local
10021 cpu_buf = calloc(1, sizeof(*cpu_buf)); in perf_buffer__open_cpu_buf()
10022 if (!cpu_buf) in perf_buffer__open_cpu_buf()
10025 cpu_buf->pb = pb; in perf_buffer__open_cpu_buf()
10026 cpu_buf->cpu = cpu; in perf_buffer__open_cpu_buf()
10027 cpu_buf->map_key = map_key; in perf_buffer__open_cpu_buf()
10029 cpu_buf->fd = syscall(__NR_perf_event_open, attr, -1 /* pid */, cpu, in perf_buffer__open_cpu_buf()
10031 if (cpu_buf->fd < 0) { in perf_buffer__open_cpu_buf()
10038 cpu_buf->base = mmap(NULL, pb->mmap_size + pb->page_size, in perf_buffer__open_cpu_buf()
10040 cpu_buf->fd, 0); in perf_buffer__open_cpu_buf()
10041 if (cpu_buf->base == MAP_FAILED) { in perf_buffer__open_cpu_buf()
10042 cpu_buf->base = NULL; in perf_buffer__open_cpu_buf()
10049 if (ioctl(cpu_buf->fd, PERF_EVENT_IOC_ENABLE, 0) < 0) { in perf_buffer__open_cpu_buf()
10056 return cpu_buf; in perf_buffer__open_cpu_buf()
10059 perf_buffer__free_cpu_buf(pb, cpu_buf); in perf_buffer__open_cpu_buf()
10196 struct perf_cpu_buf *cpu_buf; in __perf_buffer__new() local
10208 cpu_buf = perf_buffer__open_cpu_buf(pb, p->attr, cpu, map_key); in __perf_buffer__new()
10209 if (IS_ERR(cpu_buf)) { in __perf_buffer__new()
10210 err = PTR_ERR(cpu_buf); in __perf_buffer__new()
10214 pb->cpu_bufs[j] = cpu_buf; in __perf_buffer__new()
10217 &cpu_buf->fd, 0); in __perf_buffer__new()
10221 cpu, map_key, cpu_buf->fd, in __perf_buffer__new()
10227 pb->events[j].data.ptr = cpu_buf; in __perf_buffer__new()
10228 if (epoll_ctl(pb->epoll_fd, EPOLL_CTL_ADD, cpu_buf->fd, in __perf_buffer__new()
10232 cpu, cpu_buf->fd, in __perf_buffer__new()
10266 struct perf_cpu_buf *cpu_buf = ctx; in perf_buffer__process_record() local
10267 struct perf_buffer *pb = cpu_buf->pb; in perf_buffer__process_record()
10272 return pb->event_cb(pb->ctx, cpu_buf->cpu, e); in perf_buffer__process_record()
10279 pb->sample_cb(pb->ctx, cpu_buf->cpu, s->data, s->size); in perf_buffer__process_record()
10286 pb->lost_cb(pb->ctx, cpu_buf->cpu, s->lost); in perf_buffer__process_record()
10297 struct perf_cpu_buf *cpu_buf) in perf_buffer__process_records() argument
10301 ret = bpf_perf_event_read_simple(cpu_buf->base, pb->mmap_size, in perf_buffer__process_records()
10302 pb->page_size, &cpu_buf->buf, in perf_buffer__process_records()
10303 &cpu_buf->buf_size, in perf_buffer__process_records()
10304 perf_buffer__process_record, cpu_buf); in perf_buffer__process_records()
10321 struct perf_cpu_buf *cpu_buf = pb->events[i].data.ptr; in perf_buffer__poll() local
10323 err = perf_buffer__process_records(pb, cpu_buf); in perf_buffer__poll()
10347 struct perf_cpu_buf *cpu_buf; in perf_buffer__buffer_fd() local
10352 cpu_buf = pb->cpu_bufs[buf_idx]; in perf_buffer__buffer_fd()
10353 if (!cpu_buf) in perf_buffer__buffer_fd()
10356 return cpu_buf->fd; in perf_buffer__buffer_fd()
10369 struct perf_cpu_buf *cpu_buf; in perf_buffer__consume_buffer() local
10374 cpu_buf = pb->cpu_bufs[buf_idx]; in perf_buffer__consume_buffer()
10375 if (!cpu_buf) in perf_buffer__consume_buffer()
10378 return perf_buffer__process_records(pb, cpu_buf); in perf_buffer__consume_buffer()
10386 struct perf_cpu_buf *cpu_buf = pb->cpu_bufs[i]; in perf_buffer__consume() local
10388 if (!cpu_buf) in perf_buffer__consume()
10391 err = perf_buffer__process_records(pb, cpu_buf); in perf_buffer__consume()