linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* core man page %e
@ 2020-05-30 10:39 Jonny Grant
  2020-06-01 10:21 ` Jonny Grant
  2020-06-09 10:18 ` Michael Kerrisk (man-pages)
  0 siblings, 2 replies; 6+ messages in thread
From: Jonny Grant @ 2020-05-30 10:39 UTC (permalink / raw)
  To: Michael Kerrisk, linux-man

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

Cheers, Jonny

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: core man page %e
  2020-05-30 10:39 core man page %e Jonny Grant
@ 2020-06-01 10:21 ` Jonny Grant
  2020-06-09  8:25   ` Michael Kerrisk (man-pages)
  2020-06-09 10:18 ` Michael Kerrisk (man-pages)
  1 sibling, 1 reply; 6+ messages in thread
From: Jonny Grant @ 2020-06-01 10:21 UTC (permalink / raw)
  To: Michael Kerrisk, linux-man

Hi Mtk,

BTW, if I add "%P-%e-%s.core" every core starts with the same
"P1000-"

The man page shows:
  %P  PID of dumped process, as seen in the initial PID namespace
                (since Linux 3.12)

Do you see similar? I was only needing something to make the filename unique, so %t is enough.

Cheers, Jonny


On 30/05/2020 11:39, 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
> 
> Cheers, Jonny

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: core man page %e
  2020-06-01 10:21 ` Jonny Grant
@ 2020-06-09  8:25   ` Michael Kerrisk (man-pages)
  2020-06-09 11:00     ` Jonny Grant
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-06-09  8:25 UTC (permalink / raw)
  To: Jonny Grant, linux-man; +Cc: mtk.manpages

On 6/1/20 12:21 PM, Jonny Grant wrote:
> Hi Mtk,
> 
> BTW, if I add "%P-%e-%s.core" every core starts with the same
> "P1000-"
> 
> The man page shows:
>   %P  PID of dumped process, as seen in the initial PID namespace
>                 (since Linux 3.12)
> 
> Do you see similar? I was only needing something to make the filename
> unique, so %t is enough.
I don't see the same. What do you see when you verify the change with:

sysctl kernel.core_pattern

Thanks,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: core man page %e
  2020-05-30 10:39 core man page %e Jonny Grant
  2020-06-01 10:21 ` Jonny Grant
@ 2020-06-09 10:18 ` Michael Kerrisk (man-pages)
  2020-06-09 11:35   ` Jonny Grant
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-06-09 10:18 UTC (permalink / raw)
  To: Jonny Grant, linux-man; +Cc: mtk.manpages

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).

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: core man page %e
  2020-06-09  8:25   ` Michael Kerrisk (man-pages)
@ 2020-06-09 11:00     ` Jonny Grant
  0 siblings, 0 replies; 6+ messages in thread
From: Jonny Grant @ 2020-06-09 11:00 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages), linux-man



On 09/06/2020 09:25, Michael Kerrisk (man-pages) wrote:
> On 6/1/20 12:21 PM, Jonny Grant wrote:
>> Hi Mtk,
>>
>> BTW, if I add "%P-%e-%s.core" every core starts with the same
>> "P1000-"
>>
>> The man page shows:
>>    %P  PID of dumped process, as seen in the initial PID namespace
>>                  (since Linux 3.12)
>>
>> Do you see similar? I was only needing something to make the filename
>> unique, so %t is enough.
> I don't see the same. What do you see when you verify the change with:
> 
> sysctl kernel.core_pattern
> 
> Thanks,
> 
> Michael
> 

It must be some mistake I made, can't reproduce it today

Jonny


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: core man page %e
  2020-06-09 10:18 ` Michael Kerrisk (man-pages)
@ 2020-06-09 11:35   ` Jonny Grant
  0 siblings, 0 replies; 6+ messages in thread
From: Jonny Grant @ 2020-06-09 11:35 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages), linux-man



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-06-09 11:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-30 10:39 core man page %e 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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).