mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 13:53:33 +08:00
params add param_find perf counter
This commit is contained in:
committed by
Lorenz Meier
parent
ec65ff7c5e
commit
08443c0bfc
@@ -163,6 +163,7 @@ static int reader_lock_holders = 0;
|
|||||||
static px4_sem_t reader_lock_holders_lock; ///< this protects against concurrent access to reader_lock_holders
|
static px4_sem_t reader_lock_holders_lock; ///< this protects against concurrent access to reader_lock_holders
|
||||||
|
|
||||||
static perf_counter_t param_export_perf;
|
static perf_counter_t param_export_perf;
|
||||||
|
static perf_counter_t param_find_perf;
|
||||||
static perf_counter_t param_get_perf;
|
static perf_counter_t param_get_perf;
|
||||||
static perf_counter_t param_set_perf;
|
static perf_counter_t param_set_perf;
|
||||||
|
|
||||||
@@ -232,6 +233,7 @@ param_init(void)
|
|||||||
px4_sem_init(&reader_lock_holders_lock, 0, 1);
|
px4_sem_init(&reader_lock_holders_lock, 0, 1);
|
||||||
|
|
||||||
param_export_perf = perf_alloc(PC_ELAPSED, "param_export");
|
param_export_perf = perf_alloc(PC_ELAPSED, "param_export");
|
||||||
|
param_find_perf = perf_alloc(PC_ELAPSED, "param_find");
|
||||||
param_get_perf = perf_alloc(PC_ELAPSED, "param_get");
|
param_get_perf = perf_alloc(PC_ELAPSED, "param_get");
|
||||||
param_set_perf = perf_alloc(PC_ELAPSED, "param_set");
|
param_set_perf = perf_alloc(PC_ELAPSED, "param_set");
|
||||||
}
|
}
|
||||||
@@ -326,6 +328,8 @@ param_notify_changes(void)
|
|||||||
param_t
|
param_t
|
||||||
param_find_internal(const char *name, bool notification)
|
param_find_internal(const char *name, bool notification)
|
||||||
{
|
{
|
||||||
|
perf_begin(param_find_perf);
|
||||||
|
|
||||||
param_t middle;
|
param_t middle;
|
||||||
param_t front = 0;
|
param_t front = 0;
|
||||||
param_t last = get_param_info_count();
|
param_t last = get_param_info_count();
|
||||||
@@ -341,6 +345,7 @@ param_find_internal(const char *name, bool notification)
|
|||||||
param_set_used_internal(middle);
|
param_set_used_internal(middle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
perf_end(param_find_perf);
|
||||||
return middle;
|
return middle;
|
||||||
|
|
||||||
} else if (middle == front) {
|
} else if (middle == front) {
|
||||||
@@ -355,6 +360,8 @@ param_find_internal(const char *name, bool notification)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
perf_end(param_find_perf);
|
||||||
|
|
||||||
/* not found */
|
/* not found */
|
||||||
return PARAM_INVALID;
|
return PARAM_INVALID;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user