
    ~ g                     @    S SK r S SKrS SKJrJrJr   " S S\\5      rg)    N)PluginIndependentPlugin	PluginOptc                   N    \ rS rSrSrSrSrSrSr\	" SSS	S
9\	" SSSS
9/r
S rSrg)Coredump   a  
This plugin collects from the systemd-coredump service, which is leveraged
via the coredumpctl command.

Beyond basic configuration of the service, the plugin will also attempt to
collect information on available coredumps. For any coredumps reported by
coredumpctl for which the core is present, this plugin will collect that
coredump file. The number of dump files collects is controlled by the
`dumps` option, defaulting to 3. Note that core collection is performed
based on the most recent cores generated. The summary information provided
by `coredumpctl info` is also collected.

The coredump files will be at their canonical location in the sos archive,
usually under var/lib/systemd/coredump. Symlinks are dropped in the plugin
directory to assist in identifying which coredump aligns to which entry in
the provided `coredumpctl list` output collection.

Users may leverage the `executable` option to control which coredumps the
plugin will collect. This option takes a case-insensitive python regex
string. If provided, only coredump entries for which the EXE field in
`coredumpctl list` output matches will be collected.

The dump files collected are compressed, and users should be aware that
when inflated these files can be orders of magnitude larger than their
collected sizes.
z3systemd-coredump related information and dump filescoredump)systemdebug)zsystemd-udevzsystemd-coredumpdumps   znumber of dump files to collect)defaultdesc
executable zEonly collect info and dump output for executables matching this regexc                    U R                  / SQ5        U R                  S5      nUS   S:w  a  g SnUS   R                  5       SS   GH  nUR                  5       nUS   nUS   nU R	                  S	5      =n(       a,  [
        R                  " Xv[
        R                  5      (       d  Mb  U R                  S
U 35      nUS   S:w  a  M  US   n	X R	                  S5      :  d  M  [
        R                  " SU	[
        R                  5      n
 U
R                  5       S   R                  5       n[        R                  " U5      R                  S:  a  U R                  SU S35        GM   U R                  USSS9  U R                  U R                   S   U R#                  5       SU SU R%                  U5       35      n[        R&                  R)                  U R*                  R-                  5       U5      n[        R&                  R/                  X5      nUR1                  SSS5      nU R*                  R3                  X5        US-  nGM     g ! [4         a     GM  [6         a#  nU R                  SU SU 35         S nAGM9  S nAff = f)N)z/etc/systemd/coredump.confz/etc/systemd/coredump.conf.d/z/run/systemd/coredump.conf.d/z!/usr/lib/systemd/coredump.conf.d/z!/usr/lib/systemd/systemd-coredumpzcoredumpctl list --reversestatusr   output      r   zcoredumpctl info r   z(^\s*Storage:(.*)(\(present\)))i  zSkipping core dump file z due to sizeF   )tailit	sizelimitcmddir	coredump__z../r   zCould not collect coredump for z : )add_copy_speccollect_cmd_output
splitlinessplit
get_optionresearchIMgroupsstriposstatst_size	_log_info	path_joincommonsname_mangle_commandpathjoinarchiveget_archive_pathrelpathreplaceadd_linkAttributeError	Exception)selfcoredump_listcores_collectedlinecdumppidexeregexcinforescore	core_pathplugpatharcpathlinkpatherrs                   =/usr/lib/python3/dist-packages/sos/report/plugins/coredump.pysetupCoredump.setup9   sK    
 	 //0LM"a'!(+668<DJJLE(C)C55u5yyRTT22++.?u,EFEX!#/C!99yy!CS"$$O  $a 0 6 6 8I wwy)11I=6ykN !&&y#&N#~~X.		#C5$*>*>s*C)DE H !ggll4<<+H+H+J+46G!wwwAH'//r1=HLL))(=#q(OM =N &   NN9#c#G s&   
AI'CI
J	J"J  J N)__name__
__module____qualname____firstlineno____doc__
short_descplugin_nameprofilespackagesr   option_listrK   __static_attributes__rM       rJ   r   r      sJ    6 GJK"H3H 	'1+LM,.	0K;rY   r   )r)   r#   sos.report.pluginsr   r   r   r   rM   rY   rJ   <module>r[      s$    
 	 C Cdv( drY   