forked from enlightenment/efl
evas/cserve2: Rename some stats and add some more for font
loading. SVN revision: 72704
This commit is contained in:
parent
cab8802354
commit
e09a542403
|
@ -1752,27 +1752,35 @@ _font_entry_stats_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED_
|
||||||
int load_time;
|
int load_time;
|
||||||
int nrefs = eina_list_count(fe->base.references);
|
int nrefs = eina_list_count(fe->base.references);
|
||||||
|
|
||||||
|
msg->fonts.fonts_loaded++;
|
||||||
|
if (fe->unused) msg->fonts.fonts_unused++;
|
||||||
|
|
||||||
// accounting size
|
// accounting size
|
||||||
EINA_INLIST_FOREACH(fe->caches, fc)
|
EINA_INLIST_FOREACH(fe->caches, fc)
|
||||||
{
|
{
|
||||||
|
unsigned int fc_usage, shmsize;
|
||||||
/* This is not real requested usage, but an approximation. We don't
|
/* This is not real requested usage, but an approximation. We don't
|
||||||
* know how many times each glyph would be used by each client, but
|
* know how many times each glyph would be used by each client, but
|
||||||
* assume that a similar set of glyphs from a given font would be used
|
* assume that a similar set of glyphs from a given font would be used
|
||||||
* by each client, thus counting them one time per client referencing
|
* by each client, thus counting them one time per client referencing
|
||||||
* them.
|
* them.
|
||||||
*/
|
*/
|
||||||
msg->fonts.requested_usage += fc->usage * nrefs;
|
fc_usage = fc->usage * nrefs;
|
||||||
msg->fonts.real_usage += cserve2_shm_size_get(fc->shm);
|
shmsize = cserve2_shm_size_get(fc->shm);
|
||||||
|
|
||||||
|
msg->fonts.requested_size += fc_usage;
|
||||||
|
msg->fonts.real_size += shmsize;
|
||||||
|
if (fe->unused) msg->fonts.unused_size += shmsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_LOAD_TIME
|
#ifdef DEBUG_LOAD_TIME
|
||||||
// accounting fonts load time
|
// accounting fonts load time
|
||||||
load_time = _timeval_sub(&fe->base.load_finish, &fe->base.load_start);
|
load_time = _timeval_sub(&fe->base.load_finish, &fe->base.load_start);
|
||||||
msg->fonts.fonts_load += load_time;
|
msg->fonts.fonts_load_time += load_time;
|
||||||
if (fe->caches) msg->fonts.fonts_used_load += load_time;
|
if (fe->caches) msg->fonts.fonts_used_load_time += load_time;
|
||||||
|
|
||||||
// accounting glyphs load time
|
// accounting glyphs load time
|
||||||
msg->fonts.glyphs_load += fe->gl_load_time;
|
msg->fonts.glyphs_load_time += fe->gl_load_time;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
|
@ -197,11 +197,13 @@ _usage_msg_read(void)
|
||||||
printf("Printing server usage.\n");
|
printf("Printing server usage.\n");
|
||||||
printf("======================\n\n");
|
printf("======================\n\n");
|
||||||
printf("Font Usage Statistics:\n");
|
printf("Font Usage Statistics:\n");
|
||||||
printf("Requested usage: %d bytes\n", msg->fonts.requested_usage);
|
printf("----------------------\n\n");
|
||||||
printf("Real usage: %d bytes\n", msg->fonts.real_usage);
|
printf("Requested usage: %d bytes\n", msg->fonts.requested_size);
|
||||||
printf("Fonts load time: %dus\n", msg->fonts.fonts_load);
|
printf("Real usage: %d bytes\n", msg->fonts.real_size);
|
||||||
printf("Fonts used load time: %dus\n", msg->fonts.fonts_used_load);
|
printf("Unused size: %d bytes\n", msg->fonts.unused_size);
|
||||||
printf("Glyphs load time: %dus\n", msg->fonts.glyphs_load);
|
printf("Fonts load time: %dus\n", msg->fonts.fonts_load_time);
|
||||||
|
printf("Fonts used load time: %dus\n", msg->fonts.fonts_used_load_time);
|
||||||
|
printf("Glyphs load time: %dus\n", msg->fonts.glyphs_load_time);
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,12 +199,17 @@ struct _Msg_Font_Glyphs_Loaded {
|
||||||
struct _Msg_Stats {
|
struct _Msg_Stats {
|
||||||
Msg_Base base;
|
Msg_Base base;
|
||||||
struct {
|
struct {
|
||||||
unsigned int requested_usage;
|
unsigned int requested_size;
|
||||||
unsigned int real_usage;
|
unsigned int real_size;
|
||||||
int fonts_load; // total time spent loading fonts
|
unsigned int unused_size;
|
||||||
int fonts_used_load; // total time spent loading fonts that are
|
unsigned int fonts_loaded; /* number of loaded fonts */
|
||||||
// really used
|
unsigned int fonts_unused; /* number of loaded fonts without reference
|
||||||
int glyphs_load; // total time spent loading glyphs
|
* from any clients */
|
||||||
|
int fonts_load_time; /* total time spent loading fonts */
|
||||||
|
int fonts_used_load_time; /* total time spent loading fonts that are
|
||||||
|
* really used, i.e. fonts that have glyphs
|
||||||
|
* rendered */
|
||||||
|
int glyphs_load_time; /* total time spent loading glyphs */
|
||||||
} fonts;
|
} fonts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue