Linux-man Archive on lore.kernel.org
 help / color / Atom feed
From: Jonny Grant <jg@jguk.org>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	linux-man <linux-man@vger.kernel.org>
Subject: Re: core man page %e
Date: Tue, 9 Jun 2020 12:35:04 +0100
Message-ID: <15f56f99-f3e8-3a8d-97f3-42b6620d1e17@jguk.org> (raw)
In-Reply-To: <2c72b844-c99f-ec66-02a9-a12d688ece13@gmail.com>



On 09/06/2020 11:18, Michael Kerrisk (man-pages) wrote:
> Hello Jonny,
> 
> On 5/30/20 12:39 PM, Jonny Grant wrote:
>> Hello mtk
>>
>> I've noticed "%e-%s.core" often gives something other than the
>> filename and the name is truncated to 16 bytes:-
>>
>> ThreadPoolServi-5.core
>> Chrome_InProcUt-5.core
>>
>> This was set:
>> sysctl -w kernel.core_pattern="%e-%s.core"
>>
>>
>>
>> In multithreaded applications it looks like %e is giving something
>> other than the filename, perhaps a thread entry-point symbol name.>
>> https://www.man7.org/linux/man-pages/man5/core.5.html
>>
>>              %e  executable filename (without path prefix)
>>
>> Could this be updated to:
>>
>>              %e  executable filename or thread name truncated to 16 bytes
> 
> I changed it to this:
> 
>             %e  The process or thread's comm value, which typically is the
>                 same  as the executable filename (without path prefix, and
>                 truncated to a maximum of 15  characters),  but  may  have
>                 been  modified  to be something different; see the discus‐
>                 sion of /proc/[pid]/comm  and  /proc/[pid]/task/[tid]/comm
>                 in proc(5).

Hi Michael

That looks good.

I saw $ top -H shows these similar 15 byte truncated names. It's a shame it is such a low limit.

19697 jonny     20   0  657252  46120  29096 S  2.6  0.3   0:18.84 gnome-terminal- 
 
 

19431 jonny     20   0 4823508 114384  75668 S  1.6  0.7   0:00.08 ThreadPoolForeg


Is it better to say "15 bytes" because utf8 binary filenames or thread names would be less characters?

For example:

$ ./おはようございます
$ cat /proc/892/comm
おはようご

That is 15 bytes of utf8
E3 81 8A E3 81 AF E3 82 88 E3 81 86 E3 81 94 0A

Cheers, Jonny

      reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 10:39 Jonny Grant
2020-06-01 10:21 ` Jonny Grant
2020-06-09  8:25   ` Michael Kerrisk (man-pages)
2020-06-09 11:00     ` Jonny Grant
2020-06-09 10:18 ` Michael Kerrisk (man-pages)
2020-06-09 11:35   ` Jonny Grant [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15f56f99-f3e8-3a8d-97f3-42b6620d1e17@jguk.org \
    --to=jg@jguk.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git