Commit 3b60c0c
Report thread names in stackusage output (#6)
stackusage reports the function pointer of each thread.
It can be unclear to users what each thread really is.
This change makes stackusage also report the thread name.
Applications can set a thread name using POSIX API
pthread_setname_np(). When not set, the thread name is
the program name.
Example of output (notice the "name" last column which is added
by this change):
stackusage log at 2019-10-31 11:12:41 ----------------------------------------
pid id tid requested actual maxuse max% dur funcP name
...
2254 15 22272 8388608 8388608 74676 0 14 0x7f9228afe890 Fts
...
22254 19 22273 8388608 8388608 15328 0 1 0x7f9228afe890 FtsGetRemoteCat
...
22254 42 22313 8388608 8388608 10664 0 1 0x7f9228afe890 FtsAsyncInitial
22254 43 22314 8388608 8388608 46584 0 1 0x7f9228afe890 FtsLocalSearchA
I've only checked on Linux x86_64. I don't have access
to other platforms.1 parent 2d03ce8 commit 3b60c0c
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
| 368 | + | |
| 369 | + | |
367 | 370 | | |
368 | 371 | | |
369 | 372 | | |
| |||
513 | 516 | | |
514 | 517 | | |
515 | 518 | | |
516 | | - | |
| 519 | + | |
517 | 520 | | |
518 | 521 | | |
519 | 522 | | |
| |||
524 | 527 | | |
525 | 528 | | |
526 | 529 | | |
527 | | - | |
| 530 | + | |
528 | 531 | | |
529 | 532 | | |
530 | 533 | | |
| |||
533 | 536 | | |
534 | 537 | | |
535 | 538 | | |
536 | | - | |
| 539 | + | |
| 540 | + | |
537 | 541 | | |
538 | 542 | | |
539 | 543 | | |
| |||
608 | 612 | | |
609 | 613 | | |
610 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
611 | 618 | | |
612 | 619 | | |
613 | 620 | | |
| |||
0 commit comments