testing: Swith up_perf_xxx to perf_xxx
follow up the the kernel change: https://github.com/apache/nuttx/pull/10834 Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
This commit is contained in:
parent
e65a4500e8
commit
f2fcbe7ccf
@ -47,11 +47,11 @@
|
||||
do \
|
||||
{ \
|
||||
struct timespec ts; \
|
||||
up_perf_convert(cost, &ts); \
|
||||
perf_convert(cost, &ts); \
|
||||
cost = ts.tv_sec * 1000000000 + ts.tv_nsec; \
|
||||
} while (0)
|
||||
|
||||
#define TIMESTAMP(x) (x) = up_perf_gettime()
|
||||
#define TIMESTAMP(x) (x) = perf_gettime()
|
||||
#else
|
||||
#define TIME time_t
|
||||
|
||||
|
@ -187,19 +187,19 @@ int arch_libc_test_strcpy(void)
|
||||
* Name: arch_libc_strcpy_speed_offset
|
||||
****************************************************************************/
|
||||
|
||||
uint32_t arch_libc_strcpy_speed_offset(int dst_offset, int src_offset)
|
||||
clock_t arch_libc_strcpy_speed_offset(int dst_offset, int src_offset)
|
||||
{
|
||||
FAR char *dest;
|
||||
FAR char *src;
|
||||
uint32_t start;
|
||||
uint32_t end;
|
||||
clock_t start;
|
||||
clock_t end;
|
||||
|
||||
init_short_test_str(dst_offset, src_offset);
|
||||
dest = g_test_dst_str + dst_offset;
|
||||
src = g_test_src_str + src_offset;
|
||||
start = up_perf_gettime();
|
||||
start = perf_gettime();
|
||||
strcpy(dest, src);
|
||||
end = up_perf_gettime();
|
||||
end = perf_gettime();
|
||||
|
||||
return end - start;
|
||||
}
|
||||
@ -212,7 +212,7 @@ int arch_libc_strcpy_speed(void)
|
||||
{
|
||||
int dest_off;
|
||||
int src_off;
|
||||
uint32_t cycles = 0;
|
||||
clock_t cycles = 0;
|
||||
|
||||
for (dest_off = 0; dest_off <= 4; dest_off++)
|
||||
{
|
||||
|
@ -44,8 +44,8 @@
|
||||
|
||||
struct performance_time_s
|
||||
{
|
||||
size_t start;
|
||||
size_t end;
|
||||
clock_t start;
|
||||
clock_t end;
|
||||
};
|
||||
|
||||
struct performance_thread_s
|
||||
@ -109,18 +109,18 @@ static int performance_thread_create(FAR void *(*entry)(FAR void *),
|
||||
|
||||
static void performance_start(FAR struct performance_time_s *result)
|
||||
{
|
||||
result->start = up_perf_gettime();
|
||||
result->start = perf_gettime();
|
||||
}
|
||||
|
||||
static void performance_end(FAR struct performance_time_s *result)
|
||||
{
|
||||
result->end = up_perf_gettime();
|
||||
result->end = perf_gettime();
|
||||
}
|
||||
|
||||
static size_t performance_gettime(FAR struct performance_time_s *result)
|
||||
{
|
||||
struct timespec ts;
|
||||
up_perf_convert(result->end - result->start, &ts);
|
||||
perf_convert(result->end - result->start, &ts);
|
||||
return ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec;
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ static size_t context_switch_performance(void)
|
||||
|
||||
static void work_handle(void *arg)
|
||||
{
|
||||
FAR struct performance_time_s *time = ((FAR void **)arg)[0];
|
||||
FAR struct performance_time_s *time = ((FAR void **)arg)[2];
|
||||
FAR sem_t *sem = ((void **)arg)[1];
|
||||
performance_end(time);
|
||||
sem_post(sem);
|
||||
@ -233,7 +233,8 @@ static size_t hpwork_performance(void)
|
||||
FAR void *args = (void *[])
|
||||
{
|
||||
(FAR void *)&work,
|
||||
(FAR void *)&sem
|
||||
(FAR void *)&sem,
|
||||
(FAR void *)&result
|
||||
};
|
||||
|
||||
memset(&work, 0, sizeof(work));
|
||||
|
Loading…
Reference in New Issue
Block a user