9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] kprint
@ 2001-10-01 15:31 Russ Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Russ Cox @ 2001-10-01 15:31 UTC (permalink / raw)
  To: 9fans

William is right on all counts.

I want to add:

	o storage: do you have a circular buffer, or just accept an
	ever-increasing buffer size ?

We use qnoblock(kprintoq, 1), which results in dropping
the tail of the log.  It's an 8k log, so if someone is reading
I don't expect any drops.

	o do you allow user processes to append messages themselves,
	possibly a convenient place to put daemon log messages?

As Rob's man page excerpt pointed out, if you write to
#c/cons on a bitmapped terminal and /dev/kprint is open,
the output only goes to kprint.  That seemed easier to explain
at the time.  So syslog(1, ...) gets sent to kprint if in use.

Russ



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] kprint
  2001-10-01 14:09 rog
  2001-10-01 14:08 ` suspect
@ 2001-10-01 14:16 ` William Josephson
  1 sibling, 0 replies; 4+ messages in thread
From: William Josephson @ 2001-10-01 14:16 UTC (permalink / raw)
  To: 9fans

On Mon, Oct 01, 2001 at 03:09:12PM +0100, rog@vitanuova.com wrote:

The following only apply to my backport, but:

> some issues that i was wondering about:
> 	o storage: do you have a circular buffer, or just accept an
> 	ever-increasing buffer size ?

I just use a Queue with an 8K limit.  IIRC, that's what the new kernel
does, too.

> 	o blocking: does a process reading at the end of the file
> 	block until the next kernel print message arrives or does it
> 	look like a normal file which you have to poll (e.g.  tail -f)?

Currently, the process blocks -- I just open a rio window and type
'cat /dev/kprint' and put the window in scroll mode (or not).

> 	o do you allow user processes to append messages themselves,
> 	possibly a convenient place to put daemon log messages?

One could, I suppose.  I haven't thought about it, but it seems to me
that I'd want a more general logging facility that could write
messages to stable storage if I were doing that.  It might be better
to separate the two and have log messages and kernel prints go
somewhere else for logging.  At least as I use it, /dev/kprint is for
reading exceptional messages while I'm debugging so I don't hose rio.

> 	o multiplexing: do you allow several processes to access kprint
> 	simultaneously?

/dev/kprint is exclusive use.  This is how it is in the new kernel, too.
At least in my case, it makes the implementation easier and I don't think
the added complexity would yield all that much benefit given how I use it.

 -WJ


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [9fans] kprint
@ 2001-10-01 14:09 rog
  2001-10-01 14:08 ` suspect
  2001-10-01 14:16 ` William Josephson
  0 siblings, 2 replies; 4+ messages in thread
From: rog @ 2001-10-01 14:09 UTC (permalink / raw)
  To: 9fans

> A very pleasant addition which I just backported to 3rd Ed. this
> weekend.  Quite convenient.  Didn't realize it was Russ's idea, though.

it's a fairly natural thing to do, i think.  i've wanted to do something
similar in inferno for a while.  (^t^tp destroying the screen on a
bitsy is annoying).

some issues that i was wondering about:
	o storage: do you have a circular buffer, or just accept an
	ever-increasing buffer size ?

	o blocking: does a process reading at the end of the file
	block until the next kernel print message arrives or does it
	look like a normal file which you have to poll (e.g.  tail -f)?

	o do you allow user processes to append messages themselves,
	possibly a convenient place to put daemon log messages?

	o multiplexing: do you allow several processes to access kprint
	simultaneously?

  rog.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] kprint
  2001-10-01 14:09 rog
@ 2001-10-01 14:08 ` suspect
  2001-10-01 14:16 ` William Josephson
  1 sibling, 0 replies; 4+ messages in thread
From: suspect @ 2001-10-01 14:08 UTC (permalink / raw)
  To: 9fans


The original iteration of the "console" window, now the "log" window did
something along those lines. I never figured why it was changed to
what it is now, or whether those changes were not directly merged.
-



On Mon, 1 Oct 2001 rog@vitanuova.com wrote:
>
> it's a fairly natural thing to do, i think.  i've wanted to do something
> similar in inferno for a while.  (^t^tp destroying the screen on a
> bitsy is annoying).
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-10-01 15:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-01 15:31 [9fans] kprint Russ Cox
  -- strict thread matches above, loose matches on Subject: below --
2001-10-01 14:09 rog
2001-10-01 14:08 ` suspect
2001-10-01 14:16 ` William Josephson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).