From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: shanmu@netscape.com (Shanmugav Shanmuganatha) Newsgroups: gmane.os.tru64.managers Subject: Summary: Processor speed Date: Wed, 20 Nov 2002 18:02:15 -0800 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <3DDC3EA7.4050902@netscape.com> References: <3DDAFA17.1080704@netscape.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1037845265 7556 80.91.224.249 (21 Nov 2002 02:21:05 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 21 Nov 2002 02:21:05 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 18Egxj-0001xc-00 for ; Thu, 21 Nov 2002 03:21:03 +0100 Original-Received: (qmail 3840 invoked by uid 5); 21 Nov 2002 02:02:56 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 3831 invoked by uid 49493); 21 Nov 2002 02:02:55 -0000 Original-Received: from shanmu@netscape.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.51. spamassassin: 2.50-cvs. Clear:SA:0(-9.3/5.0):. Processed in 0.393567 secs); 21 Nov 2002 02:02:55 -0000 Original-Received: from unknown (HELO emroute2.cind.ornl.gov) (128.219.159.41) by 0 with SMTP; 21 Nov 2002 02:02:55 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H5W00AINLOQN9@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 20 Nov 2002 21:02:55 -0500 (EST) Original-Received: from netscape.com (c3po.aoltw.net [64.236.137.25]) by emroute2.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H5W00F4NLO45D@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 20 Nov 2002 21:02:39 -0500 (EST) Original-Received: from judge.mcom.com (judge.nscp.aoltw.net [10.169.8.47]) by netscape.com (8.10.0/8.10.0) with ESMTP id gAL22MD24074 for ; Wed, 20 Nov 2002 18:02:22 -0800 (PST) Original-Received: from netscape.com ([10.169.99.161]) by judge.mcom.com (Netscape Messaging Server 4.15) with ESMTP id H5WLNY02.DKT for ; Wed, 20 Nov 2002 18:02:22 -0800 In-reply-to: <3DDAFA17.1080704@netscape.com> Original-To: tru64-unix-managers@ornl.gov X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:1.2b) Gecko/20021023 Xref: main.gmane.org gmane.os.tru64.managers:2522 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:2522 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 > #include > #include > #include > #include > #include > > #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); > } > } > } > >