X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=pr_exec.c;h=2393ed1dd4d127d0939f31cee067f20e589cd555;hb=7346f55327816ed5eeef2756c426c0ecc2c06cb6;hp=5a5243e90dbb74039fe7578c9669ddeb3f90428a;hpb=ff46d6ff516fda192c5adc55a5c9b82007545bd2;p=xonotic%2Fdarkplaces.git diff --git a/pr_exec.c b/pr_exec.c index 5a5243e9..2393ed1d 100644 --- a/pr_exec.c +++ b/pr_exec.c @@ -215,6 +215,14 @@ void PR_Profile_f (void) mfunction_t *f, *best; int i, num, max/*, howmany*/; + if (!sv.active) + { + Con_Printf("no server running, can't profile\n"); + return; + } + + Con_Print( "Server Profile:\n[Profile] [BuiltinProfile] [CallCount]\n" ); + //howmany = 10; //if (Cmd_Argc() == 2) // howmany = atoi(Cmd_Argv(1)); @@ -235,7 +243,7 @@ void PR_Profile_f (void) if (best) { //if (num < howmany) - Con_Printf("%7i %7i %s\n", best->profile, best->builtinsprofile, PR_GetString(best->s_name)); + Con_Printf("%7i %7i %7i %s\n", best->profile, best->builtinsprofile, best->callcount, PR_GetString(best->s_name)); num++; best->profile = 0; best->builtinsprofile = 0; @@ -248,7 +256,7 @@ void PR_PrintState(void) int i; if (pr_xfunction) { - for (i = -4;i <= 0;i++) + for (i = -7;i <= 0;i++) if (pr_xstatement + i >= pr_xfunction->first_statement) PR_PrintStatement (pr_statements + pr_xstatement + i); } @@ -380,7 +388,7 @@ void PR_ExecuteProgram (func_t fnum, const char *errormessage) eval_t *ptr; int profile, startprofile, cachedpr_trace, exitdepth; - if (!fnum || fnum >= progs->numfunctions) + if (!fnum || fnum >= (unsigned) progs->numfunctions) { if (pr_global_struct->self) ED_Print(PROG_TO_EDICT(pr_global_struct->self));