nh2 / nh2/haskell-cpu-instruction-counter

Investigate whether and when perf_event_open() is process-wide or thread-wide

Đang mở
#7 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement good first issue help wanted
Ngôn ngữ chính
Haskell
Star
83
Fork
5
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

From the [man page](http://man7.org/linux/man-pages/man2/perf_event_open.2.html):

```
The pid and cpu arguments allow specifying which process and CPU to
monitor:

pid == 0 and cpu == -1
This measures the calling process/thread on any CPU.
```

So what now, is it the calling process or thread? How do I control that?

Quite likely, if I run `perf_event_open()` from a forked pthread, it's going to count only for that pthread. But what if I run it from the process's (only) main thread, and afterwards create a new pthread? Does the perf FD then record the events only for the main thread, or the whole process?

That would be important to know, so that we don't accidentally give wrong numbers when running in the threaded runtime.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.