Re: KSE changes to ps

2002-06-14 Thread Juli Mallett

* Julian Elischer [EMAIL PROTECTED] escriurères
 So the question is: what information can PS show 
 for a KSE threaded process?
 
 I have been thinking of:
 
 Certainly the first thing to decide it WHAT there is to show..
 threads that are in userspace are not visible to ps, or for that matter
 the kernel, as teh Userland thread scheduler may switch between them
 without notifying the kernel. Only threads blocked in the kernel can show
 any information other than running For those in the userland there
 is only the information in the associated kse , and priority
 info from the thread is available.
 
 so for a process you can show:
 process stuff (e.g. uid, pid, ppid)

Hopefully this won't change.

 kseg stuff (e.g. nice value, number runnable threads)

Nice value and stuff are exported anyway via kproc_info.

Maybe we should look at packing an export_thread in there for exported kse
interfaces?

 kse stuff(e.g. RUNNING @ priority 32 on cpu0)
 kse stuff(e.g. RUNNING @ priority 31 on cpu1)   
 runnable threads
 e.g.
 thread runnable priority 33
 thread runnable priority 35
 thread runnable priority 37
 sleeping threads
 e.g.
 thread waiting at Mutex net1 prio 33
 thread sleeping at biord prio 31

This all has a simple solution.  Export each thread as a process via kinfo_\
proc, and ps(1) will use the existing mtxname interfaces and such..

I don't know how simple this is at a code level.

 kseg stuff (for next kseg)
 ...
  
 
 
 anyone have thoughts?

It'd be best to be able to poll the userland schedulers and the KSE stuff via
the ptrace(2) interface, I think, or just export things using kinfo_proc and
pad out the struct with things pertinent to KSE's.

Thanks.
-- 
Juli Mallett [EMAIL PROTECTED]  FreeBSD: The Power To Serve
Perception is prejudice / Don't classify me / Accept me as me / Not what you see

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: KSE changes to ps

2002-06-14 Thread Julian Elischer



On Fri, 14 Jun 2002, Juli Mallett wrote:

 * Julian Elischer [EMAIL PROTECTED] escriurères
  So the question is: what information can PS show 
  for a KSE threaded process?
  
  I have been thinking of:
  
  Certainly the first thing to decide it WHAT there is to show..
  threads that are in userspace are not visible to ps, or for that matter
  the kernel, as teh Userland thread scheduler may switch between them
  without notifying the kernel. Only threads blocked in the kernel can show
  any information other than running For those in the userland there
  is only the information in the associated kse , and priority
  info from the thread is available.
  
  so for a process you can show:
  process stuff (e.g. uid, pid, ppid)
 
 Hopefully this won't change.
 
  kseg stuff (e.g. nice value, number runnable threads)
 
 Nice value and stuff are exported anyway via kproc_info.

kproc_info only has space for one KSEG. it currently gets filled out from
fields in the KSEG and KSE and thread, by assuming that there is only one
of each. It id oblivious to the possibility that there may be  1 thread,
or KSE or KSEG.

We need to work out a new kernel interface to get all this information...
:-)

 
 Maybe we should look at packing an export_thread in there for exported kse
 interfaces?
 
  kse stuff(e.g. RUNNING @ priority 32 on cpu0)
  kse stuff(e.g. RUNNING @ priority 31 on cpu1)   
  runnable threads
  e.g.
  thread runnable priority 33
  thread runnable priority 35
  thread runnable priority 37
  sleeping threads
  e.g.
  thread waiting at Mutex net1 prio 33
  thread sleeping at biord prio 31
 
 This all has a simple solution.  Export each thread as a process via kinfo_\
 proc, and ps(1) will use the existing mtxname interfaces and such..
 

hm that isn't a stupid idea.


 I don't know how simple this is at a code level.
 
  kseg stuff (for next kseg)
  ...
   
  
  
  anyone have thoughts?
 
 It'd be best to be able to poll the userland schedulers and the KSE stuff via
 the ptrace(2) interface, I think, or just export things using kinfo_proc and
 pad out the struct with things pertinent to KSE's.
 
 Thanks.
 -- 
 Juli Mallett [EMAIL PROTECTED]  FreeBSD: The Power To Serve
 Perception is prejudice / Don't classify me / Accept me as me / Not what you see
 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: KSE changes to ps

2002-06-14 Thread Terry Lambert

Julian Elischer wrote:
 So the question is: what information can PS show
 for a KSE threaded process?


The same thing ps shows for a threaded process with user space
threads today.

Why confuse every ps-using shell script or perl script ever
written?


 so for a process you can show:
 process stuff (e.g. uid, pid, ppid)
 kseg stuff (e.g. nice value, number runnable threads)
 kse stuff(e.g. RUNNING @ priority 32 on cpu0)
 kse stuff(e.g. RUNNING @ priority 31 on cpu1)

[ ... ]

If you want to show all this stuff, it should be similar to the
-d option I patched into w for SunOS w compatability.

In other words, it should not be shown by default, it should
only show if you use special options to get it.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message