Changeset 8365ad1 in rtems for cpukit/sapi


Ignore:
Timestamp:
Apr 22, 2014, 9:46:10 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
aea93fb4
Parents:
7c0bd74
git-author:
Sebastian Huber <sebastian.huber@…> (04/22/14 09:46:10)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/28/14 07:26:19)
Message:

sapi: Add arithmetic means to XML profiling report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/src/profilingreportxml.c

    r7c0bd74 r8365ad1  
    5050}
    5151
     52static uint64_t arithmetic_mean(uint64_t total, uint64_t count)
     53{
     54  return count != 0 ? total / count : 0;
     55}
     56
    5257static void report_per_cpu(context *ctx, const rtems_profiling_per_cpu *per_cpu)
    5358{
     
    7681  rv = (*printf_func)(
    7782    printf_arg,
    78     "<ThreadDispatchDisabledCount>%" PRIu64 "</ThreadDispatchDisabledCount>\n",
    79     per_cpu->thread_dispatch_disabled_count
     83    "<MeanThreadDispatchDisabledTime unit=\"ns\">%" PRIu64
     84      "</MeanThreadDispatchDisabledTime>\n",
     85    arithmetic_mean(
     86      per_cpu->total_thread_dispatch_disabled_time,
     87      per_cpu->thread_dispatch_disabled_count
     88    )
    8089  );
    8190  update_retval(ctx, rv);
     
    93102  rv = (*printf_func)(
    94103    printf_arg,
     104    "<ThreadDispatchDisabledCount>%" PRIu64 "</ThreadDispatchDisabledCount>\n",
     105    per_cpu->thread_dispatch_disabled_count
     106  );
     107  update_retval(ctx, rv);
     108
     109  indent(ctx, 2);
     110  rv = (*printf_func)(
     111    printf_arg,
     112    "<MaxInterruptDelay unit=\"ns\">%" PRIu32 "</MaxInterruptDelay>\n",
     113    per_cpu->max_interrupt_delay
     114  );
     115  update_retval(ctx, rv);
     116
     117  indent(ctx, 2);
     118  rv = (*printf_func)(
     119    printf_arg,
    95120    "<MaxInterruptTime unit=\"ns\">%" PRIu32
    96121      "</MaxInterruptTime>\n",
     
    102127  rv = (*printf_func)(
    103128    printf_arg,
    104     "<MaxInterruptDelay unit=\"ns\">%" PRIu32 "</MaxInterruptDelay>\n",
    105     per_cpu->max_interrupt_delay
     129    "<MeanInterruptTime unit=\"ns\">%" PRIu64
     130      "</MeanInterruptTime>\n",
     131    arithmetic_mean(
     132      per_cpu->total_interrupt_time,
     133      per_cpu->interrupt_count
     134    )
     135  );
     136  update_retval(ctx, rv);
     137
     138  indent(ctx, 2);
     139  rv = (*printf_func)(
     140    printf_arg,
     141    "<TotalInterruptTime unit=\"ns\">%" PRIu64 "</TotalInterruptTime>\n",
     142    per_cpu->total_interrupt_time
    106143  );
    107144  update_retval(ctx, rv);
     
    112149    "<InterruptCount>%" PRIu64 "</InterruptCount>\n",
    113150    per_cpu->interrupt_count
    114   );
    115   update_retval(ctx, rv);
    116 
    117   indent(ctx, 2);
    118   rv = (*printf_func)(
    119     printf_arg,
    120     "<TotalInterruptTime unit=\"ns\">%" PRIu64 "</TotalInterruptTime>\n",
    121     per_cpu->total_interrupt_time
    122151  );
    123152  update_retval(ctx, rv);
     
    165194  rv = (*printf_func)(
    166195    printf_arg,
     196    "<MeanAcquireTime unit=\"ns\">%" PRIu64
     197      "</MeanAcquireTime>\n",
     198    arithmetic_mean(
     199      smp_lock->total_acquire_time,
     200      smp_lock->usage_count
     201    )
     202  );
     203  update_retval(ctx, rv);
     204
     205  indent(ctx, 2);
     206  rv = (*printf_func)(
     207    printf_arg,
     208    "<MeanSectionTime unit=\"ns\">%" PRIu64
     209      "</MeanSectionTime>\n",
     210    arithmetic_mean(
     211      smp_lock->total_section_time,
     212      smp_lock->usage_count
     213    )
     214  );
     215  update_retval(ctx, rv);
     216
     217  indent(ctx, 2);
     218  rv = (*printf_func)(
     219    printf_arg,
     220    "<TotalAcquireTime unit=\"ns\">%" PRIu64 "</TotalAcquireTime>\n",
     221    smp_lock->total_acquire_time
     222  );
     223  update_retval(ctx, rv);
     224
     225  indent(ctx, 2);
     226  rv = (*printf_func)(
     227    printf_arg,
     228    "<TotalSectionTime unit=\"ns\">%" PRIu64 "</TotalSectionTime>\n",
     229    smp_lock->total_section_time
     230  );
     231  update_retval(ctx, rv);
     232
     233  indent(ctx, 2);
     234  rv = (*printf_func)(
     235    printf_arg,
    167236    "<UsageCount>%" PRIu64 "</UsageCount>\n",
    168237    smp_lock->usage_count
    169   );
    170   update_retval(ctx, rv);
    171 
    172   indent(ctx, 2);
    173   rv = (*printf_func)(
    174     printf_arg,
    175     "<TotalAcquireTime unit=\"ns\">%" PRIu64 "</TotalAcquireTime>\n",
    176     smp_lock->total_acquire_time
    177   );
    178   update_retval(ctx, rv);
    179 
    180   indent(ctx, 2);
    181   rv = (*printf_func)(
    182     printf_arg,
    183     "<TotalSectionTime unit=\"ns\">%" PRIu64 "</TotalSectionTime>\n",
    184     smp_lock->total_section_time
    185238  );
    186239  update_retval(ctx, rv);
Note: See TracChangeset for help on using the changeset viewer.