- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- GetKernelSymbol()
Operating System - HP-UX
1748289
Members
3057
Online
108761
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-01-2009 07:47 PM
тАО04-01-2009 07:47 PM
GetKernelSymbol()
Hi all,
I've found a script to get information about HP-UX as written below.
My question is:
Since the below script uses a method called GetKernelSymbol(), could someone please in this forum give some explanation what it actually does?
Thank you, guys!
#!/bin/ksh
#
# Taken from the HP/UniGraphics FAQ
# You must be ROOT to execute this since it uses adb to
# examine the running kernel
#
GetKernelSymbol()
{
echo "$1/D" | \
sudo adb -k $hpux /dev/kmem | \
tr "\012" " " | \
read junk junk2 kval
}
hpux=/hp-ux
rev=$(uname -r | cut -d. -f2)
if ((rev > 9)); then hpux=/stand/vmunix ;fi
/bin/uname -a
GetKernelSymbol "processor_count"
print CPU Count: $kval
GetKernelSymbol "itick_per_tick"
let speed=kval/10000
print CPU Speed: $speed MHz
if ((rev > 10)); then
print CPU HW Support: `getconf HW_CPU_SUPP_BITS`-bit
print Kernel Support: `getconf KERNEL_BITS`-bit
GetKernelSymbol "memory_installed_in_machine"
else
GetKernelSymbol "physmem"
fi
let mb=kval*4/1024 # convert pages to MB
print RAM Size: $mb MB
I've found a script to get information about HP-UX as written below.
My question is:
Since the below script uses a method called GetKernelSymbol(), could someone please in this forum give some explanation what it actually does?
Thank you, guys!
#!/bin/ksh
#
# Taken from the HP/UniGraphics FAQ
# You must be ROOT to execute this since it uses adb to
# examine the running kernel
#
GetKernelSymbol()
{
echo "$1/D" | \
sudo adb -k $hpux /dev/kmem | \
tr "\012" " " | \
read junk junk2 kval
}
hpux=/hp-ux
rev=$(uname -r | cut -d. -f2)
if ((rev > 9)); then hpux=/stand/vmunix ;fi
/bin/uname -a
GetKernelSymbol "processor_count"
print CPU Count: $kval
GetKernelSymbol "itick_per_tick"
let speed=kval/10000
print CPU Speed: $speed MHz
if ((rev > 10)); then
print CPU HW Support: `getconf HW_CPU_SUPP_BITS`-bit
print Kernel Support: `getconf KERNEL_BITS`-bit
GetKernelSymbol "memory_installed_in_machine"
else
GetKernelSymbol "physmem"
fi
let mb=kval*4/1024 # convert pages to MB
print RAM Size: $mb MB
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-01-2009 08:55 PM
тАО04-01-2009 08:55 PM
Re: GetKernelSymbol()
>could someone please in this forum give some explanation what it actually does?
The function should be trivial to understand.
It basically invokes adb to print the value (in decimal) of specific kernel variables.
The result is assigned to kval.
The function should be trivial to understand.
It basically invokes adb to print the value (in decimal) of specific kernel variables.
The result is assigned to kval.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 01:28 AM
тАО04-02-2009 01:28 AM
Re: GetKernelSymbol()
adb is a assembly debugger
echo "physmem/D" | adb -k /stand/vmunix /dev/kmem
display the value in decimal of the kernel symbol "physmem", taken from the kernel memory.
since 11.23 physmem doesn't exist anymore, so we get memory_installed_in_machine
itick_per_tick is the number of cpu cycles per 10ms
it is advised to use pstat_getstatic() in place of that type of tricks.
echo "physmem/D" | adb -k /stand/vmunix /dev/kmem
display the value in decimal of the kernel symbol "physmem", taken from the kernel memory.
since 11.23 physmem doesn't exist anymore, so we get memory_installed_in_machine
itick_per_tick is the number of cpu cycles per 10ms
it is advised to use pstat_getstatic() in place of that type of tricks.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP