Summary: Processor speed

From: Shanmugav Shanmuganatha (shanmu@netscape.com)
Date: Wed Nov 20 2002 - 21:02:15 EST


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);
> }
> }
> }
>
>



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:00 EDT