Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

FreeBSD: implements cpu availability command line. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

devnexen
Copy link

No description provided.

@devnexen
Copy link
Author

Getting this
Measuring per-core preemption rate (this will take 1.00 sec)... Core #1: CAUTION (156%) Core #0: CAUTION (238%) Core #3: CAUTION (176%) Core #2: CAUTION (229%)

As I am doing parallel compilation here, it is pretty faithful.

afl-gotcpu.c Outdated
@@ -149,8 +155,13 @@ int main(int argc, char** argv) {
CPU_ZERO(&c);
CPU_SET(i, &c);

#if defined(__linux__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better rewrite this into:

#if defined(__FreeBSD__)
      if (pthread_setaffinity_np(pthread_self(), sizeof(c), &c))
        PFATAL("pthread_setaffinity_np failed");
#else
      if (sched_setaffinity(0, sizeof(c), &c))
        PFATAL("sched_setaffinity failed");
#endif

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants