Re: [PATCH] virtperf: Revert PERF_COUNT_HW_REF_CPU_CYCLES conditional

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Tue, 14 Mar 2017 14:05:37 +0100
schrieb Martin Kletzander <mkletzan@xxxxxxxxxx>:

> However without that commit we'll be back to broken code that won't compile on some distros.  So unless I missed something (if I did, it should be added to the commit message), there should rather be a configure check that defines something similar to other code, e.g. HAVE_PERF_CPU_CYCLES and then that should be used in the conditional.

There are other places in that and other files which can not be compiled. The obvious fix is to just add a #ifndef x;#define x 0 to get libvirt going. The question is still unanswered if configure should just error out and refuse to go further, or if the few missing pieces should be supplied manually because the affected functionality is optional.

See attached patches for how I deal with it.

Olaf
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -3623,6 +3623,9 @@ virFileBindMountDevice(const char *src,
     return 0;
 }
 
+#ifndef MS_MOVE
+#define MS_MOVE              8192
+#endif
 
 int
 virFileMoveMount(const char *src,
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -1156,6 +1156,13 @@ virProcessRunInMountNamespace(pid_t pid,
 
 
 #if defined(HAVE_SYS_MOUNT_H) && defined(HAVE_UNSHARE)
+#ifndef MS_REC
+# define MS_REC          16384
+#endif
+
+#ifndef MS_SLAVE
+# define MS_SLAVE                (1<<19)
+#endif
 int
 virProcessSetupPrivateMountNS(void)
 {
--- a/src/util/virperf.c
+++ b/src/util/virperf.c
@@ -76,6 +76,12 @@ struct virPerfEventAttr {
     unsigned long long attrConfig;
 };
 
+#ifndef PERF_ATTR_SIZE_VER2
+#define PERF_COUNT_HW_STALLED_CYCLES_FRONTEND   7
+#define PERF_COUNT_HW_STALLED_CYCLES_BACKEND    8
+#define PERF_COUNT_HW_REF_CPU_CYCLES            9
+#endif
+
 static struct virPerfEventAttr attrs[] = {
     {.type = VIR_PERF_EVENT_CMT, .attrType = 0, .attrConfig = 1},
     {.type = VIR_PERF_EVENT_MBMT, .attrType = 0, .attrConfig = 2},

Attachment: pgpRwwQbpEDK2.pgp
Description: Digitale Signatur von OpenPGP

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux