note: merge nc_systime_nsec and sec
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
parent
0be1196046
commit
c018be66bd
|
@ -224,9 +224,6 @@ static void note_common(FAR struct tcb_s *tcb,
|
|||
FAR struct note_common_s *note,
|
||||
uint8_t length, uint8_t type)
|
||||
{
|
||||
struct timespec ts;
|
||||
perf_convert(perf_gettime(), &ts);
|
||||
|
||||
/* Save all of the common fields */
|
||||
|
||||
note->nc_length = length;
|
||||
|
@ -244,8 +241,7 @@ static void note_common(FAR struct tcb_s *tcb,
|
|||
note->nc_pid = tcb->pid;
|
||||
}
|
||||
|
||||
note->nc_systime_sec = ts.tv_sec;
|
||||
note->nc_systime_nsec = ts.tv_nsec;
|
||||
note->nc_systime = perf_gettime();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -649,11 +649,11 @@ static int noteram_dump_header(FAR struct lib_outstream_s *s,
|
|||
FAR struct note_common_s *note,
|
||||
FAR struct noteram_dump_context_s *ctx)
|
||||
{
|
||||
struct timespec ts;
|
||||
pid_t pid;
|
||||
long nsec = note->nc_systime_nsec;
|
||||
time_t sec = note->nc_systime_sec;
|
||||
int ret;
|
||||
|
||||
perf_convert(note->nc_systime, &ts);
|
||||
pid = note->nc_pid;
|
||||
#ifdef CONFIG_SMP
|
||||
int cpu = note->nc_cpu;
|
||||
|
@ -663,7 +663,7 @@ static int noteram_dump_header(FAR struct lib_outstream_s *s,
|
|||
|
||||
ret = lib_sprintf(s, "%8s-%-3u [%d] %3" PRIu64 ".%09lu: ",
|
||||
get_taskname(pid), get_pid(pid), cpu,
|
||||
(uint64_t)sec, nsec);
|
||||
(uint64_t)ts.tv_sec, ts.tv_nsec);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -321,14 +321,7 @@ struct note_common_s
|
|||
uint8_t nc_priority; /* Thread/task priority */
|
||||
uint8_t nc_cpu; /* CPU thread/task running on */
|
||||
pid_t nc_pid; /* ID of the thread/task */
|
||||
|
||||
/* Time when note was buffered (sec) */
|
||||
|
||||
time_t nc_systime_sec;
|
||||
|
||||
/* Time when note was buffered (nsec) */
|
||||
|
||||
long nc_systime_nsec;
|
||||
clock_t nc_systime; /* Time when note was buffered */
|
||||
};
|
||||
|
||||
/* This is the specific form of the NOTE_START note */
|
||||
|
|
Loading…
Reference in New Issue