From 350f88dc6e8e5dc86a875796a938529ebbe8d549 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 10 Mar 2014 10:20:40 +0100 Subject: sapi: Add SMP lock profiling app. level data --- cpukit/sapi/src/profilingreportxml.c | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'cpukit/sapi/src/profilingreportxml.c') diff --git a/cpukit/sapi/src/profilingreportxml.c b/cpukit/sapi/src/profilingreportxml.c index 409fe3d7eb..8ca6971f16 100644 --- a/cpukit/sapi/src/profilingreportxml.c +++ b/cpukit/sapi/src/profilingreportxml.c @@ -130,6 +130,81 @@ static void report_per_cpu(context *ctx, const rtems_profiling_per_cpu *per_cpu) update_retval(ctx, rv); } +static void report_smp_lock(context *ctx, const rtems_profiling_smp_lock *smp_lock) +{ + rtems_profiling_printf printf_func = ctx->printf_func; + void *printf_arg = ctx->printf_arg; + int rv; + uint32_t i; + + indent(ctx, 1); + rv = (*printf_func)( + printf_arg, + "\n", + smp_lock->name + ); + update_retval(ctx, rv); + + indent(ctx, 2); + rv = (*printf_func)( + printf_arg, + "%" PRIu32 "\n", + smp_lock->max_acquire_time + ); + update_retval(ctx, rv); + + indent(ctx, 2); + rv = (*printf_func)( + printf_arg, + "%" PRIu32 "\n", + smp_lock->max_section_time + ); + update_retval(ctx, rv); + + indent(ctx, 2); + rv = (*printf_func)( + printf_arg, + "%" PRIu64 "\n", + smp_lock->usage_count + ); + update_retval(ctx, rv); + + indent(ctx, 2); + rv = (*printf_func)( + printf_arg, + "%" PRIu64 "\n", + smp_lock->total_acquire_time + ); + update_retval(ctx, rv); + + indent(ctx, 2); + rv = (*printf_func)( + printf_arg, + "%" PRIu64 "\n", + smp_lock->total_section_time + ); + update_retval(ctx, rv); + + for (i = 0; i < RTEMS_PROFILING_SMP_LOCK_CONTENTION_COUNTS; ++i) { + indent(ctx, 2); + rv = (*printf_func)( + printf_arg, + "%" + PRIu64 "\n", + i, + smp_lock->contention_counts[i] + ); + update_retval(ctx, rv); + } + + indent(ctx, 1); + rv = (*printf_func)( + printf_arg, + "\n" + ); + update_retval(ctx, rv); +} + static void report(void *arg, const rtems_profiling_data *data) { context *ctx = arg; @@ -138,6 +213,9 @@ static void report(void *arg, const rtems_profiling_data *data) case RTEMS_PROFILING_PER_CPU: report_per_cpu(ctx, &data->per_cpu); break; + case RTEMS_PROFILING_SMP_LOCK: + report_smp_lock(ctx, &data->smp_lock); + break; } } -- cgit v1.2.3