Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754042AbbDHMtW (ORCPT ); Wed, 8 Apr 2015 08:49:22 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:6396 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751364AbbDHMtQ (ORCPT ); Wed, 8 Apr 2015 08:49:16 -0400 Message-ID: <55252339.80807@huawei.com> Date: Wed, 8 Apr 2015 20:46:49 +0800 From: Yunlong Song User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Peter Zijlstra CC: , , , , Subject: Re: [PATCH] perf record: Conditionally define CLOCK_MONOTONIC_RAW for older OSes References: <1428465748-14476-1-git-send-email-yunlong.song@huawei.com> <20150408085519.GV23123@twins.programming.kicks-ass.net> In-Reply-To: <20150408085519.GV23123@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.111.74.205] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1584 Lines: 38 On 2015/4/8 16:55, Peter Zijlstra wrote: > On Wed, Apr 08, 2015 at 12:02:28PM +0800, Yunlong Song wrote: >> 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) > > Weird that, CLOCK_MONOTONIC_RAW is said to be in the kernel since > 2.6.28, SLES11 SP2 is 3.0 based, SP1 is 2.6.32. > > Now the original SLES11 started life with 2.6.27, so it looks like > someone forgot to update their kernel headers when upgrading. > > > > . > Hi, Peter, SLES 11 SP2 uses linux-kernel-headers-2.6.32-1.4.13, which really defines CLOCK_MONOTONIC_RAW in . But the perf.h which is included in builtin-record.c uses rather than , and finally includes . Both and belong to glibc-devel package, which is glibc-devel-2.11.3-17.31.1 for SLES11 SP2, and it does not define CLOCK_MONOTONIC_RAW indeed. However, for the latest OSes (or say distributions), the corresponding glibc-devel packages have already defined CLOCK_MONOTONIC_RAW. -- Thanks, Yunlong Song -- 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/