Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No output from profiler #19

Open
matbcvo opened this issue Jun 28, 2015 · 8 comments
Open

No output from profiler #19

matbcvo opened this issue Jun 28, 2015 · 8 comments

Comments

@matbcvo
Copy link

matbcvo commented Jun 28, 2015

Profiler 2.12.1
Linux 3.10.23-xxxx-std-ipv6-64 on x86_64
CentOS Linux 6.6

Gamemode is compiled with -d3 flag.

http://prntscr.com/7mbhki

server.cfg

lanmode 0
rcon_password t287f
maxplayers 200
port 7777
hostname Imperial Roleplay
gamemode0 imperial
filterscripts fix
plugins crashdetect.so sscanf.so mysql.so streamer.so timerfix.so audio.so MapAndreas.so YSF.so bcrypt-samp.so gvar.so imrp_ol.so nativechecker.so profiler.so
announce 1
query 1
weburl www.im-rp.eu
maxnpc 25
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
messageholelimit 3000
logtimeformat [%d.%m.%Y %H:%M:%S]
language Eesti keel
profile_gamemode 1

Some plugin version:
GVar Plugin v1.3 by Incognito loaded
plugin.bcrypt v2.2.3 was loaded.
YSF - kurta999 version R12 loaded
Audio Plugin v0.5 R2 by Incognito loaded
plugin.mysql: R39-3 successfully loaded.
Streamer Plugin v2.7.7 by Incognito loaded
CrashDetect v4.15.1 is OK.

[profiler] Attached profiler to gamemodes/imperial.amx

What's the problem?

@karimcambridge
Copy link

Same issue. No output on linux. On windows it creates the output file but it just creates the heading only.

@IstuntmanI
Copy link

Same issue ! On Windows I think it's working ok, as long as gmx or exit is used. But on linux it is more like random: 1 out of 1000 times it is actually creating the .html file in the gamemodes folder. xD

I really need this plugin, it is really useful, but this bug is really annoying, I wasn't able to use profiler for a long time due to this problem. Everytime I tried this problem occured.

At first, I thought that it was because I was also using crashdetect, and then I removed it, and at the first gmx it printed out well, but after that it still wasn't printing anything.

@IstuntmanI
Copy link

It looks like using Profiler_Dump is working. This is the only solution I see for now: when we want to see the dump file we have to use a command to generate the file. (bad if we forget to use it before a restart)

@karimcambridge
Copy link

Profiler_Dump didnt work for me.

@Zeex
Copy link
Owner

Zeex commented Mar 12, 2016

I've added a little more logging, it may shed some light on what's going on. Can you please try the new version? (you'll need to build from source)

@karimcambridge
Copy link

Profiler_Start doesn't work.

[17/03/2016 07:07:59] Loading plugin: profiler
[17/03/2016 07:07:59] Profiler v2.13-6 is OK.
[17/03/2016 06:53:27] [profiler] Attached profiler to gamemodes/Kcnr.amx (no debug info)
[17/03/2016 07:09:03] [profiler] Dumping profiling statistics for gamemodes/Kcnr
[17/03/2016 07:09:03] [profiler] Total functions logged: 0 (native: 0, public: 0, other: 0)
[17/03/2016 07:09:03] [profiler] Total function calls logged: 0
[17/03/2016 07:09:04] [profiler] Writing profile to gamemodes/Kcnr-profile.html

#if defined PROFILER_INC
        case MENU_ADMINCP_PROFILING:
        {
            switch(option)
            {
                case 1: SendClientMessageFormatted(playerid, -1, "Current Profiler State: %d.", Profiler_GetState());
                case 2: {
                    SendClientMessageFormatted(playerid, -1, "Profiler Started: %d.", Profiler_Start());
                }
                case 3: {
                    if(Profiler_GetState() != _:PROFILER_STARTED) {
                        return sendClientError(playerid, "The profiler can not be stopped at the moment (it is not in started state).");
                    }
                    SendClientMessageFormatted(playerid, -1, "Profiler Stopped: %d.", Profiler_Stop());
                }
                case 4: SendClientMessageFormatted(playerid, -1, "Profiler Dumped: %d.", Profiler_Dump());
            }
        }
        #endif

Whenever I select Profiler_Start the profiler state stays in 3 (attached) even after waiting and waiting.

It also doesn't print anything.

This was annoying me so I went to the Profiler::Start() function and added Printf("Start() %d. %d.", state_, PROFILER_ATTACHED); and it printed 3. 2. which means PROFILER_STARTING state... good.

BUT I can't seem to see where Profiler::Exec is ever executed so I just did (for a temp fix.. tho this fix starts profiling on game mode start, which should really be an option)

bool Profiler::Start() {
  if (state_ < PROFILER_ATTACHED) {
    state_ = PROFILER_ATTACHING;
    return true;
  }
  if (state_ >= PROFILER_ATTACHED) {
    //state_ = PROFILER_STARTING;
    CompleteStart();
    return true;
  }
  return false;
}

and fixed!

@Zeex
Copy link
Owner

Zeex commented Mar 17, 2016

It should transition from STARTING to STARTED on the next call to some public function (i.e. next time amx_Exec is called by the server). It's strange that this didn't work...

Edit:

Can you see if Exec is called at all? E.g. put a print in it like you did with Start().

@karimcambridge
Copy link

Exec It's called during filterscripts loading

[17/03/2016 19:00:19]  Loaded 10 plugins.

[17/03/2016 19:00:19] 
[17/03/2016 19:00:19] Filterscripts
[17/03/2016 19:00:19] ---------------
[17/03/2016 19:00:19]   Loading filterscript 'rconfix.amx'...
[17/03/2016 19:00:19] [profiler] Profiler::Exec (state: 0)
[17/03/2016 19:00:19] [profiler] 2 Profiler::Exec (state: 0)
[17/03/2016 19:00:19] 
--RCON Fix FS loaded.

It aint called after that.

the first print is the start of the function, the second one is the end of the function (Profiler::Exec).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants