Jan Kryl | 6 Sep 14:12 2007
Picon

proposal for new ps(1) option -H

Hi,

currently we use -s option to display one line for each LWP. The
disadvantage is, that -s option does two things at once. It prints one
line for each LWP and following information for each lwp:  uid, pid,
ppid, cpu, lid, nlwp, pri, nice, vsz, rss, wchan, lstate, tt, time and
command.

So, currently there is no way to display one line per LWP and
simultaneously your own configuration of output columns.
Therefore I suggest a new option, which prints one line per LWP, but
does nothing more. In Solaris they use -L, which is already used for
listing available keywords, so we could use -H as in FreeBSD.

The patch, which does the job, is fairly trivial (see attachment).

What do you guys think about this change?

Cheers,
Jan

Index: ps.c
===================================================================
RCS file: /home/loo/cvsup/src/bin/ps/ps.c,v
retrieving revision 1.63
diff -u -r1.63 ps.c
--- ps.c	17 Feb 2007 22:49:57 -0000	1.63
+++ ps.c	4 Sep 2007 16:17:08 -0000
(Continue reading)

Zafer Aydogan | 6 Sep 15:58 2007
Picon

device busy upon mount

hello list,

i've created a liveCD (using mklivecd) that works well, except that
I'm having problems
with mounting ffs or lfs. I've used the sources from August 30 (4.99.30).
When I try to mount an lfs or ffs partition I'm getting always "device busy"
Other mounts like nfs, tmpfs or ptyfs are not affected and working well.

To get an impression, please download the liveCD from http://www.jihbed.net/

A ktruss revealed nothing useful. The problem seems to be related to the
liveCD only, since my workstation using the same sources have no
problems at all.

Any help is appreciated.
Thanks, Zafer.

Antti Kantee | 6 Sep 16:21 2007
Picon
Picon

Re: device busy upon mount

[I think this belongs on tech-kern]

On Thu Sep 06 2007 at 15:58:50 +0200, Zafer Aydogan wrote:
> hello list,
> 
> i've created a liveCD (using mklivecd) that works well, except that
> I'm having problems
> with mounting ffs or lfs. I've used the sources from August 30 (4.99.30).
> When I try to mount an lfs or ffs partition I'm getting always "device busy"
> Other mounts like nfs, tmpfs or ptyfs are not affected and working well.
> 
> To get an impression, please download the liveCD from http://www.jihbed.net/
> 
> A ktruss revealed nothing useful. The problem seems to be related to the
> liveCD only, since my workstation using the same sources have no
> problems at all.

If I am correct, livecd does not have ddb.  This would be easier to
debug on a livecd build with ddb in the kernel.

--

-- 
Antti Kantee <pooka <at> iki.fi>                     Of course he runs NetBSD
http://www.iki.fi/pooka/                          http://www.NetBSD.org/
    "la qualité la plus indispensable du cuisinier est l'exactitude"

Zafer Aydogan | 6 Sep 16:26 2007
Picon

Re: device busy upon mount

2007/9/6, Antti Kantee <pooka <at> cs.hut.fi>:
> [I think this belongs on tech-kern]

Right.  I will forward it to tech-kern.

>
> On Thu Sep 06 2007 at 15:58:50 +0200, Zafer Aydogan wrote:
> > hello list,
> >
> > i've created a liveCD (using mklivecd) that works well, except that
> > I'm having problems
> > with mounting ffs or lfs. I've used the sources from August 30 (4.99.30).
> > When I try to mount an lfs or ffs partition I'm getting always "device busy"
> > Other mounts like nfs, tmpfs or ptyfs are not affected and working well.
> >
> > To get an impression, please download the liveCD from http://www.jihbed.net/
> >
> > A ktruss revealed nothing useful. The problem seems to be related to the
> > liveCD only, since my workstation using the same sources have no
> > problems at all.
>
> If I am correct, livecd does not have ddb.  This would be easier to
> debug on a livecd build with ddb in the kernel.
You can break into the debugger. The livecd is built with debug and lockdebug.

>
> --
> Antti Kantee <pooka <at> iki.fi>                     Of course he runs NetBSD
> http://www.iki.fi/pooka/                          http://www.NetBSD.org/
>     "la qualité la plus indispensable du cuisinier est l'exactitude"
(Continue reading)

Bill Stouder-Studenmund | 6 Sep 20:16 2007
Picon

Re: proposal for new ps(1) option -H

On Thu, Sep 06, 2007 at 02:12:03PM +0200, Jan Kryl wrote:
> Hi,
> 
> currently we use -s option to display one line for each LWP. The
> disadvantage is, that -s option does two things at once. It prints one
> line for each LWP and following information for each lwp:  uid, pid,
> ppid, cpu, lid, nlwp, pri, nice, vsz, rss, wchan, lstate, tt, time and
> command.
> 
> So, currently there is no way to display one line per LWP and
> simultaneously your own configuration of output columns.
> Therefore I suggest a new option, which prints one line per LWP, but
> does nothing more. In Solaris they use -L, which is already used for
> listing available keywords, so we could use -H as in FreeBSD.
> 
> The patch, which does the job, is fairly trivial (see attachment).
> 
> What do you guys think about this change?

I don't like it.

If we want '-H' to be like FreeBSD, that's one thing.

What I don't like about your suggestion is that what I think is the 
underlying problem still isn't fixed. The underlying issue is that when 
you add certain command options, such as -s, there's no way to suppress 
options (columns) that they add. If such an option existed, you could add 
the -s option, this option, then build your own parsing option using the 
-o option.

(Continue reading)

Jan Kryl | 6 Sep 23:19 2007
Picon

Re: proposal for new ps(1) option -H

On 06/09/07 11:16 -0700, Bill Stouder-Studenmund wrote:
> What I don't like about your suggestion is that what I think is the 
> underlying problem still isn't fixed. The underlying issue is that when 
> you add certain command options, such as -s, there's no way to suppress 
> options (columns) that they add. If such an option existed, you could add 
> the -s option, this option, then build your own parsing option using the 
> -o option.
That's not exactly what I wanted. I don't want a mechanism for suppression
of unwanted columns. I want an option, which prints all LWPs in process
independently of selected columns.

Let me demonstrate the problem. Let's say we want to print all lwps and we
are interested in PID,LID and COMMAND (the whole command line) and the terminal
width is 80 characters. Currently you would have to type something like this:

 $ ps axsww | awk '{ print $2" "$5" "$15; }'

If we had -H option, it would be:

 $ ps axHo pid,lid,command

Isn't it wonderfull? :)

> If we add 'H', then sure, we effectively have -s with the normal options.  
> But we still haven't fixed the issue that you can't make a totally custom 
> list of options.

Yes, you can. You can specify -H together with -o and have totally custom
list of columns (as in my previous example). If it is what you thought.

(Continue reading)

Alan Barrett | 7 Sep 01:06 2007

Re: proposal for new ps(1) option -H

On Thu, 06 Sep 2007, Jan Kryl wrote:
> If we had -H option, it would be:
> 
>  $ ps axHo pid,lid,command

If -o and -s options worked nicely together, it would be

   $ ps -axs -o pid,lid,command

I'd prefer to work on making "-o" play nicely with "-s" rather than
adding a "-H" option.  My idea is:  if you use "-s" without explicitly
selecting a set of columns, then it works as at present; if you
explicitly select a set of columns with "-o", then that overrides the
default columns that "-s" would otherwise have selected; and if you use
"-O" then it augments the set of columns that "-s" selected.

--apb (Alan Barrett)

Jan Kryl | 7 Sep 09:55 2007
Picon

Re: proposal for new ps(1) option -H

On 07/09/07 01:06 +0200, Alan Barrett wrote:
> If -o and -s options worked nicely together, it would be
> 
>    $ ps -axs -o pid,lid,command
> 
> I'd prefer to work on making "-o" play nicely with "-s" rather than
> adding a "-H" option.  My idea is:  if you use "-s" without explicitly
> selecting a set of columns, then it works as at present; if you
> explicitly select a set of columns with "-o", then that overrides the
> default columns that "-s" would otherwise have selected; and if you use
> "-O" then it augments the set of columns that "-s" selected.
> 

Sounds good to me. If I understand you correctly, you propose to change
default output format of ps(1) in case we are in "one line for LWP" mode.
I have attached trivial patch, which does exactly this. There's one
disadvantage of my patch - the order of -O and -s arguments matters. The
following commands produce different output:

	ps -axsO nice            (this is probably what you wanted)
	ps -axO nice -s          (now you get maybe frustrated ...)

But the same holds currently for combination of -O and -u,-l,-v options,
so I guess nobody would complain about it.

Cheers,
Jan

(Continue reading)

Aleksey Cheusov | 8 Sep 09:48 2007
Picon

Re: floating point negative zero in awk


> On Aug 27, 2007, at 7:53 PM, Jeremy C. Reed wrote:

 >> On Mon, 27 Aug 2007, Jason Thorpe wrote:
 >>
 >>>> 	$ echo | awk '{ print -1 * 0 }'
 >>>> 	-0
 >>>>
 >>>> Would it be OK if I commit the following patch, which ensures that
 >>>> arithmetic in awk will never yield a negative zero?
 >>>
 >>> No objection from me.  Does POSIX have anything to say about this?
 >>> What does
 >>> GNU AWK do?
 >>
 >> glacier:/opt/home/reed/book/bsdwiki$ echo | awk '{ print -1 * 0 }'
 >> -0
 >>
 >> glacier:/opt/home/reed/book/bsdwiki$ echo | gawk '{ print -1 * 0 }'
 >> 0

> Then your patch is fine with me.

JFYI

~>gawk 'BEGIN { print (-1) * 0 }'              
0
~>gawk 'BEGIN { printf "%d\n", (-1) * 0 }'     
0
~>gawk 'BEGIN { printf "%g\n", (-1.0) * 0.0 }' 
(Continue reading)

Bill Stouder-Studenmund | 9 Sep 08:33 2007
Picon

Re: Defered signal handling in SA libpthread

On Sat, Sep 08, 2007 at 09:45:33PM -0700, Bill Stouder-Studenmund wrote:
> I have coded most of the change to detect deferred signals, and I'd 
> appreciate comments. I'm attaching it below.

It needs a minor change. See below.

> Index: pthread_sig.c
> ===================================================================
> RCS file: /cvsroot/src/lib/libpthread/Attic/pthread_sig.c,v
> retrieving revision 1.47
> diff -u -p -r1.47 pthread_sig.c
> --- pthread_sig.c	24 Nov 2006 19:46:58 -0000	1.47
> +++ pthread_sig.c	9 Sep 2007 04:37:07 -0000
>  <at>  <at>  -266,6 +266,9  <at>  <at>  __sigsuspend14(const sigset_t *sigmask)
>  		pthread_spinunlock(self, &pt_sigsuspended_lock);
>  		pthread_exit(PTHREAD_CANCELED);
>  	}
> +	if (pthread_check_defsig(self)) {
> +		/* WRS Hmmm... how to handle... */
> +	}
>  	pthread_sigmask(SIG_SETMASK, sigmask, &oldmask);
>  
>  	self->pt_state = PT_STATE_BLOCKED_QUEUE;
>  <at>  <at>  -399,6 +402,9  <at>  <at>  sigtimedwait(const sigset_t * __restrict
>  
>   block:
>  		pthread_spinlock(self, &self->pt_statelock);
> +		if (pthread_check_defsig(self)) {
> +			/* WRS Hmmm... how to handle... */
> +		}
(Continue reading)


Gmane