diff options
author | Juri Lelli <juri.lelli@gmail.com> | 2013-10-05 13:25:02 +0200 |
---|---|---|
committer | Juri Lelli <juri.lelli@gmail.com> | 2013-10-05 11:26:33 +0200 |
commit | 8707d4521848bd026291bd1da5fbb8ccca22db17 (patch) | |
tree | a541a73f4be2879e6ce66bab4b107016695dfd6b | |
parent | 808b2608ba084eef67f8c2bab1e789a9126ece05 (diff) |
log to ftrace resources access
-rw-r--r-- | src/rt-app.c | 14 | ||||
-rw-r--r-- | src/rt-app_parse_config.c | 10 |
2 files changed, 18 insertions, 6 deletions
diff --git a/src/rt-app.c b/src/rt-app.c index 1a08356..69e169b 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -64,6 +64,10 @@ void run(int ind, struct timespec *min, struct timespec *max, lock = blockages[i].acl; while (lock != NULL) { log_debug("[%d] locking %d", ind, lock->res->index); + if (opts.ftrace) + log_ftrace(ft_data.marker_fd, + "[%d] locking %d", + ind, lock->res->index); pthread_mutex_lock(&lock->res->mtx); last = lock; lock = lock->next; @@ -71,10 +75,18 @@ void run(int ind, struct timespec *min, struct timespec *max, clock_gettime(CLOCK_THREAD_CPUTIME_ID, &now); t_exec = timespec_add(&now, &blockages[i].usage); log_debug("[%d] busywait for %lu", ind, timespec_to_usec(&blockages[i].usage)); + if (opts.ftrace) + log_ftrace(ft_data.marker_fd, + "[%d] busywait for %d", + ind, timespec_to_usec(&blockages[i].usage)); busywait(&t_exec); lock = last; while (lock != NULL) { log_debug("[%d] unlocking %d", ind, lock->res->index); + if (opts.ftrace) + log_ftrace(ft_data.marker_fd, + "[%d] unlocking %d", + ind, lock->res->index); pthread_mutex_unlock(&lock->res->mtx); lock = lock->prev; } @@ -291,7 +303,7 @@ void *thread_body(void *arg) struct timespec t_start, t_end, t_diff, t_slack; if (opts.ftrace) - log_ftrace(ft_data.marker_fd, "[%d] begin loop %d", data->ind, i); + log_ftrace(ft_data.marker_fd, "[%d] begins loop %d", data->ind, i); clock_gettime(CLOCK_MONOTONIC, &t_start); run(data->ind, &data->min_et, &data->max_et, data->blockages, data->nblockages); diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c index 2f8e06e..5783904 100644 --- a/src/rt-app_parse_config.c +++ b/src/rt-app_parse_config.c @@ -91,7 +91,7 @@ assure_type_is(struct json_object *obj, static inline struct json_object* get_in_object(struct json_object *where, const char *what, - json_bool nullable) + boolean nullable) { struct json_object *to; to = json_object_object_get(where, what); @@ -110,7 +110,7 @@ get_in_object(struct json_object *where, static inline int get_int_value_from(struct json_object *where, const char *key, - json_bool have_def, + boolean have_def, int def_value) { struct json_object *value; @@ -127,11 +127,11 @@ get_int_value_from(struct json_object *where, static inline int get_bool_value_from(struct json_object *where, const char *key, - json_bool have_def, + boolean have_def, int def_value) { struct json_object *value; - json_bool b_value; + boolean b_value; value = get_in_object(where, key, have_def); set_default_if_needed(key, value, have_def, def_value); assure_type_is(value, where, key, json_type_boolean); @@ -144,7 +144,7 @@ get_bool_value_from(struct json_object *where, static inline char* get_string_value_from(struct json_object *where, const char *key, - json_bool have_def, + boolean have_def, const char *def_value) { struct json_object *value; |