lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 8 Apr 2015 12:02:28 +0800
From:	Yunlong Song <yunlong.song@...wei.com>
To:	<a.p.zijlstra@...llo.nl>, <paulus@...ba.org>, <mingo@...hat.com>,
	<acme@...nel.org>
CC:	<linux-kernel@...r.kernel.org>, <wangnan0@...wei.com>
Subject: [PATCH] perf record: Conditionally define CLOCK_MONOTONIC_RAW for older OSes

Commit 31a9883106cc ("perf record: Add clockid parameter") used
CLOCK_MONOTONIC_RAW in the struct clockid_map clockids[], but the
CLOCK_MONOTONIC_RAW macro is not defined in older releases (e.g., SLES
11 SP2), thus there is a building error when making perf:

builtin-record.c:738: error: ‘CLOCK_MONOTONIC_RAW’ undeclared here (not in a function)
make[2]: *** [builtin-record.o] Error 1
make[2]: *** Waiting for unfinished jobs....
  LD       bench/perf-in.o
  LD       tests/perf-in.o
make[1]: *** [perf-in.o] Error 2
make: *** [all] Error 2

So define this macro if it is not defined.

Signed-off-by: Yunlong Song <yunlong.song@...wei.com>
---
 tools/perf/builtin-record.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index cfdff50..5b0962a 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -731,6 +731,9 @@ struct clockid_map {
 #ifndef CLOCK_TAI
 #define CLOCK_TAI 11
 #endif
+#ifndef CLOCK_MONOTONIC_RAW
+#define CLOCK_MONOTONIC_RAW 4
+#endif
 
 static const struct clockid_map clockids[] = {
 	/* available for all events, NMI safe */
-- 
1.8.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ