From 01e6545054e5289c623ebc255e15dc3727b45065 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 4 Oct 2011 14:17:01 -0400 Subject: [PATCH 1/1] Add unregister measures Signed-off-by: David Goulet --- benchmark/benchmark.c | 23 +++++++++++++++++++++++ benchmark/benchmark.h | 1 + benchmark/measures.h | 6 ++++++ ltt-sessiond/ust-app.c | 6 ++++++ 4 files changed, 36 insertions(+) diff --git a/benchmark/benchmark.c b/benchmark/benchmark.c index 8fbe8ad78..9100fae57 100644 --- a/benchmark/benchmark.c +++ b/benchmark/benchmark.c @@ -150,6 +150,29 @@ no_data: return; } +/* + * Time taken by an UST apps to unregister. + */ +void bench_print_ust_unregister(void) +{ + double res; + + fprintf(fp, "--- UST unregister time ---\n"); + + if (time_ust_unregister_start == 0 || time_ust_unregister_stop == 0) { + goto no_data; + } + + res = get_bench_time(time_ust_unregister_start, time_ust_unregister_stop); + fprintf(fp, "UST unregister time\n"); + fprintf(fp, "Time: %.20f sec.\n", res); + return; + +no_data: + fprintf(fp, "NO DATA\n"); + return; +} + /* * This time value is only coherent is an UST application registered. */ diff --git a/benchmark/benchmark.h b/benchmark/benchmark.h index 2a23fd97e..bbdadbbd8 100644 --- a/benchmark/benchmark.h +++ b/benchmark/benchmark.h @@ -33,6 +33,7 @@ void bench_init(void); void bench_close(void); void bench_print_boot_process(void); void bench_print_ust_register(void); +void bench_print_ust_unregister(void); void bench_print_ust_notification(void); double bench_get_create_session(void); double bench_get_destroy_session(void); diff --git a/benchmark/measures.h b/benchmark/measures.h index 91809e1ac..cbcac2204 100644 --- a/benchmark/measures.h +++ b/benchmark/measures.h @@ -69,6 +69,12 @@ cycles_t time_ust_register_start; */ cycles_t time_ust_register_stop; +/* + * * UST unregister time + * */ +cycles_t time_ust_unregister_start; +cycles_t time_ust_unregister_stop; + /* * UST dispatch registration request time * diff --git a/ltt-sessiond/ust-app.c b/ltt-sessiond/ust-app.c index ea062557e..afd8ea5c0 100644 --- a/ltt-sessiond/ust-app.c +++ b/ltt-sessiond/ust-app.c @@ -28,6 +28,8 @@ #include "ust-app.h" +#include "benchmark.h" + /* Init ust traceable application's list */ static struct ust_app_list ust_app_list = { .head = CDS_LIST_HEAD_INIT(ust_app_list.head), @@ -173,6 +175,8 @@ void ust_app_unregister(int sock) { struct ust_app *lta; + tracepoint(ust_unregister_start); + ust_app_lock_list(); lta = find_app_by_sock(sock); if (lta) { @@ -182,6 +186,8 @@ void ust_app_unregister(int sock) free(lta); } ust_app_unlock_list(); + + tracepoint(ust_unregister_stop); } /* -- 2.34.1