Issue with AIX 5.3 and nlist/nlist64/knlist


 
Thread Tools Search this Thread
Operating Systems AIX Issue with AIX 5.3 and nlist/nlist64/knlist
# 1  
Old 03-03-2005
Issue with AIX 5.3 and nlist/nlist64/knlist

I have encountered a problem that I cannot resolve. We have two
different AIX 5.3 boxes. On one box, regardless of whether it is
booted in 32 bit mode or 64 bit mode, I can obtain kernel metrics (i.e,
using kernel symbol names sysinfo or avenrun) via the nlink or nlink64
system call. On the second machine, these calls fail. I have never
seen these calls fail before. The machines do have different patches
applied but nothing is obvious as to why the kernel symbol names would
not be present on the second machine. My understanding is that these
kernel symbol names should be there. Both machines are functioning
fine. Does anyone have an idea as to the cause of this problem?
Thanks in advance.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

AIX 7.1 gcc 4.8.5 issue

hey guys , after migrate our AIX server from 6.1 to 7.1 , we insalled c compilator with rpm files Server:root:/ > rpm -qa | grep gcc libgcc-4.8.5-1 gcc-cpp-4.8.5-1 gcc-4.8.5-1 gcc-c++-4.8.5-1 but whene we proceed to compile a c programm we have this error exec(): 0509-036... (17 Replies)
Discussion started by: yahia
17 Replies

2. Programming

Gcc 4.5.8 on AIX 7.1 issue

after migrate our AIX server from 6.1 to 7.1 , we insalled c compilator with rpm files Server:root:/ > rpm -qa | grep gcc libgcc-4.8.5-1 gcc-cpp-4.8.5-1 gcc-4.8.5-1 gcc-c++-4.8.5-1 but whene we proceed to compile a c programm we have this error exec(): 0509-036 Cannot load... (2 Replies)
Discussion started by: yahia
2 Replies

3. HP-UX

Ftp command nlist not supporting in sftp

Hi, We are using HP-UX. Previously we were using ftp to connect to remote list the text file name and copy into local file with .ls extension. For this we are using nlist RBOBAR*.txt DMSFT.ls now we want to convert the integration with sftp. So In sftp nlist command is not supported. How can we... (8 Replies)
Discussion started by: Pelins
8 Replies

4. AIX

GIT issue in AIX 6.1

Hello, I recently installed GIT 1.8.1 on my AIX 6.1 machine referring to AIX Open Source Packages | Main / git website and am facing a few issues with it. Now if I login as root and issue git commands like git --version I get the response as shown : git version 1.8.1And I have tried creating... (4 Replies)
Discussion started by: gaugeta
4 Replies

5. AIX

AIX FTP issue

Hi, I ftpd "binary" mode into a AIX server and transferred .tar.tar files. When i untar using "tar -xvf <filename>.tar.gz" It shows "tar: 0511-169 A directory checksum error on media; 0 not equal to 70568." Please Help!! (3 Replies)
Discussion started by: Priya Amaresh
3 Replies

6. AIX

AIX Networking Issue

Hello, I'm trying to set up an internet connection on an IBM RS/6000 7043-140 machine with AIX v 5.1. The problem is that no matter if it is setup to receive an IP address from another DHCP server or has a static IP set, it seems to act as a DHCP server that assigns a random IP address with a... (3 Replies)
Discussion started by: Xsystem
3 Replies

7. AIX

AIX password issue

Hi, My server is an AIX server. Whenever a new user is created through smitty, the first time he logs in, he has to change his password. But i want to disable it and to enable the password expiry to a month. (i.e) after every month, he has to change his password. Any help in this matter... (1 Reply)
Discussion started by: mac4rfree
1 Replies

8. AIX

Issue "Error 404" when upgrade AIX 5300-05-CSP-0000 to AIX (5300-09-02-0849)

Please read my issue! My old server using: - AIX system operating (5300-05-CSP-0000) - WebSphere 6.1.0.21 (Fix Pack 21) After I've upgraded version AIX - AIX system operating (5300-09-02-0849) - WebSphere 6.1.0.21 (Fix Pack 21) I have 1 issue when I access home page: "Error... (0 Replies)
Discussion started by: gamonhon
0 Replies

9. AIX

knlist API on AIX 5.3

Hi, I have written an application which reports the CPU information like user cpu%, sys cpu%, idle cpu% and wait cpu%. The application is built on an AIX 5.1 machine. The appliaction runs fine on AIX 5.1 and 5.2 and their results match with that of the topas command. But when I run the... (1 Reply)
Discussion started by: allthanksquery
1 Replies

10. AIX

Problem with knlist in AIX 5.3 for Power5 processor

Hi all, I have a AIX 5.3 Installation on the Power5 processor. I am using the knlist API for getting the details of the CPU details like user cpu, kernel cpu, idle cpu and wait cpu. My code is working fine on other Installations of AIX like PowerPC_POWER4 but it is giving wrong values on Power5... (0 Replies)
Discussion started by: rajesht
0 Replies
Login or Register to Ask a Question
knlist(3)						     Library Functions Manual							 knlist(3)

NAME
knlist - Look up symbols in the currently running kernel LIBRARY
Standard C Library (libc.a, libc.so) SYNOPSIS
#include <nlist.h> int knlist( struct nlist namelist); PARAMETERS
On input, lists the symbol names for which you are requesting addresses. The namelist must be terminated with a null name at end. Without a terminating null name at end, knlist() cannot determine how many symbols there are in the namelist and therefore it may dump core. On return, contains a list of symbol addresses (or 0 if the attempt to find the addresses was unsuccessful). DESCRIPTION
The knlist() library routine looks up addresses of kernel symbols in the currently running kernel. In addition to finding symbols associ- ated with the kernel image, knlist() will also find symbols defined in dynamically loaded subsystems. Communication with the knlist() routine occurs using an array of type struct nlist. The <nlist.h> header file declares that type as fol- lows: struct nlist{ char *n_name; unsigned long n_value; short n_type; /* 0 if not there, 1 if found */ short reserved; }; When your application calls knlist() it passes the names of symbols in the n_name field of the structure. For each symbol, the knlist() routine attempts to determine its current address in memory. If the routine can determine the address of the symbol, it returns that address in the n_value field, and it returns one(1) in the n_type field. If the routine cannot determine the address, it returns zero(0) in both the n_value field and the n_type field. For BSD compatibility, the knlist routine allows symbol names to be preceded by an underscore. If it does not find a symbol that matches the name as specified, knlist attempts to locate the symbol name with the leading underscore removed. EXAMPLES
The following example illustrates the use of the knlist() routine: #include <stdio.h> #include <string.h> #include <stdlib.h> #include <nlist.h> main () { struct nlist nl[3]; int retval, i; nl[0].n_name = (char *)malloc(10); nl[1].n_name = (char *)malloc(10); nl[2].n_name = ""; /*******************************************************/ /* Store names of kernel symbols in the nl array */ strcpy (nl[0].n_name, "ncpus"); strcpy (nl[1].n_name, "lockmode"); /*******************************************************/ /* Call the knlist routine */ retval = knlist(nl); /******************************************************/ /* Display addresses if returned. Otherwise, display */ /* the appropriate error message. */ if (retval < 0) printf ("No kernel symbol addresses returned. "); else if (retval >= 0 ) for (i=0; i<2; i++) if (nl[i].n_type == 0) printf ("Unable to return address of symbol %s ", nl[i].n_name); else printf ("The address of symbol %s is %lx ", nl[i].n_name, nl[i].n_value); free (nl[0].n_name); free (nl[1].n_name); } This example tests the return value from the knlist() routine. If the routine returns an error status, a message is displayed to the application user. Otherwise, the application checks the status of each kernel symbol. If the knlist() routine was unable to return an address, the application displays a message and the symbol name. If the knlist() routine returns an address, the application displays the symbol name and address to the application user. RETURN VALUES
The knlist() routine returns zero on success. The routine returns -1 if it was unable to connect to the kloadsrv daemon. In this case, the routine was unable to determine any of the requested addresses. The routine returns a positive integer if it successfully finds some addresses and fails to find others. The integer value indicates the number of addresses knlist() was unable to return. The routine returns the negative value of EINVAL if the argument is bad. RELATED INFORMATION
Routines: nlist(3) delim off knlist(3)