Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7188890

Linux: set OS thread title for created threads

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 8
    • hotspot
    • None
    • generic
    • linux

      This is a SUNBUG for https://bugs.openjdk.java.net/show_bug.cgi?id=100127

      Description From Stepan K:

      Created an attachment (id=172) [details]
      The patch

      syscall

      prctl(PR_SET_NAME, "title")

      sets OS thread name in Linux, that can be later inspected by command

      ps -L -p <jvm-pid>

      I propose setting thread name to ThreadType for threads created by JVM. This
      can be useful to understand what JVM does, and to diagnose and resolve
      problems.

      Sample output:

      ===
      [nga@garden:~/devel/left/jdk7]% ps -L -p 1758
        PID LWP TTY TIME CMD
       1758 1758 pts/4 00:00:00 java
       1758 1759 pts/4 00:00:00 java
       1758 1760 pts/4 00:00:00 pgc
       1758 1761 pts/4 00:00:00 pgc
       1758 1762 pts/4 00:00:00 pgc
       1758 1763 pts/4 00:00:00 pgc
       1758 1764 pts/4 00:00:00 pgc
       1758 1765 pts/4 00:00:00 pgc
       1758 1766 pts/4 00:00:00 pgc
       1758 1767 pts/4 00:00:00 pgc
       1758 1768 pts/4 00:00:00 vm
       1758 1769 pts/4 00:00:00 rjava
       1758 1770 pts/4 00:00:00 rjava
       1758 1771 pts/4 00:00:00 rjava
       1758 1772 pts/4 00:00:00 compiler
       1758 1773 pts/4 00:00:00 compiler
       1758 1774 pts/4 00:00:00 rjava
       1758 1775 pts/4 00:00:00 watcher
      ===

      Patch attached.

            Unassigned Unassigned
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: