mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 10:46:02 +08:00
clock: replace all up_perf_xx with perf_xx
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com> Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Mateusz Szafoni
parent
b99820744c
commit
ddb87d3b86
@@ -234,20 +234,13 @@ static void note_common(FAR struct tcb_s *tcb,
|
||||
FAR struct note_common_s *note,
|
||||
uint8_t length, uint8_t type)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT
|
||||
struct timespec perftime;
|
||||
#endif
|
||||
struct timespec ts;
|
||||
clock_systime_timespec(&ts);
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT
|
||||
up_perf_convert(up_perf_gettime(), &perftime);
|
||||
ts.tv_nsec = perftime.tv_nsec;
|
||||
#endif
|
||||
perf_convert(perf_gettime(), &ts);
|
||||
|
||||
/* Save all of the common fields */
|
||||
|
||||
note->nc_length = length;
|
||||
note->nc_type = type;
|
||||
note->nc_length = length;
|
||||
note->nc_type = type;
|
||||
|
||||
if (tcb == NULL)
|
||||
{
|
||||
|
||||
@@ -41,11 +41,7 @@ struct notesnap_chunk_s
|
||||
uint8_t cpu;
|
||||
#endif
|
||||
pid_t pid;
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT
|
||||
unsigned long count;
|
||||
#else
|
||||
struct timespec time;
|
||||
#endif
|
||||
clock_t count;
|
||||
uintptr_t args;
|
||||
};
|
||||
|
||||
@@ -216,11 +212,7 @@ static inline void notesnap_common(FAR struct note_driver_s *drv,
|
||||
#ifdef CONFIG_SMP
|
||||
note->cpu = tcb->cpu;
|
||||
#endif
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT
|
||||
note->count = up_perf_gettime();
|
||||
#else
|
||||
clock_systime_timespec(¬e->time);
|
||||
#endif
|
||||
note->count = perf_gettime();
|
||||
note->pid = tcb->pid;
|
||||
note->args = args;
|
||||
}
|
||||
@@ -379,14 +371,11 @@ void notesnap_dump_with_stream(FAR struct lib_outstream_s *stream)
|
||||
{
|
||||
size_t i;
|
||||
size_t index = g_notesnap.index % CONFIG_DRIVERS_NOTESNAP_NBUFFERS;
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT
|
||||
uint32_t lastcount = g_notesnap.buffer[index].count;
|
||||
clock_t lastcount = g_notesnap.buffer[index].count;
|
||||
struct timespec lasttime =
|
||||
{
|
||||
0
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Stop recording while dumping */
|
||||
|
||||
@@ -397,15 +386,13 @@ void notesnap_dump_with_stream(FAR struct lib_outstream_s *stream)
|
||||
{
|
||||
FAR struct notesnap_chunk_s *note = &g_notesnap.buffer[i];
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT
|
||||
struct timespec time;
|
||||
unsigned long elapsed = note->count < lastcount ?
|
||||
note->count + UINT32_MAX - lastcount :
|
||||
note->count - lastcount;
|
||||
up_perf_convert(elapsed, &time);
|
||||
clock_t elapsed = note->count < lastcount ?
|
||||
note->count + CLOCK_MAX - lastcount :
|
||||
note->count - lastcount;
|
||||
perf_convert(elapsed, &time);
|
||||
clock_timespec_add(&lasttime, &time, &lasttime);
|
||||
lastcount = note->count;
|
||||
#endif
|
||||
|
||||
lib_sprintf(stream,
|
||||
"snapshoot: [%u.%09u] "
|
||||
@@ -413,12 +400,8 @@ void notesnap_dump_with_stream(FAR struct lib_outstream_s *stream)
|
||||
"[CPU%d] "
|
||||
#endif
|
||||
"[%d] %-16s %#" PRIxPTR "\n",
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT
|
||||
(unsigned)lasttime.tv_sec,
|
||||
(unsigned)lasttime.tv_nsec,
|
||||
#else
|
||||
(unsigned)note->time.tv_sec, (unsigned)note->time.tv_nsec,
|
||||
#endif
|
||||
#ifdef CONFIG_SMP
|
||||
note->cpu,
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user