Raised This Month: $51 Target: $400
 12% 

[ANY] [Debugger] Valve Profiler


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Plugin ID:
7459
Plugin Version:
1.1
Plugin Category:
Technical/Development
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    33 
    Plugin Description:
    Measures per-plugin performance and provides a log with various counters
    Old 01-10-2021 , 12:04   [ANY] [Debugger] Valve Profiler
    Reply With Quote #1

    What is it for?

    It is intended for advanced users to measure per-plugin / per-function (including internal game function) performance.

    See an example of the final report attached to this post.

    Description:
    Provides an easy way to run a valve profiler with one single command and save a log to a separate file.

    This is actually a shortcut for "sm prof*" + some internal game commands.

    This is the only correct way to run profiler for L4D series games without a crash. For details, see the issue.
    EDIT. That bug was fixed in SM v1.11.6726.
    Graph includes:
    - Game + plugin functions call stack
    - Function list sorted by max number of total calls
    - Function list sorted by Avg time/Frame
    - Function list sorted by Avg time/Call
    - Function list sorted by Avg time/Peak
    - All of the above separately with / or without children calls
    WARNING
    - Be careful, if you install it on the Live server! Stopping the profiler will cause a significant lag due to the analysis process. Actually, it can freeze you > 10 sec.
    - You may want to disable a watchdog by putting the following argument in server startup options, otherwise the server can exit with timeout (thanks to peace-maker for the suggestion):
    Code:
    -nowatchdog
    and possibly, "SlowScriptTimeout" "0" in /sourcemod/configs/core.cfg
    - It's better to run the profiler for a short period of time.
    - The longer it is running, the longer the analysis process will take.
    Direct analysis of profiler logs is not provided in this topic.
    Create your own topic in "General" section of the forum to get some help.

    Requirements and Compatibility:
    - SourceMod v1.11.6726+
    - Any SM compatible game
    - Carefully read "WARNING" section above !!!
    ConVars:
    - Nothing

    However, there are other game ConVars you may want to check on your own:
    Code:
    vprof_counters                                     : 0               : LAUNCHER             : 
    vprof_counters_show_minmax                         : 0               : LAUNCHER             : 
    vprof_dump_oninterval                              : 0               : LAUNCHER             : Interval (in seconds) at which vprof will batch up data and dump it to the console.
    vprof_dump_spikes                                  : 0               : LAUNCHER             : Framerate at which vprof will begin to dump spikes to the console. 0 = disabled, negative to reset after dump
    vprof_dump_spikes_budget_group                     :                 : LAUNCHER             : Budget gtNode to start report from when doing a dump spikes
    vprof_dump_spikes_hiearchy                         : 0               : LAUNCHER             : Set to 1 to get a hierarchy report whith vprof_dump_spikes
    vprof_dump_spikes_node                             :                 : LAUNCHER             : Node to start report from when doing a dump spikes
    vprof_dump_spikes_terse                            : 0               : LAUNCHER             : Whether to use most terse output
    vprof_graph                                        : 0               : LAUNCHER             : Draw the vprof graph.
    vprof_graphheight                                  : 256             : ARCHIVE              : 
    vprof_graphwidth                                   : 512             : ARCHIVE              : 
    vprof_scope                                        :                 : LAUNCHER             : Set a specific scope to start showing vprof tree
    vprof_scope_entity_gamephys                        : 0               : LAUNCHER|GAMEDLL     : 
    vprof_scope_entity_thinks                          : 0               : LAUNCHER|GAMEDLL     : 
    vprof_server_spike_threshold                       : 999.0           : LAUNCHER             : 
    vprof_server_thread                                : 0               : LAUNCHER             : 
    vprof_think_limit                                  : 0               : LAUNCHER|GAMEDLL     : 
    vprof_unaccounted_limit                            : 0.3             : ARCHIVE              : number of milliseconds that a node must exceed to turn red in the vprof panel
    vprof_verbose                                      : 1               : ARCHIVE              : Set to one to show average and peak times
    vprof_warningmsec                                  : 10              : ARCHIVE              : Above this many milliseconds render the label red to indicate slow code.
    Commands:
    - !debug - start/stop the profiler
    Log location:
    - addons/sourcemod/logs/profiler__<date>_<time>.log
    Installation:
    - copy .smx to addons/sourcemod/plugins
    Credits:
    - Valve & SM dev. team
    Replated plugins:
    - Auto-VPROF by KiD Fearless
    Donate
    Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
    - Patreon (Paypal)
    - BitCoin
    - Ю.Money
    Attached Files
    File Type: log profiler__2021-01-10_18-48-35.log (119.8 KB, 424 views)
    File Type: sp Get Plugin or Get Source (sm_vprofiler.sp - 350 views - 3.8 KB)
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 02-10-2024 at 09:37.
    Dragokas is offline
    TrueSurvivor
    Member
    Join Date: Jun 2010
    Old 06-26-2021 , 17:12   Re: [ANY] [Debugger] Valve Profiler
    Reply With Quote #2

    For some reason it's not producing logs for me, I've loaded the plugin manually and made the suggested changes.
    The debugger starts and freezes briefly on stop, but there's no logs anywhere.
    TrueSurvivor is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 06-26-2021 , 23:35   Re: [ANY] [Debugger] Valve Profiler
    Reply With Quote #3

    Game? Platform?
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    TrueSurvivor
    Member
    Join Date: Jun 2010
    Old 06-27-2021 , 03:40   Re: [ANY] [Debugger] Valve Profiler
    Reply With Quote #4

    Quote:
    Originally Posted by Dragokas View Post
    Game? Platform?
    Of course, my bad.
    Left 4 Dead 2, Linux Server.
    TrueSurvivor is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 06-27-2021 , 11:29   Re: [ANY] [Debugger] Valve Profiler
    Reply With Quote #5

    Well, it seems Valve broke "con_logfile" ConVar in the latest Left 4 Dead 2 update. I opened the issue.
    You can still retrieve the profiler's log from console.log until I push the update.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 06-27-2021 at 11:35.
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 06-27-2021 , 15:48   Re: [ANY] [Debugger] Valve Profiler
    Reply With Quote #6

    Updated to v1.1
    Quote:
    - Added walkaround against "con_logfile" ConVar bug in L4D2.
    Added warning:
    Quote:
    Direct analysis of profiler logs is not provided in this topic.
    Create your own topic in "General" section of the forum to get some help.
    Added a reference to similar plugin I found:
    Quote:
    Auto-VPROF by KiD Fearless
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 06-27-2021 at 15:48.
    Dragokas is offline
    TrueSurvivor
    Member
    Join Date: Jun 2010
    Old 06-27-2021 , 18:22   Re: [ANY] [Debugger] Valve Profiler
    Reply With Quote #7

    I'm still unable to have any logs saved, it seems to not "finish" properly.

    If I start the debugger, and end it after a bit, it'll print out that it's saved, but the file doesn't exist.
    When starting it again later, the server fps is significantly lower than what it was the first time I started the debugger, making it seem like something else is still running.
    If I keep starting and stopping it, the server fps will dip lower and lower (turning it off does return the server to its full performance however)
    TrueSurvivor is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 06-27-2021 , 18:43   Re: [ANY] [Debugger] Valve Profiler
    Reply With Quote #8

    I've no idea why that happens to you.
    Try to enter such commands in rcon manually and see what's reported to you.
    Code:
    vprof_on
    sm prof start vprof
    sm prof stop vprof
    sm prof dump vprof
    vprof_off
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    TrueSurvivor
    Member
    Join Date: Jun 2010
    Old 06-28-2021 , 06:28   Re: [ANY] [Debugger] Valve Profiler
    Reply With Quote #9

    It prints to console as expected, it just won't dump it for some reason?
    I couldn't find it in the console log either.
    TrueSurvivor is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 06-28-2021 , 10:47   Re: [ANY] [Debugger] Valve Profiler
    Reply With Quote #10

    So, did you receive the output of the profiler in rcon console similar to the one attached in 1st post?

    Try to add such arguments to server startup options:
    Code:
    -debug -condebug -console -usercon -nowatchdog
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 06-28-2021 at 10:53.
    Dragokas is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 07:25.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode