tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: shanmu@netscape.com (Shanmugav Shanmuganatha)
Subject: Summary: Processor speed
Date: Wed, 20 Nov 2002 18:02:15 -0800	[thread overview]
Message-ID: <3DDC3EA7.4050902@netscape.com> (raw)
In-Reply-To: <3DDAFA17.1080704@netscape.com>

Thanks to Dr. Thomas Blinn who pointed out that I was trying to use  a
System V Compatibility function and hence the error

Unresolved:
__sve_p_online

This is a  ruotine which I am going to implement in a larger module,
so "psrinfo -v" will not  meet my  needs. However getsysinfo() will
get me exactly  what I need.

Thanks again to those who replied.

Shanmuganathan.
 
Shanmugav Shanmuganatha wrote:

> Hi,
>     I wrote a small C program  to get the processor speed of a
> multi-processor system. When I compiled the program I am
> getting the following error.
> cc -o proc proc_speed.c
> ld:
> Unresolved:
> __sve_p_online
> __sve_processor_info
>
> I tried compiling the program with -D__SVE__, but that generated
> other errors.
>  Any clues to make the compilation succesfull will be greatly
> appreciated.
>
> Thanks,
> Shanmuganathan.
>
> #include <stdio.h>
> #include <sys/processor.h>
> #include <string.h>
> #include <unistd.h>
> #include <limits.h>
> #include <errno.h>
>
> #define MAX_PROCESSORS  8       /* Info collected on this many 
> processors max */
>
> main()
> {
>
>         int processors[MAX_PROCESSORS];
>         int count = 0;
>         int i = 0;
>
>     int nConfigured = sysconf(_SC_NPROCESSORS_CONF);
>     for (i = 0; i < nConfigured; i++) {
>         int status = p_online(i, P_STATUS);
>
>         if (status == -1 && errno == EINVAL)
>             continue;
>
>         if (status == P_ONLINE && count < MAX_PROCESSORS) {
>             proc_info_t info;
>             processor_info(i, &info);
>                         processors[count++] = info.pi_clock;
>         printf("Proc speed %d\n",info.pi_clock);
>         }
>     }
> }
>
>




  reply	other threads:[~2002-11-21  2:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20  2:57 Processor speed Shanmugav Shanmuganatha
2002-11-21  2:02 ` Shanmugav Shanmuganatha [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-07-06 15:24 Summary: processor speed Evans, William
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox