ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python2.7/Tools/scripts/analyze_dxp.pyo
ó
fc@s¾dZddlZddlZddlZddlZddlZeedƒs`edƒ‚nejƒZ	ej
ƒad„Zd„Z
d„Zd„Zd	„Zd
„Zdd„ZdS(s
Some helper functions to analyze the output of sys.getdxp() (which is
only available if Python was built with -DDYNAMIC_EXECUTION_PROFILE).
These will tell you which opcodes have been executed most frequently
in the current process, and, if Python was also built with -DDXPAIRS,
will tell you which instruction _pairs_ were executed most frequently,
which may help in choosing new instructions.

If Python was built without -DDYNAMIC_EXECUTION_PROFILE, importing
this module will raise a RuntimeError.

If you're running a script you want to profile, a simple way to get
the common pairs is:

$ PYTHONPATH=$PYTHONPATH:<python_srcdir>/Tools/scripts ./python -i -O the_script.py --args
...
> from analyze_dxp import *
> s = render_common_pairs()
> open('/tmp/some_file', 'w').write(s)
iÿÿÿÿNtgetdxpsKCan't import analyze_dxp: Python built without -DDYNAMIC_EXECUTION_PROFILE.cCs#t|ƒdko"t|dtƒS(s[Returns True if the Python that produced the argument profile
    was built with -DDXPAIRS.i(tlent
isinstancetlist(tprofile((s1/usr/lib64/python2.7/Tools/scripts/analyze_dxp.pyt	has_pairs(scCs'ttjƒtjƒaWdQXdS(s<Forgets any execution profile that has been gathered so far.N(t
_profile_locktsysRt_cumulative_profile(((s1/usr/lib64/python2.7/Tools/scripts/analyze_dxp.pyt
reset_profile/s
cCs·t«tjƒ}t|ƒr|x‹tttƒƒD]C}x:ttt|ƒƒD]"}t||c|||7<qOWq2Wn1x.tttƒƒD]}t|c||7<qWWdQXdS(s‰Reads sys.getdxp() and merges it into this module's cached copy.

    We need this because sys.getdxp() 0s itself every time it's called.N(RRRRtrangeRR(tnew_profilet
first_insttsecond_insttinst((s1/usr/lib64/python2.7/Tools/scripts/analyze_dxp.pyt
merge_profile7scCs%ttƒtjtƒSWdQXdS(s9Returns the cumulative execution profile until this call.N(RRtcopytdeepcopyR(((s1/usr/lib64/python2.7/Tools/scripts/analyze_dxp.pytsnapshot_profileHscCs‰t|ƒr|r|d}n|}gt|ƒD].\}}|dkr2|tj||f^q2}|jdtjdƒdtƒ|S(s Returns the most common opcodes in order of descending frequency.

    The result is a list of tuples of the form
      (opcode, opname, # of occurrences)

    iÿÿÿÿitkeyitreverse(Rt	enumeratetopcodetopnametsorttoperatort
itemgettertTrue(Rt	inst_listtoptcounttresult((s1/usr/lib64/python2.7/Tools/scripts/analyze_dxp.pytcommon_instructionsOs
(cCs¤t|ƒsgSgt|d ƒD]Z\}}t|ƒD]A\}}|dkr7||ftj|tj|f|f^q7q!}|jdtjdƒdtƒ|S(sãReturns the most common opcode pairs in order of descending frequency.

    The result is a list of tuples of the form
      ((1st opcode, 2nd opcode),
       (1st opname, 2nd opname),
       # of occurrences of the pair)

    iÿÿÿÿiRiR(RRRRRRRR(Rtop1t
op1profiletop2RR((s1/usr/lib64/python2.7/Tools/scripts/analyze_dxp.pytcommon_pairsas	>cs7ˆdkrtƒ‰n‡fd†}dj|ƒƒS(sÃRenders the most common opcode pairs to a string in order of
    descending frequency.

    The result is a series of lines of the form:
      # of occurrences: ('1st opname', '2nd opname')

    c3s3x,tˆƒD]\}}}d||fVq
WdS(Ns%s: %s
(R$(t_topsR(R(s1/usr/lib64/python2.7/Tools/scripts/analyze_dxp.pytseqstN(tNoneRtjoin(RR'((Rs1/usr/lib64/python2.7/Tools/scripts/analyze_dxp.pytrender_common_pairsus(t__doc__RRRRt	threadingthasattrtRuntimeErrortRLockRRRRR	RRR R$R)R+(((s1/usr/lib64/python2.7/Tools/scripts/analyze_dxp.pyt<module>s