From: Yunlong Song <yunlong.song@huawei.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: <paulus@samba.org>, <mingo@redhat.com>, <acme@kernel.org>,
<linux-kernel@vger.kernel.org>, <wangnan0@huawei.com>
Subject: Re: [PATCH] perf record: Conditionally define CLOCK_MONOTONIC_RAW for older OSes
Date: Wed, 8 Apr 2015 20:46:49 +0800 [thread overview]
Message-ID: <55252339.80807@huawei.com> (raw)
In-Reply-To: <20150408085519.GV23123@twins.programming.kicks-ass.net>
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 <linux/time.h>. But the perf.h which is included in builtin-record.c uses <time.h> rather
than <linux/time.h>, and <time.h> finally includes <bits/time.h>. Both <time.h> and <bits/time.h>
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
next prev parent reply other threads:[~2015-04-08 12:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 4:02 [PATCH] perf record: Conditionally define CLOCK_MONOTONIC_RAW for older OSes Yunlong Song
2015-04-08 8:55 ` Peter Zijlstra
2015-04-08 12:46 ` Yunlong Song [this message]
2015-04-08 13:03 ` Arnaldo Carvalho de Melo
2015-04-08 13:10 ` Yunlong Song
2015-04-08 13:33 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55252339.80807@huawei.com \
--to=yunlong.song@huawei.com \
--cc=acme@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.