linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 2.4.24 asm/timex.h
@ 2004-01-06 23:29 Pawel Kot
  2004-01-07  9:39 ` Eyal Lebedinsky
  0 siblings, 1 reply; 3+ messages in thread
From: Pawel Kot @ 2004-01-06 23:29 UTC (permalink / raw)
  To: Eyal Lebedinsky; +Cc: linux-kernel, valgrind-developers

On Wed, 7 Jan 2004, Eyal Lebedinsky wrote:

> Building valgrind, it includes <linux/timex.h> and then tries
> to use the adjtimex syscall. This ends up with an undefined
> error for 'cpu_has_tsc'. This did not happen with earlier
> kernels.
>
> In file included from /usr/include/linux/timex.h:152,
>                  from vg_unsafe.h:66,
>                  from vg_syscalls.c:35:
> /usr/include/asm/timex.h: In function `get_cycles':
> /usr/include/asm/timex.h:44: `cpu_has_tsc' undeclared (first use in this
> function)

cpu_has_tsc is defined in cpufeature.h, so probably adding:
#include <asm/cpufeature.h>
to the include/asm-i386/timex.h would help.

I don't have 2.4.25-pre handy, so I can't test it (nor send the patch) at
the moment.

pkot
PS. Sorry for the duplicate, forgot to cc the lists.
-- 
mailto:pkot@linuxnews.pl :: mailto:pkot@slackware.pl
http://kt.linuxnews.pl/ :: Kernel Traffic po polsku







^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 2.4.24 asm/timex.h
  2004-01-06 23:29 2.4.24 asm/timex.h Pawel Kot
@ 2004-01-07  9:39 ` Eyal Lebedinsky
  0 siblings, 0 replies; 3+ messages in thread
From: Eyal Lebedinsky @ 2004-01-07  9:39 UTC (permalink / raw)
  To: Pawel Kot; +Cc: linux-kernel

Pawel Kot wrote:
> 
> On Wed, 7 Jan 2004, Eyal Lebedinsky wrote:
> 
> > Building valgrind, it includes <linux/timex.h> and then tries
> > to use the adjtimex syscall. This ends up with an undefined
> > error for 'cpu_has_tsc'. This did not happen with earlier
> > kernels.
> >
> > In file included from /usr/include/linux/timex.h:152,
> >                  from vg_unsafe.h:66,
> >                  from vg_syscalls.c:35:
> > /usr/include/asm/timex.h: In function `get_cycles':
> > /usr/include/asm/timex.h:44: `cpu_has_tsc' undeclared (first use in this
> > function)
> 
> cpu_has_tsc is defined in cpufeature.h, so probably adding:
> #include <asm/cpufeature.h>
> to the include/asm-i386/timex.h would help.

Not really, I already tried a few such fixes.

gcc -DHAVE_CONFIG_H -I. -I. -I..  -I./demangle -I../include -I./x86
-DVG_LIBDIR="\"/usr/local/lib/valgrind"\"   -Winline -Wall -Wshadow -O
-fno-omit-frame-pointer -mpreferred-stack-boundary=2 -g -DELFSZ=32  -c
`test -f vg_syscalls.c || echo './'`vg_syscalls.c
In file included from /usr/include/linux/timex.h:152,
                 from vg_unsafe.h:68,
                 from vg_syscalls.c:35:
/usr/include/asm/timex.h: In function `get_cycles':
/usr/include/asm/timex.h:44: warning: implicit declaration of function
`test_bit'
/usr/include/asm/timex.h:44: `boot_cpu_data' undeclared (first use in
this function)
/usr/include/asm/timex.h:44: (Each undeclared identifier is reported
only once
/usr/include/asm/timex.h:44: for each function it appears in.)
make[4]: *** [vg_syscalls.o] Error 1
make[4]: Leaving directory `/data2/download/valgrind/valgrind/coregrind'

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 2.4.24 asm/timex.h
@ 2004-01-06 22:49 Eyal Lebedinsky
  0 siblings, 0 replies; 3+ messages in thread
From: Eyal Lebedinsky @ 2004-01-06 22:49 UTC (permalink / raw)
  To: list linux-kernel, valgrind-developers list

This is part of the current patch:

--- linux-2.4.24/include/asm-i386/timex.h       2002-11-28
23:53:15.000000000 +0000
+++ linux-2.4.25-pre4/include/asm-i386/timex.h  2004-01-06
12:43:33.000000000 +0000
@@ -40,14 +40,10 @@
 
 static inline cycles_t get_cycles (void)
 {
-#ifndef CONFIG_X86_TSC
-       return 0;
-#else
-       unsigned long long ret;
-
-       rdtscll(ret);
+       unsigned long long ret = 0;
+       if(cpu_has_tsc)
+               rdtscll(ret);
        return ret;
-#endif
 }
 
 extern unsigned long cpu_khz;

Building valgrind, it includes <linux/timex.h> and then tries
to use the adjtimex syscall. This ends up with an undefined
error for 'cpu_has_tsc'. This did not happen with earlier
kernels.

In file included from /usr/include/linux/timex.h:152,
                 from vg_unsafe.h:66,
                 from vg_syscalls.c:35:
/usr/include/asm/timex.h: In function `get_cycles':
/usr/include/asm/timex.h:44: `cpu_has_tsc' undeclared (first use in this
function)


Is this a problem with 2.4-pre or is valgrind inappropriately
messing with kernel headers?

For the moment I hacked it badly in coregrind/vg_unsafe.h:
	#define cpu_has_tsc 1
	#include <linux/timex.h>

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-01-07  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-06 23:29 2.4.24 asm/timex.h Pawel Kot
2004-01-07  9:39 ` Eyal Lebedinsky
  -- strict thread matches above, loose matches on Subject: below --
2004-01-06 22:49 Eyal Lebedinsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).