Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753844AbbDHNDJ (ORCPT ); Wed, 8 Apr 2015 09:03:09 -0400 Received: from mail.kernel.org ([198.145.29.136]:47225 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751877AbbDHNDG (ORCPT ); Wed, 8 Apr 2015 09:03:06 -0400 Date: Wed, 8 Apr 2015 10:03:08 -0300 From: Arnaldo Carvalho de Melo To: Yunlong Song Cc: a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com, linux-kernel@vger.kernel.org, wangnan0@huawei.com Subject: Re: [PATCH] perf record: Conditionally define CLOCK_MONOTONIC_RAW for older OSes Message-ID: <20150408130308.GA5403@kernel.org> References: <1428465748-14476-1-git-send-email-yunlong.song@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1428465748-14476-1-git-send-email-yunlong.song@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1662 Lines: 47 Em Wed, Apr 08, 2015 at 12:02:28PM +0800, Yunlong Song escreveu: > 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. Since I am fixing that pull request batch, I am folding this patch into Peter's original, adding credit to you, ok? - Arnaldo > Signed-off-by: Yunlong Song > --- > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/