- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to get current process in hpux11 dlkm
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
07-07-2009 12:20 AM
07-07-2009 12:20 AM
in my kernel module i want to get the current process ,such as linux's macro "current"
how to get current process in hpux11 dlkm?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2009 12:52 AM
07-07-2009 12:52 AM
Re: how to get current process in hpux11 dlkm
You want to supply more info on what you are trying to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2009 03:30 AM
07-07-2009 03:30 AM
Re: how to get current process in hpux11 dlkm
thread id:
kt_tid(u.u_kthreadp);
process id
p_pid(u.uprocp);
don't forget to include sys/user.h
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2009 06:44 AM
07-07-2009 06:44 AM
Re: how to get current process in hpux11 dlkm
how to traversing all struct proc and struct kthread descriptors in kernel ?
kt_tid is ok ,but when i used p_pid(u.uprocp);
have compile error :
cc: "test.c", line 187: error 1588: "uprocp" undefined
where is the variabe u defined?
bash-4.0# uname -a
HP-UX rp5470 B.11.11 U 9000/800 142444635 unlimited-user license
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2009 06:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2009 06:51 AM
07-07-2009 06:51 AM
Re: how to get current process in hpux11 dlkm
/usr/include/machine/sys/user.h I believe.
it is a struct user defined in
/usr/include/sys/user.h
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2009 06:05 PM
07-07-2009 06:05 PM
Re: how to get current process in hpux11 dlkm
p_pid(u.uprocp);
I can't find these two functions in the
HP-UX 11i v1 Driver Development Guide and
HP-UX 11i v1 Driver Development Reference Guide
which Documentation has mentioned p_pid() and
kt_tid() function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2009 10:39 PM
07-07-2009 10:39 PM
Re: how to get current process in hpux11 dlkm
Else I don't know. may be in 11i v2 dd ref guide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2009 01:03 AM
07-08-2009 01:03 AM
Re: how to get current process in hpux11 dlkm
a kill calls logger?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2009 06:02 PM
07-08-2009 06:02 PM
Re: how to get current process in hpux11 dlkm
but i can not find suitable kernel API function to do it.
in HP-UX 11i v1 Driver Development Guide and
HP-UX 11i v1 Driver Development Reference Guide
i can not find related information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2009 10:24 PM
07-08-2009 10:24 PM
Re: how to get current process in hpux11 dlkm
else in the kernel:
proc_pstat_idx_lookup_hold
proc_pstat_lookup_next_hold
- don(t forget to call proc_release()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2009 10:27 PM
07-08-2009 10:27 PM
Re: how to get current process in hpux11 dlkm
kt=p_firstthreadp(p)
then you can use kt_nextp(kt)
Then release the hold.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2009 10:29 PM
07-08-2009 10:29 PM
Re: how to get current process in hpux11 dlkm
2 process walk.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2009 07:04 PM
07-13-2009 07:04 PM
Re: how to get current process in hpux11 dlkm
what's the name of proc_list's lock?
how to use proc_list's lock ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 12:15 PM
07-14-2009 12:15 PM
Re: how to get current process in hpux11 dlkm
proc_pstat_lookup_next_hold
- don(t forget to call proc_release()
the hold and release is for that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 12:02 AM
07-15-2009 12:02 AM
Re: how to get current process in hpux11 dlkm
how to get absolute path name of the executable file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 03:29 AM
07-15-2009 03:29 AM
Re: how to get current process in hpux11 dlkm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 03:51 AM
07-15-2009 03:51 AM
Re: how to get current process in hpux11 dlkm
Here is how to use pstat(2) calls to get it outside the kernel, not sure if that helps:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1350198
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 04:44 AM
07-15-2009 04:44 AM
Re: how to get current process in hpux11 dlkm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 05:46 AM
07-15-2009 05:46 AM
Re: how to get current process in hpux11 dlkm
q4> disassemble pstat_stub32
Dump of assembler code for function pstat_stub32:
0x8b5678
0x8b567c
0x8b5680
0x8b5684
0x8b5688
0x8b568c
0x8b5690
0x8b5694
0x8b5698
0x8b569c
0x8b56a0
End of assembler dump.
q4> disassemble pstat|more
Dump of assembler code for function pstat:
0x9a358
0x9a35c
0x9a360
0x9a364
0x9a368
0x9a36c
0x9a370
0x9a374
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 06:51 AM
07-15-2009 06:51 AM
Re: how to get current process in hpux11 dlkm
first param come from
/usr/include/sys/pstat/pstat_ops.h
second is a pointer to a user space buffer
3rd and 4th as defined in manpage of pstat_*
not easy to use in your context because 2nd param is a pointer to current process user space.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 12:12 PM
07-15-2009 12:12 PM
Re: how to get current process in hpux11 dlkm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 10:37 PM
07-15-2009 10:37 PM
Re: how to get current process in hpux11 dlkm
I get a executing file's vnode,how to get the full path name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2009 11:00 PM
07-15-2009 11:00 PM
Re: how to get current process in hpux11 dlkm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2009 09:23 PM
07-16-2009 09:23 PM
Re: how to get current process in hpux11 dlkm
root 4692 4691 0 12:46:57 pts/0 0:01 kwdb -q4 /stand/vmunix /dev/kmem
root 4812 4768 1 13:18:16 pts/2 0:00 grep kwd
bash-4.0# lsof -p 4692
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
kwdb64 4692 root cwd DIR 64,0x3 8192 2 /
kwdb64 4692 root txt REG 64,0x7 18579168 31290 /usr (/dev/vg00/lvol7)
kwdb64 4692 root mem REG 64,0x7 12288 917 /usr (/dev/vg00/lvol7)
kwdb64 4692 root mem REG 64,0x7 1126400 899 /usr (/dev/vg00/lvol7)
kwdb64 4692 root mem REG 64,0x7 127445 112 /usr (/dev/vg00/lvol7)
kwdb64 4692 root mem REG 64,0x7 12288 107 /usr (/dev/vg00/lvol7)
kwdb64 4692 root mem REG 64,0x7 1863680 103 /usr (/dev/vg00/lvol7)
kwdb64 4692 root mem REG 64,0x7 155648 992 /usr/lib/dld.sl
kwdb64 4692 root 0u STR 157,0 0t1417 1530 /dev/pts/0->ldterm->ptem->pts
kwdb64 4692 root 1u STR 157,0 0t1417 1530 /dev/pts/0->ldterm->ptem->pts
kwdb64 4692 root 2u STR 157,0 0t1417 1530 /dev/pts/0->ldterm->ptem->pts
kwdb64 4692 root 3u REG 64,0x1 18800752 1623 /stand (/dev/vg00/lvol1)
kwdb64 4692 root 4r REG 64,0x1 18800752 1623 /stand (/dev/vg00/lvol1)
kwdb64 4692 root 5u STR 157,0 0t1417 1530 /dev/pts/0->ldterm->ptem->pts
kwdb64 4692 root 6u CHR 3,0x1 0x4a5ca7ac 68 /dev/kmem
kwdb64 4692 root 7u CHR 3,0 0t12467720 69 /dev/mem
kwdb64 4692 root 8r REG 64,0x1 18800752 1623 /stand (/dev/vg00/lvol1)
kwdb64 4692 root 9w REG 64,0x8 0 5350 /var/tmp/aaaa04692
why lsof can't show the full path of kwdb?
sometimes it's ok ,can show full path of kwdb