Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /proc/thread-self/root/opt/rh/gcc-toolset-11/root/usr/share/systemtap/examples/profiling/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/opt/rh/gcc-toolset-11/root/usr/share/systemtap/examples/profiling/perf.stp
#!/opt/rh/gcc-toolset-11/root/usr/bin/stap
global cycles_per_insn
global branch_per_insn
global cacheref_per_insn
global insns
global cycles
global branches
global cacherefs
global insn

probe perf.hw.instructions.process("/usr/bin/find").counter("find_insns") {} 
probe perf.hw.cpu_cycles.process("/usr/bin/find").counter("find_cycles") {} 
probe perf.hw.branch_instructions.process("/usr/bin/find").counter("find_branches") {} 
probe perf.hw.cache_references.process("/usr/bin/find").counter("find_cache_refs") {} 

probe process("/usr/bin/find").function("visit")  # generally .inline'd, thus the need for debuginfo
{
 insn["find_insns"] = @perf("find_insns")
 insns <<< (insn["find_insns"])
 insn["find_cycles"] = @perf("find_cycles")
 cycles <<< insn["find_cycles"]
 insn["find_branches"] = @perf("find_branches")
 branches <<< insn["find_branches"]
 insn["find_cache_refs"] = @perf("find_cache_refs")
 cacherefs <<< insn["find_cache_refs"]
}


probe process("/usr/bin/find").function("visit").return !,
      process("/usr/bin/find").statement("[email protected]+13").nearest  # in lieu of .inline.return
{
    dividend = (@perf("find_cycles") - insn["find_cycles"])
    divisor =  (@perf("find_insns") - insn["find_insns"])
    q = (divisor > 0 ? dividend / divisor : 0)
    if (q > 0)
	cycles_per_insn <<< q

    dividend = (@perf("find_branches") - insn["find_branches"])
    q = (divisor > 0 ? dividend / divisor : 0)
    if (q > 0)
	branch_per_insn <<< q

    dividend = (@perf("find_cycles") - insn["find_cycles"])
    q = (divisor > 0 ? dividend / divisor : 0)
    if (q > 0)
	cacheref_per_insn <<< q
}

probe end
{
 if (@count(cycles_per_insn)) {
   printf ("Cycles per Insn\n\n")
   print (@hist_log(cycles_per_insn))
 }
 if (@count(branch_per_insn)) {
   printf ("\nBranches per Insn\n\n")
   print (@hist_log(branch_per_insn))
 }
 if (@count(cacheref_per_insn)) {
   printf ("Cache Refs per Insn\n\n")
   print (@hist_log(cacheref_per_insn))
 }
}


Spamworldpro Mini