mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-18 09:51:40 +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 first_statement;
|
||||||
pr_int_t parm_start;
|
pr_int_t parm_start;
|
||||||
pr_int_t locals;
|
pr_int_t locals;
|
||||||
pr_int_t profile;
|
pr_uint_t profile;
|
||||||
pr_int_t numparms;
|
pr_int_t numparms;
|
||||||
dparmsize_t parm_size[MAX_PARMS];
|
dparmsize_t parm_size[MAX_PARMS];
|
||||||
dfunction_t *descriptor;
|
dfunction_t *descriptor;
|
||||||
|
|
|
@ -1712,23 +1712,26 @@ VISIBLE void
|
||||||
PR_Profile (progs_t * pr)
|
PR_Profile (progs_t * pr)
|
||||||
{
|
{
|
||||||
pr_uint_t max, num, i;
|
pr_uint_t max, num, i;
|
||||||
dfunction_t *best, *f;
|
dfunction_t *f;
|
||||||
|
bfunction_t *best, *bf;
|
||||||
|
|
||||||
num = 0;
|
num = 0;
|
||||||
do {
|
do {
|
||||||
max = 0;
|
max = 0;
|
||||||
best = NULL;
|
best = NULL;
|
||||||
for (i = 0; i < pr->progs->numfunctions; i++) {
|
for (i = 0; i < pr->progs->numfunctions; i++) {
|
||||||
f = &pr->pr_functions[i];
|
bf = &pr->function_table[i];
|
||||||
if (f->profile > max) {
|
if (bf->profile > max) {
|
||||||
max = f->profile;
|
max = bf->profile;
|
||||||
best = f;
|
best = bf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (best) {
|
if (best) {
|
||||||
if (num < 10)
|
if (num < 10) {
|
||||||
|
f = pr->pr_functions + (best - pr->function_table);
|
||||||
Sys_Printf ("%7i %s\n", best->profile,
|
Sys_Printf ("%7i %s\n", best->profile,
|
||||||
PR_GetString (pr, best->s_name));
|
PR_GetString (pr, f->s_name));
|
||||||
|
}
|
||||||
num++;
|
num++;
|
||||||
best->profile = 0;
|
best->profile = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue