mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 06:10:56 +00:00
[gamecode] Get PR_Profile working
The switch from using pr_functions (dfunction_t) to function_table (bfunction_t) for keeping track of the current function (and thus profiling data) broke PR_Profile as it never saw anything but 0.
This commit is contained in:
parent
6368791d2b
commit
cafc6a541f
2 changed files with 11 additions and 8 deletions
|
@ -1196,7 +1196,7 @@ typedef struct {
|
|||
pr_int_t first_statement;
|
||||
pr_int_t parm_start;
|
||||
pr_int_t locals;
|
||||
pr_int_t profile;
|
||||
pr_uint_t profile;
|
||||
pr_int_t numparms;
|
||||
dparmsize_t parm_size[MAX_PARMS];
|
||||
dfunction_t *descriptor;
|
||||
|
|
|
@ -1712,23 +1712,26 @@ VISIBLE void
|
|||
PR_Profile (progs_t * pr)
|
||||
{
|
||||
pr_uint_t max, num, i;
|
||||
dfunction_t *best, *f;
|
||||
dfunction_t *f;
|
||||
bfunction_t *best, *bf;
|
||||
|
||||
num = 0;
|
||||
do {
|
||||
max = 0;
|
||||
best = NULL;
|
||||
for (i = 0; i < pr->progs->numfunctions; i++) {
|
||||
f = &pr->pr_functions[i];
|
||||
if (f->profile > max) {
|
||||
max = f->profile;
|
||||
best = f;
|
||||
bf = &pr->function_table[i];
|
||||
if (bf->profile > max) {
|
||||
max = bf->profile;
|
||||
best = bf;
|
||||
}
|
||||
}
|
||||
if (best) {
|
||||
if (num < 10)
|
||||
if (num < 10) {
|
||||
f = pr->pr_functions + (best - pr->function_table);
|
||||
Sys_Printf ("%7i %s\n", best->profile,
|
||||
PR_GetString (pr, best->s_name));
|
||||
PR_GetString (pr, f->s_name));
|
||||
}
|
||||
num++;
|
||||
best->profile = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue