Announce: SPIN - System Performance monItor for Neutrino

I’m announcing new utility which many people will probably find useful. Some
might just love it I think, especially those used to good system tools
available in other systems :slight_smile: Besides being directly useful, its source will
show how to do some rather obscure stuff in Neutrino.

But enough words, you can find all details at the web page. There are some
screenshots too. Currently it is published at
http://members.home.com/kovalenko/software/spin.html

I can’t express how pleased I’m to publish this baby, it was my obsession
for quite a few sleepless nights. You’ll find details about license at the
web page too, but in short this is ‘postcard-ware’ so don’t hesitate to send
some :slight_smile:

Enjoy,
-Igor

Previously, Igor Kovalenko wrote in qdn.public.qnxrtp.applications:

I’m announcing new utility which many people will probably find useful. Some
might just love it I think, especially those used to good system tools
available in other systems > :slight_smile: > Besides being directly useful, its source will
show how to do some rather obscure stuff in Neutrino.

But enough words, you can find all details at the web page. There are some
screenshots too. Currently it is published at
http://members.home.com/kovalenko/software/spin.html

I can’t express how pleased I’m to publish this baby, it was my obsession
for quite a few sleepless nights. You’ll find details about license at the
web page too, but in short this is ‘postcard-ware’ so don’t hesitate to send
some > :slight_smile:

This is wonderful. I’ve been missing sysmon - hence my little hack to
put CPU usage in a window. Spin is much more useful. And, for
every good program, there comes a patch. This one removes the update
flicker on the screen, and stops an error message from messing up the
screen when run as non-root.

Thanks, Igor.

Andrew


— spin.c.orig Fri Mar 16 08:46:00 2001
+++ spin.c Fri Mar 16 09:04:02 2001
@@ -223,7 +223,7 @@
Clear counters for displayed items
*/
p_count = 0, t_count = 0, rl_count = 0, re_count = 0, f_count = 0, se_count = 0, sl_count = 0;

  • clear();
  • erase();

/*
Part I. Update current time and uptime every second.
@@ -765,7 +765,12 @@
swap_stat_msg.type = _MEM_SWAP;
swap_stat_msg.subtype = _MEM_SWAP_STAT;
if (MsgSend( scoid, &swap_stat_msg, sizeof swap_stat_msg, &swap_stat_reply, sizeof swap_stat_reply ) < 0)

  •   	perror("MsgSend");
    
  •   {
    
  •   	char		tbuf[128];
    
  •   	sprintf (tbuf, "Error: MsgSend: %s (are you root?)",
    
  •   			 strerror(errno));
    
  •   	mvaddstr(rows - HELPLINE - 1, 0, tbuf);
    
  •   }
    

else if (swap_stat_reply.total)
{
swap_total = swap_stat_reply.total;


Awesome.

I’ll probably take some time to add remote capability.

Expect an e-postcard soon :wink:

“Igor Kovalenko” <kovalenko@home.com> wrote in message
news:98rsic$llg$1@inn.qnx.com

I’m announcing new utility which many people will probably find useful.
Some
might just love it I think, especially those used to good system tools
available in other systems > :slight_smile: > Besides being directly useful, its source
will
show how to do some rather obscure stuff in Neutrino.

But enough words, you can find all details at the web page. There are some
screenshots too. Currently it is published at
http://members.home.com/kovalenko/software/spin.html

I can’t express how pleased I’m to publish this baby, it was my obsession
for quite a few sleepless nights. You’ll find details about license at the
web page too, but in short this is ‘postcard-ware’ so don’t hesitate to
send
some > :slight_smile:

Enjoy,
-Igor

\

Mario Charest wrote:

Awesome.

I’ll probably take some time to add remote capability.

You mean accessing other node’s /proc through qnet?
Well, might be useful. So far you can of course just telnet there.

Beware though, if you telnet from pterm window there will be display
glitches (various kinds depending on TERM being used). I think it is
either pterm bug or terminfo bug again because those problems do not
happen when you run in xterm.

Expect an e-postcard soon > :wink:

:slight_smile:

  • igor

Andrew Thomas wrote:

This is wonderful. I’ve been missing sysmon - hence my little hack to
put CPU usage in a window. Spin is much more useful. And, for
every good program, there comes a patch. This one removes the update
flicker on the screen, and stops an error message from messing up the
screen when run as non-root.

Oh devil, you are QUICK Andrew!

Thanks, Igor.

Thanks for patch. It strikes every time, have to get a big poster with
‘test your program as non-root’ :wink: As for clear() vs erase(), this was
my very first ncurses program so I’m all open for suggestions…

  • igor

Andrew


— spin.c.orig Fri Mar 16 08:46:00 2001
+++ spin.c Fri Mar 16 09:04:02 2001
@@ -223,7 +223,7 @@
Clear counters for displayed items
*/
p_count = 0, t_count = 0, rl_count = 0, re_count = 0, f_count = 0, se_count = 0, sl_count = 0;

  •   clear();
    
  •   erase();
    

/*
Part I. Update current time and uptime every second.
@@ -765,7 +765,12 @@
swap_stat_msg.type = _MEM_SWAP;
swap_stat_msg.subtype = _MEM_SWAP_STAT;
if (MsgSend( scoid, &swap_stat_msg, sizeof swap_stat_msg, &swap_stat_reply, sizeof swap_stat_reply ) < 0)

  •                   perror("MsgSend");
    
  •           {
    
  •                   char            tbuf[128];
    
  •                   sprintf (tbuf, "Error: MsgSend: %s (are you root?)",
    
  •                                    strerror(errno));
    
  •                   mvaddstr(rows - HELPLINE - 1, 0, tbuf);
    
  •           }
    

else if (swap_stat_reply.total)
{
swap_total = swap_stat_reply.total;


Igor Kovalenko <Igor.Kovalenko@motorola.com> wrote:

Mario Charest wrote:

Awesome.

I’ll probably take some time to add remote capability.

Nice tool, Igor!

You mean accessing other node’s /proc through qnet?
Well, might be useful. So far you can of course just telnet there.

Howabout a library that would provide access to the /proc, either
locally or qnet (direct open) or via tcp/ip (via a daemon).

Then any tools made could also work on linux/solaris/windows as well.

Note that endian issues should also be considered.

Beware though, if you telnet from pterm window there will be display
glitches (various kinds depending on TERM being used). I think it is
either pterm bug or terminfo bug again because those problems do not
happen when you run in xterm.

Expect an e-postcard soon > :wink:


:slight_smile:

  • igor


cburgess@qnx.com

Igor Kovalenko <Igor.Kovalenko@motorola.com> wrote:

Beware though, if you telnet from pterm window there will be display
glitches (various kinds depending on TERM being used). I think it is
either pterm bug or terminfo bug again because those problems do not
happen when you run in xterm.

I have noticed that running telnet with the -8 option sometimes helps.


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

Wojtek Lerch <wojtek@qnx.com> wrote:

Igor Kovalenko <> Igor.Kovalenko@motorola.com> > wrote:

Beware though, if you telnet from pterm window there will be display
glitches (various kinds depending on TERM being used). I think it is
either pterm bug or terminfo bug again because those problems do not
happen when you run in xterm.

I have noticed that running telnet with the -8 option sometimes helps.

Yeah, but you shouldn’t need it. ;v)


cburgess@qnx.com

Colin Burgess <cburgess@qnx.com> wrote:

Wojtek Lerch <> wojtek@qnx.com> > wrote:
Igor Kovalenko <> Igor.Kovalenko@motorola.com> > wrote:

Beware though, if you telnet from pterm window there will be display
glitches (various kinds depending on TERM being used). I think it is
either pterm bug or terminfo bug again because those problems do not
happen when you run in xterm.

I have noticed that running telnet with the -8 option sometimes helps.

Yeah, but you shouldn’t need it. ;v)

I know. :slight_smile:


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

“Igor Kovalenko” <Igor.Kovalenko@motorola.com> wrote in message
news:3AB23450.3CE55C79@motorola.com

Mario Charest wrote:

Awesome.

I’ll probably take some time to add remote capability.


You mean accessing other node’s /proc through qnet?

Yeah

Well, might be useful. So far you can of course just telnet there.

Problem with that is I often want to do remote diagnostic when one
process has gone wild eating all the CPU and it won’t access
a telnet connection., or the embedded machine may not have
those ip services installed.

Beware though, if you telnet from pterm window there will be display
glitches (various kinds depending on TERM being used). I think it is
either pterm bug or terminfo bug again because those problems do not
happen when you run in xterm.

Expect an e-postcard soon > :wink:


:slight_smile:

  • igor

Mario Charest wrote:

Problem with that is I often want to do remote diagnostic when one
process has gone wild eating all the CPU and it won’t access
a telnet connection., or the embedded machine may not have
those ip services installed.

Been there :wink:
That’s why we run inetd with high priority and have it listen to 2 ports
for telnet - on standard port it starts telnetd through nice so it gets
regular priority, on other one it starts it straight so when system
‘locks up’ I simply do ‘telnet address high_prio_port’. Complicated but
works…

Using qnet should help too, I just had those problems before it was
ready. Which is why I started working on the spin in the first place. By
the way, it was much simpler originally but then I wanted it to do more
and more… :slight_smile:

  • igor

“Igor Kovalenko” <Igor.Kovalenko@motorola.com> wrote in message
news:3AB297B1.EE264F7E@motorola.com

Mario Charest wrote:

Problem with that is I often want to do remote diagnostic when one
process has gone wild eating all the CPU and it won’t access
a telnet connection., or the embedded machine may not have
those ip services installed.


Been there > :wink:
That’s why we run inetd with high priority and have it listen to 2 ports
for telnet - on standard port it starts telnetd through nice so it gets
regular priority, on other one it starts it straight so when system
‘locks up’ I simply do ‘telnet address high_prio_port’. Complicated but
works…

Getting creative :wink:

Using qnet should help too, I just had those problems before it was
ready. Which is why I started working on the spin in the first place. By
the way,

it was much simpler originally but then I wanted it to do more
and more… > :slight_smile:

Which is great of us :wink:

Looking at the code, I haven’t yet figure out how to get the name
of a remote machine: confstr(). For now when it’s in remote mode
it says: unknown.

  • igor

“Mario Charest” <mcharest@void_zinformatic.com> wrote in message
news:98uhpl$in5$1@nntp.qnx.com

Looking at the code, I haven’t yet figure out how to get the name
of a remote machine: confstr(). For now when it’s in remote mode
it says: unknown.

I presume you’d have to hack a message to remote sysmgr. The confstr() sends
such a message to get data, you can figure details from headers. Just like I
did for swap stats… After you spend some time analyzing headers and doing
some creative guessing you might be able to actually come up with your own
libc :wink:

  • igor