+
    i#$                         ^ RI Ht ^ RIt^ RIt^RIHtHtHtH	t	H
t
Ht  ! R R]4      t ! R R]4      t ! R R	]4      t ! R
 R]4      t ! R R]4      tR# )    )print_functionN)lib_USDT_CB_USDT_PROBE_CBbcc_usdt_locationbcc_usdt_argumentBCC_USDT_ARGUMENT_FLAGSc                       ] tR t^tRtR# )USDTException N)__name__
__module____qualname____firstlineno____static_attributes__r       */usr/lib/python3/dist-packages/bcc/usdt.pyr   r      s    r   r   c                   8   a  ] tR t^t o R tR tR tR tRtV t	R# )USDTProbeArgumentc                   VP                   ^ 8  V n        \        VP                   4      V n         VP                  V n        V P                  \        P
                  ,          ^ 8w  d   VP                  V n        V P                  \        P                  ,          ^ 8w  d   VP                  V n        V P                  \        P                  ,          ^ 8w  d   VP                  V n
        V P                  \        P                  ,          ^ 8w  d   VP                  V n        V P                  \        P                  ,          ^ 8w  d   VP                  V n        V P                  \        P                  ,          ^ 8w  d   VP                   V n        R# R# )r   N)sizesignedabsvalidr	   CONSTANTconstantDEREF_OFFSETderef_offsetDEREF_IDENTderef_identBASE_REGISTER_NAMEbase_register_nameINDEX_REGISTER_NAMEindex_register_nameSCALEscale)selfarguments   &&r   __init__USDTProbeArgument.__init__   s   mma'&	^^
::/888A=$--DM::/<<<A ( 5 5D::/;;;q@'33D::/BBBaG&.&A&AD#::/CCCqH'/'C'CD$::/555:!DJ ;r   c                b    R V P                   V P                  '       d
   R3,          # R3,          # )z%d %s byteszsigned  unsigned)r   r   r'   s   &r   _size_prefixUSDTProbeArgument._size_prefix+   s7    $+++JFG 	G;EFG 	Gr   c                   V P                   \        P                  ,          ^ 8w  d   RV P                  ,          # V P                   \        P                  ,          ^ 8X  d"   RV P
                  P                  4       ,          # V P                   \        P                  ,          ^ 8w  d   V P                   \        P                  ,          ^ 8X  d   V P                   \        P                  ,          ^ 8w  dc   RV P                  P                  4       ,          pV P                   \        P                  ,          ^ 8w  d   VRV P                  ,          ,          pMRpV P                  ^ 8  d   RMRpRV P
                  P                  4       V\        V P                  4      V3,          # V P                   \        P                  ,          ^ 8w  d   V P                   \        P                  ,          ^ 8w  d   V P                   \        P                  ,          ^ 8w  d^   V P
                  R	8X  dM   V P                  ^ 8  d   RMRpR
V P                  P                  4       V\        V P                  4      3,          # RV P                   ,          # )r   z%dz%sz + %sz * %d +-z*(%s %s %d%s)ipz*(&%s %s %d)z&unrecognized argument format, flags %d)r   r	   r   r   r   r"   decoder   r#   r$   r%   r&   r   r   r!   r    )r'   index_offsetsigns   &  r   _formatUSDTProbeArgument._format/   s    ::/888A=$--''::/<<<A$1188:::::/<<<A::/;;;q@zz3GGG1L&)A)A)H)H)JJ:: 7 = ==B Gdjj$88L!++q03cD"d&=&=&D&D&F&*C0A0A,BL&R R R::/<<<A::/;;;q@::/BBBaG""d*++q03cD!T%5%5%<%<%>%)3t/@/@+A%C C C
 8$**DDr   c                L    V P                  4       : R V P                  4       : 2# )z @ )r.   r8   r-   s   &r   __str__USDTProbeArgument.__str__M   s     --/@@r   )	r"   r   r    r   r$   r&   r   r   r   N)
r   r   r   r   r)   r.   r8   r;   r   __classdictcell____classdict__s   @r   r   r      s"     ("GE<A Ar   r   c                   2   a  ] tR t^Pt o R tR tR tRtV tR# )USDTProbeLocationc                    Wn         W n        VP                  V n        VP                  V n        VP                  V n        R # N)probeindexnum_argumentsaddressbin_path)r'   rD   rE   locations   &&&&r   r)   USDTProbeLocation.__init__Q   s4    

"00'' ))r   c                \    R V P                   P                  4       V P                  3,          # )z%s 0x%x)rH   r5   rG   r-   s   &r   r;   USDTProbeLocation.__str__X   s#    DMM002DLLAAAr   c           
     ^   \        4       p\        P                  ! V P                  P                  V P                  P
                  V P                  P                  V P                  V\        P                  ! V4      4      pV^ 8w  d   \        RWP                  3,          4      h\        V4      # )r   z.error retrieving probe argument %d location %d)r   r   bcc_usdt_get_argumentrD   contextprovidernamerE   ctbyrefr   r   )r'   rE   argress   &&  r   get_argumentUSDTProbeLocation.get_argument[   s    !''

(:(:DJJ<O<O(,

(,

E288C=J !8DJJ'() ) !%%r   )rG   rH   rE   rF   rD   N)	r   r   r   r   r)   r;   rV   r   r=   r>   s   @r   rA   rA   P   s     *B	& 	&r   rA   c                   8   a  ] tR t^ft o R tR tR tR tRtV t	R# )	USDTProbec                    Wn         VP                  V n        VP                  V n        VP                  V n        VP                  V n        VP
                  V n        VP                  V n        R # rC   )rO   rP   rQ   rH   	semaphorenum_locationsrF   )r'   rO   rD   s   &&&r   r)   USDTProbe.__init__g   sO    JJ	"00"00r   c                    R V P                   P                  4       V P                  P                  4       V P                  3,          # )z%s:%s [sema 0x%x])rP   r5   rQ   r[   r-   s   &r   r;   USDTProbe.__str__p   s9    "$$&		(8(8(:DNNKL 	Lr   c                t    V P                   P                  4       : R V P                  P                  4       : 2# ):)rP   r5   rQ   r-   s   &r   
short_nameUSDTProbe.short_namet   s'    --..0$))2B2B2DEEr   c           	         \        4       p\        P                  ! V P                  V P                  V P
                  V\        P                  ! V4      4      pV^ 8w  d   \        RV,          4      h\        WV4      # )r   z"error retrieving probe location %d)
r   r   bcc_usdt_get_locationrO   rP   rQ   rR   rS   r   rA   )r'   rE   locrU   s   &&  r   get_locationUSDTProbe.get_locationw   s^    !''dmmTYY(-rxx}>!8 Du LMM c22r   )rH   rO   rQ   rF   r\   rP   r[   N)
r   r   r   r   r)   r;   rb   rg   r   r=   r>   s   @r   rY   rY   f   s      1LF3 3r   rY   c                   `   a  ] tR t^t o RR ltR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )USDTNc                   V'       d   VR8w  d   Wn         V'       d,   \        P                  ! WP                  R4      4      V n        M0\        P                  ! V\
        P                  ! ^ 4      4      V n        V P                  R8X  d   \        RV,          4      hR# V'       dV   W n        \        P                  ! VP                  R4      4      V n        V P                  R8X  d   \        RV,          4      hR# \        R4      h)   asciiNz USDT failed to instrument PID %dz!USDT failed to instrument path %sz/either a pid or a binary path must be specified)
pidr   bcc_usdt_new_frompidencoderO   rR   c_char_pr   pathbcc_usdt_new_frompath)r'   ro   rs   s   &&&r   r)   USDT.__init__   s    3"9H"77[[=QR"77R[[^L||t##$F$LMM $I44T[[5IJDL||t##$G$$NOO $  EG Gr   c                F    \         P                  ! V P                  4       R # rC   )r   bcc_usdt_closerO   r-   s   &r   __del__USDT.__del__   s    4<<(r   c                   VP                  R ^4      p\        V4      ^8X  dB   \        P                  ! V P                  VP                  R4      VP                  R4      4      pMTVw  rV\        P                  ! V P                  VP                  R4      VP                  R4      VP                  R4      4      pV^ 8w  d   \        RV,          4      hR# )ra   rm   a.  Failed to enable USDT probe '%s':
the specified pid might not contain the given language's runtime,
or the runtime was not built with the required USDT probes. Look
for a configure flag similar to --with-dtrace or --enable-dtrace.
To check which probes are present in the process, use the tplist tool.
N)splitlenr   bcc_usdt_enable_proberO   rq   %bcc_usdt_enable_fully_specified_prober   )r'   rD   fn_nameprobe_partsretprovider_name
probe_names   &&&    r   enable_probeUSDT.enable_probe   s    kk#q){q ++ell73W^^G5LNC +6'];;m227;Z=N=Nw=Ww')C !8
   r   c                     V P                  W4       R#   \         d=   p\        T\        P                  R 7       \        P
                  ! ^4        Rp?R# Rp?ii ; i))fileN)r   r   printsysstderrexit)r'   rD   r   es   &&& r   enable_probe_or_bailUSDT.enable_probe_or_bail   s@    	e- 	!#**%HHQKK	s    A1AAc                    V P                   # rC   )rO   r-   s   &r   get_contextUSDT.get_context   s    ||r   c                    \         P                  ^,          ! 4       p\         P                  ! V P                  4      V^ &   \        P                  ! V^4      P                  4       # )rl   )rR   c_void_prO   r   bcc_usdt_genargsr5   )r'   	ctx_arrays   & r   get_textUSDT.get_text   sD    [[1_'	{{4<<0	!##Iq188::r   c                j   VP                  R ^4      p\        V4      ^8X  d@   \        P                  ! V P                  VP                  R4      V4      P                  4       # Vw  rE\        P                  ! V P                  VP                  R4      VP                  R4      V4      P                  4       # )ra   rm   )r{   r|   r   bcc_usdt_get_probe_argctyperO   rq   r5   +bcc_usdt_get_fully_specified_probe_argctype)r'   r   	arg_indexr   r   rD   s   &&&   r   get_probe_arg_ctypeUSDT.get_probe_arg_ctype   s     &&sA.{q 22j//8)EEKVXN &1"]BBm227;U\\'=RT]__e_e_ghr   c                p   a a . oVV 3R  lp\         P                  ! S P                  \        V4      4       S# )c                 f   < SP                  \        SP                  V P                  4      4       R # rC   )appendrY   rO   contents)rD   probesr'   s   &r   
_add_probe)USDT.enumerate_probes.<locals>._add_probe   s    MM)DLL%..ABr   )r   bcc_usdt_foreachrO   r   r'   r   r   s   f @r   enumerate_probesUSDT.enumerate_probes   s.    	C 	T\\8J+?@r   c                x    V P                  4       pV F#  w  rErgV'       d   RpVP                  WEWgR7       K%  	  R# )rl   )rQ   r   addrro   Nrn   )enumerate_active_probesattach_uprobe)r'   bpfattach_usdt_ignore_pidr   binpathr   r   ro   s   &&&     r   attach_uprobesUSDT.attach_uprobes   s?    --/-3)Wt%7#'  2 .4r   c                l   a . oV3R  lp\         P                  ! V P                  \        V4      4       S# )c                 .   < SP                  WW#34       R # rC   )r   )r   r   r   ro   r   s   &&&&r   r   0USDT.enumerate_active_probes.<locals>._add_probe   s    MM7T78r   )r   bcc_usdt_foreach_uproberO   r   r   s   & @r   r   USDT.enumerate_active_probes   s-    	9 	##DLL.2LMr   )rO   rs   ro   )NN)r   r   r   r   r)   rx   r   r   r   r   r   r   r   r   r   r=   r>   s   @r   rj   rj      s>     G$)(;
h2 r   rj   )
__future__r   ctypesrR   r   libbccr   r   r   r   r   r	   	Exceptionr   objectr   rA   rY   rj   r   r   r   <module>r      s[    &  
, ,	I 	5A 5An& &,3 32[6 [r   