[profiler] Fix linux.
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 2 Jun 2017 16:24:39 +0000 (09:24 -0700)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 2 Jun 2017 16:24:39 +0000 (09:24 -0700)
mono/profiler/arg-parsing.c
mono/profiler/mono-profiler-log.c

index 8222a436babb83f0f12286c6be336d8ca6380465..ea0f89ae8d05cb57f70d9baeac519db91f3f6cc6 100644 (file)
@@ -6,6 +6,22 @@
 #include <unistd.h>
 #endif
 
+#ifdef HAVE_SCHED_GETAFFINITY
+#  ifndef GLIBC_HAS_CPU_COUNT
+static int
+CPU_COUNT(cpu_set_t *set)
+{
+       int i, count = 0;
+
+       for (int i = 0; i < CPU_SETSIZE; i++)
+               if (CPU_ISSET(i, set))
+                       count++;
+       return count;
+}
+#  endif
+#endif
+
+
 #include "mono-profiler-log.h"
 
 typedef struct {
index 4b22586526f76d38e96967d86fadfd6b9a529659..464c5e76f57a56474834df8ea470af730809c9aa 100644 (file)
 #include <zlib.h>
 #endif
 
-#ifdef HAVE_SCHED_GETAFFINITY
-#  ifndef GLIBC_HAS_CPU_COUNT
-static int
-CPU_COUNT(cpu_set_t *set)
-{
-       int i, count = 0;
-
-       for (int i = 0; i < CPU_SETSIZE; i++)
-               if (CPU_ISSET(i, set))
-                       count++;
-       return count;
-}
-#  endif
-#endif
-
 #define BUFFER_SIZE (4096 * 16)
 
 /* Worst-case size in bytes of a 64-bit value encoded with LEB128. */