[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 5 of 6] xen: sched_sedf: beautify statisics in SEDF



On 22/10/12 15:40, Dario Faggioli wrote:
By gathering all the related fields in a struct (as it is being done
in credit) and using the macros we now have available. No functional
changes involved.

Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>

I'm OK with this as it is, but...

  #ifdef SEDF_STATS
-    if ( EDOM_INFO(d)->block_time_tot != 0 )
-        printk(" pen=%"PRIu64"%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
-               EDOM_INFO(d)->block_time_tot);
-    if ( EDOM_INFO(d)->block_tot != 0 )
+    if ( EDOM_INFO(d)->stats.block_time_tot != 0 )
+        printk(" pen=%"PRIu64"%%", (EDOM_INFO(d)->stats.penalty_time_tot * 
100) /
+               EDOM_INFO(d)->stats.block_time_tot);
+    if ( EDOM_INFO(d)->stats.block_tot != 0 )
          printk("\n   blks=%u sh=%u (%u%%) (shc=%u (%u%%) shex=%i "\
                 "shexsl=%i) l=%u (%u%%) avg: b=%"PRIu64" p=%"PRIu64"",
-               EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_block_tot,
-               (EDOM_INFO(d)->short_block_tot * 100)
-               / EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_cont,
-               (EDOM_INFO(d)->short_cont * 100) / EDOM_INFO(d)->block_tot,
-               EDOM_INFO(d)->pen_extra_blocks,
-               EDOM_INFO(d)->pen_extra_slices,
-               EDOM_INFO(d)->long_block_tot,
-               (EDOM_INFO(d)->long_block_tot * 100) / EDOM_INFO(d)->block_tot,
-               (EDOM_INFO(d)->block_time_tot) / EDOM_INFO(d)->block_tot,
-               (EDOM_INFO(d)->penalty_time_tot) / EDOM_INFO(d)->block_tot);
+               EDOM_INFO(d)->stats.block_tot, 
EDOM_INFO(d)->stats.short_block_tot,
+               (EDOM_INFO(d)->stats.short_block_tot * 100)
+               / EDOM_INFO(d)->stats.block_tot, EDOM_INFO(d)->stats.short_cont,
+               (EDOM_INFO(d)->stats.short_cont * 100) / 
EDOM_INFO(d)->stats.block_tot,
+               EDOM_INFO(d)->stats.pen_extra_blocks,
+               EDOM_INFO(d)->stats.pen_extra_slices,
+               EDOM_INFO(d)->stats.long_block_tot,
+               (EDOM_INFO(d)->stats.long_block_tot * 100) / 
EDOM_INFO(d)->stats.block_tot,
+               (EDOM_INFO(d)->stats.block_time_tot) / 
EDOM_INFO(d)->stats.block_tot,
+               (EDOM_INFO(d)->stats.penalty_time_tot) / 
EDOM_INFO(d)->stats.block_tot);

...wouldn't it be even more beautiful to have a macro for reading stats as well?

Like I said, it's fine as it is, but since you're looking for beauty, I figured I'd point it out. :-)

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.