tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: shanmu@netscape.com (Shanmugav Shanmuganatha)
Subject: Processor speed
Date: Tue, 19 Nov 2002 18:57:27 -0800	[thread overview]
Message-ID: <3DDAFA17.1080704@netscape.com> (raw)

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-20  2:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20  2:57 Shanmugav Shanmuganatha [this message]
2002-11-21  2:02 ` Summary: Processor speed Shanmugav Shanmuganatha
  -- strict thread matches above, loose matches on Subject: below --
2000-07-06 14:55 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