evas/cserve2: Rename some stats and add some more for font

loading.



SVN revision: 72704
This commit is contained in:
Rafael Antognolli 2012-06-22 21:43:50 +00:00
parent cab8802354
commit e09a542403
3 changed files with 31 additions and 16 deletions

View File

@ -1752,27 +1752,35 @@ _font_entry_stats_cb(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED_
int load_time;
int nrefs = eina_list_count(fe->base.references);
msg->fonts.fonts_loaded++;
if (fe->unused) msg->fonts.fonts_unused++;
// accounting size
EINA_INLIST_FOREACH(fe->caches, fc)
{
unsigned int fc_usage, shmsize;
/* 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
* 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
* them.
*/
msg->fonts.requested_usage += fc->usage * nrefs;
msg->fonts.real_usage += cserve2_shm_size_get(fc->shm);
fc_usage = fc->usage * nrefs;
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
// accounting fonts load time
load_time = _timeval_sub(&fe->base.load_finish, &fe->base.load_start);
msg->fonts.fonts_load += load_time;
if (fe->caches) msg->fonts.fonts_used_load += load_time;
msg->fonts.fonts_load_time += load_time;
if (fe->caches) msg->fonts.fonts_used_load_time += load_time;
// accounting glyphs load time
msg->fonts.glyphs_load += fe->gl_load_time;
msg->fonts.glyphs_load_time += fe->gl_load_time;
#endif
return EINA_TRUE;

View File

@ -197,11 +197,13 @@ _usage_msg_read(void)
printf("Printing server usage.\n");
printf("======================\n\n");
printf("Font Usage Statistics:\n");
printf("Requested usage: %d bytes\n", msg->fonts.requested_usage);
printf("Real usage: %d bytes\n", msg->fonts.real_usage);
printf("Fonts load time: %dus\n", msg->fonts.fonts_load);
printf("Fonts used load time: %dus\n", msg->fonts.fonts_used_load);
printf("Glyphs load time: %dus\n", msg->fonts.glyphs_load);
printf("----------------------\n\n");
printf("Requested usage: %d bytes\n", msg->fonts.requested_size);
printf("Real usage: %d bytes\n", msg->fonts.real_size);
printf("Unused size: %d bytes\n", msg->fonts.unused_size);
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");
}

View File

@ -199,12 +199,17 @@ struct _Msg_Font_Glyphs_Loaded {
struct _Msg_Stats {
Msg_Base base;
struct {
unsigned int requested_usage;
unsigned int real_usage;
int fonts_load; // total time spent loading fonts
int fonts_used_load; // total time spent loading fonts that are
// really used
int glyphs_load; // total time spent loading glyphs
unsigned int requested_size;
unsigned int real_size;
unsigned int unused_size;
unsigned int fonts_loaded; /* number of loaded fonts */
unsigned int fonts_unused; /* number of loaded fonts without reference
* 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;
};