Giter Site home page Giter Site logo

Comments (23)

Fish-Git avatar Fish-Git commented on June 20, 2024

That sounds like a quite good and perfectly reasonable request! Thanks Drew! I'll get right on it as soon as I can!

from hyperion.

swhobbit avatar swhobbit commented on June 20, 2024

That sounds like a quite good and perfectly reasonable request!

You are most kind. I thought it would easier than some. :-)

BTW, my example only showed CPU threads, but getting all reasonable threads would be great.

from hyperion.

Fish-Git avatar Fish-Git commented on June 20, 2024

One caveat though: I'm pretty sure on Windows that thread names are limited to 16 characters (or maybe 15; can't recall). I think Linux might impose a limit too, but am not sure about that, nor what the limit actually is if it does. Prefixing each thread's name with the LPARNAME could end up being a little tricky depending on how long your LPAR name is!

from hyperion.

Fish-Git avatar Fish-Git commented on June 20, 2024

It looks like *Nix imposes a maximum length of only 15 characters:

from hyperion.

Fish-Git avatar Fish-Git commented on June 20, 2024

Hercules code:

hyperion/hscutl.c

Lines 1647 to 1673 in 65c97fd

/*-------------------------------------------------------------------*/
/* Set thead name (nonstandard GNU extension) */
/* (note: retcode is error code, NOT errno) */
/*-------------------------------------------------------------------*/
DLL_EXPORT int nix_set_thread_name( pthread_t tid, const char* name )
{
int rc = 0;
char threadname[16];
if (!name) return 0; /* (ignore premature calls) */
STRLCPY( threadname, name );
/* Some platforms (e.g. Mac) can only set name of current thread */
#if defined( PTHREAD_SET_NAME_ONLY )
if (!pthread_equal( tid, pthread_self()))
return EINVAL;
rc = pthread_setname_np( threadname );
#elif defined( PTHREAD_SET_NAME_3ARGS )
rc = pthread_setname_np( tid, "%s", threadname );
#else
rc = pthread_setname_np( tid, threadname );
#endif
/* Ignore any error; it either worked or it didn't */
return rc;
}

from hyperion.

Fish-Git avatar Fish-Git commented on June 20, 2024

LPARNAME is an 8 character field. So as I said, implementing this enhancement request may prove to be rather challenging (tricky).

Any ideas, Drew?  (Or anyone else?)

from hyperion.

swhobbit avatar swhobbit commented on June 20, 2024

Take whole LPAR name if possible, space, seven characters for the thread data:

CPxx
idlCCUU, CCUU (no idle), or IDLEcuu (which lops the high order nibble)
TIMER

What other types do you have? Sometimes, you gotta think like a S/360 programmer lop stuff down to size.

We close with a reading from the tenth edition (May 1990) of the IBM Jargon dictionary, edited by IBM Fellow Mike Cowlishaw:

token n. An 8-character alphanumeric operand. This size was chosen because it just happened to fit the size of one of the System/360 atomic units of storage (the doubleword). Some operating systems and programs used to (and often still do) insist on parsing all input and truncating any words longer than 8 characters. [Especially annoying to those with 9-letter surnames.]

(Of course, Cowlishaw is nine characters.)

from hyperion.

Fish-Git avatar Fish-Git commented on June 20, 2024

What other types do you have?

hyperion/hthreads.h

Lines 245 to 275 in 65c97fd

/*-------------------------------------------------------------------*/
/* Thread Names */
/*-------------------------------------------------------------------*/
/* Thread names must be less than 16 characters (15 chars + NULL) */
// "1...5...10...15"
#define BOOTSTRAP_NAME "bootstrap"
#define IMPL_THREAD_NAME "impl_thread"
#define PANEL_THREAD_NAME "panel_display"
#define SOCKET_THREAD_NAME "socket_thread"
#define LOGGER_THREAD_NAME "logger_thread"
#define SCRIPT_THREAD_NAME "script_thread"
#define TIMER_THREAD_NAME "timer_thread"
#if defined( _FEATURE_073_TRANSACT_EXEC_FACILITY )
#define RUBATO_THREAD_NAME "rubato_thread"
#endif
#define SCSISTAT_THREAD_NAME "scsi_status"
#define SCSIMOUNT_THREAD_NAME "scsi_mount"
#define CCKD_RA_THREAD_NAME "cckd_ra"
#define CCKD_WR_THREAD_NAME "cckd_writer"
#define CCKD_GC_THREAD_NAME "cckd_gcol"
#define CON_CONN_THREAD_NAME "console_connect"
#define CONN_CLI_THREAD_NAME "connect_client"
#define HAO_THREAD_NAME "hao_thread"
#define HTTP_SRVR_THREAD_NAME "http_server"
#define HTTP_REQ_THREAD_NAME "http_request"
#define WATCHDOG_THREAD_NAME "watchdog_thread"
#define HERCLIN_KB_THREAD "keyboard thread"

from hyperion.

swhobbit avatar swhobbit commented on June 20, 2024
#define BOOTSTRAP_NAME   "boot"
#define IMPL_NAME        "impl"
#define PANEL_NAME       "panel"
#define SOCKET_NAME      "sock"
#define LOGGER_NAME      "log"
#define SCRIPT_NAME      "scrpt"
#define TIMER_NAME       "timer"
#if defined( _FEATURE_073_TRANSACT_EXEC_FACILITY )
#define RUBATO_NAME      "rubato"
#endif
#define SCSISTAT_NAME    "scsist"
#define SCSIMOUNT_NAME   "scsimt"
#define CCKD_RA_NAME     "dra"
#define CCKD_WR_NAME     "dwtr"
#define CCKD_GC_NAME     "dol"
#define CON_CONN_NAME    "ttynew"
#define CONN_CLI_NAME    "ttycli"
#define HAO_NAME         "hao"
#define HTTP_SRVR_NAME   "websvr"
#define HTTP_REQ_NAME    "webreq"
#define WATCHDOG_NAME    "wdog"
#define HERCLIN_KB       "keybd"

from hyperion.

swhobbit avatar swhobbit commented on June 20, 2024
SET_THREAD_NAME( exename );  

FYI: I would replace something like this with LPARNAME HERC.

from hyperion.

Fish-Git avatar Fish-Git commented on June 20, 2024

I'm also thinking this should probably be a new command-line option too, so the user can choose on a case-by-case basis whether they want thread names to be prefixed with some user-defined value or not.

That is to say, prefixing thread names with the LPARNAME, now that I think about it, might not be possible (or at least more difficult) to implement, given that the LPARNAME won't be known until the configuration files is processed (and, although I haven't checked, I believe some threads might get created before the LPARNAME has been processed and is known).

What do you think? New command-line option?

from hyperion.

Fish-Git avatar Fish-Git commented on June 20, 2024
#define BOOTSTRAP_NAME   "boot"
#define IMPL_NAME        "impl"
#define PANEL_NAME       "panel"
#define SOCKET_NAME      "sock"
...

I like it!  :)

from hyperion.

swhobbit avatar swhobbit commented on June 20, 2024

What do you think? New command-line option?

If you want, but since on Linux by default top doesn't show threads in the first place (YMMV), it doesn't matter that much.

from hyperion.

swhobbit avatar swhobbit commented on June 20, 2024

threads

Thread panel_display   tid=f7db9dc0 created on 16:11:03.901607 at hthreads.c:206  
Thread logger_thread   tid=f72a4440 created on 16:11:03.902303 at logger.c:584    
Thread watchdog_thread tid=f6efa440 created on 16:11:03.910833 at impl.c:1478     
Thread Processor CP00  tid=f69ff440 created on 16:11:03.912193 at config.c:1065   
Thread timer_thread    tid=f66ff440 created on 16:11:03.913430 at cpu.c:2345      
Thread http_server     tid=f6df9440 created on 16:11:03.941149 at httpserv.c:1044 
Thread socket_thread   tid=f6cbe440 created on 16:11:03.944343 at sockdev.c:533   
Thread console_connect tid=f57ff440 created on 16:11:03.947787 at console.c:718   
Thread CTCE 0E40 Liste tid=f4ef6440 created on 16:11:04.019277 at ctcadpt.c:2237  
Thread CTCE 0E40 Conne tid=f4df5440 created on 16:11:04.019992 at ctcadpt.c:3567  
Thread CTCE 0E41 Liste tid=f4cf4440 created on 16:11:04.020866 at ctcadpt.c:2237  
Thread CTCE 0E41 Conne tid=f4bf3440 created on 16:11:04.021605 at ctcadpt.c:3567  
Thread hao_thread      tid=f48f0440 created on 16:11:04.095450 at hao.c:93        
Thread CTCE 0E44 RecvT tid=f45ed440 created on 16:11:04.240214 at ctcadpt.c:2413  
Thread CTCE 0E45 RecvT tid=f44ec440 created on 16:11:04.240502 at ctcadpt.c:2413  
Thread cckd_ra         tid=f42ea440 created on 16:11:14.130132 at cckddasd.c:1594 
Thread dev 0E44 thrd   tid=f38ff440 created on 16:11:21.833460 at channel.c:2677  
Thread idle dev thrd   tid=f37fe440 created on 16:11:21.834877 at channel.c:2677  
Thread cckd_writer     tid=f46ee440 created on 16:14:02.161484 at cckddasd.c:1883 

Commenting on this partial display from a running system:

  • As noted previously, drop Processor, thread, and thrd.
  • Drop CTCE, the reader can do a devlist to determine a device type.
  • Change idle dev to dev idle so it matches dev 0E44
  • Change cckd to dasd?
  • What's the ra in cckd_ra? (If it's "read", change ra to rd)

from hyperion.

Fish-Git avatar Fish-Git commented on June 20, 2024

If you want, but since on Linux top doesn't show threads in the first place (YMMV), it doesn't matter that much.

Eh?! What's this?! If top doesn't show threads, then what command does? What command are you using that prompted you (compelled you) to create this enhancement request in the first dang place?!

I'm confused!  :(

from hyperion.

swhobbit avatar swhobbit commented on June 20, 2024

I bad. (Original comment corrected.)

If you want, but since on Linux top doesn't show threads in the first place (YMMV), it doesn't matter that much.

should read:

If you want, but since on Linux top by default doesn't show threads in the first place (YMMV), it doesn't matter that much.

Threads are enabled by capital H.

from hyperion.

wrljet avatar wrljet commented on June 20, 2024

Huh? in top?

from hyperion.

swhobbit avatar swhobbit commented on June 20, 2024

Huh? in top?

More context please. What in top? Threads? Yes, capital H. Quoting the top manual age on Bullseye:

-H Threads-mode operation
Instructs top to display individual threads. Without this command-line option a summation of all threads in each process is shown. Later this can be changed with the H interactive command.

from hyperion.

wrljet avatar wrljet commented on June 20, 2024

I see no effect using -H command line option, or the H once Top is running.

from hyperion.

Fish-Git avatar Fish-Git commented on June 20, 2024
  • As noted previously, drop Processor, thread, and thrd.

Makes sense.

  • Change idle dev to dev idle so it matches dev 0E44

Also makes perfect sense.

  • Change cckd to dasd?

Nah. Dasd code and CCKD code are quite different things internally. As "dasd" and "cckd" are both 4 characters, I'm compelled to leave those as-is if you don't mind.

  • What's the ra in cckd_ra? (If it's "read", change ra to rd)

Again, no. The "ra" in the name stands for "read ahead":

 

from hyperion.

swhobbit avatar swhobbit commented on June 20, 2024

I see no effect using -H command line option, or the H once Top is running.

Are you running threaded apps?

I specifically said I was using Bullseye (actually Raspberry PI OS B Bullseye); the top command was installed by apt. I even quoted the man page.

I also verified this on ubuntu 22.04.2 LTS (Jammy Jellyfish).

Hint: The second line of the top display changes from tasks to threads when you switch modes.

-ahd-

from hyperion.

wrljet avatar wrljet commented on June 20, 2024

I see no effect using -H command line option, or the H once Top is running.

Are you running threaded apps?

I don't know.

I specifically said I was using Bullseye (actually Raspberry PI OS B Bullseye); the top command was installed by apt. I even quoted the man page.

I also verified this on ubuntu 22.04.2 LTS (Jammy Jellyfish).

Hint: The second line of the top display changes from tasks to threads when you switch modes.

I did notice the change to "Threads". But nothing special was running at the time.

from hyperion.

swhobbit avatar swhobbit commented on June 20, 2024

Change cckd to dasd?

Nah. Dasd code and CCKD code are quite different things internally. As "dasd" and "cckd" are both 4 characters, I'm compelled to leave those as-is if you don't mind.

What's the ra in cckd_ra? (If it's "read", change ra to rd)

Again, no. The "ra" in the name stands for "read ahead":

SGTM

from hyperion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.