mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
note: merge nc_systime_nsec and sec
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
@@ -224,9 +224,6 @@ static void note_common(FAR struct tcb_s *tcb,
|
|||||||
FAR struct note_common_s *note,
|
FAR struct note_common_s *note,
|
||||||
uint8_t length, uint8_t type)
|
uint8_t length, uint8_t type)
|
||||||
{
|
{
|
||||||
struct timespec ts;
|
|
||||||
perf_convert(perf_gettime(), &ts);
|
|
||||||
|
|
||||||
/* Save all of the common fields */
|
/* Save all of the common fields */
|
||||||
|
|
||||||
note->nc_length = length;
|
note->nc_length = length;
|
||||||
@@ -244,8 +241,7 @@ static void note_common(FAR struct tcb_s *tcb,
|
|||||||
note->nc_pid = tcb->pid;
|
note->nc_pid = tcb->pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
note->nc_systime_sec = ts.tv_sec;
|
note->nc_systime = perf_gettime();
|
||||||
note->nc_systime_nsec = ts.tv_nsec;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -649,11 +649,11 @@ static int noteram_dump_header(FAR struct lib_outstream_s *s,
|
|||||||
FAR struct note_common_s *note,
|
FAR struct note_common_s *note,
|
||||||
FAR struct noteram_dump_context_s *ctx)
|
FAR struct noteram_dump_context_s *ctx)
|
||||||
{
|
{
|
||||||
|
struct timespec ts;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
long nsec = note->nc_systime_nsec;
|
|
||||||
time_t sec = note->nc_systime_sec;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
perf_convert(note->nc_systime, &ts);
|
||||||
pid = note->nc_pid;
|
pid = note->nc_pid;
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
int cpu = note->nc_cpu;
|
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: ",
|
ret = lib_sprintf(s, "%8s-%-3u [%d] %3" PRIu64 ".%09lu: ",
|
||||||
get_taskname(pid), get_pid(pid), cpu,
|
get_taskname(pid), get_pid(pid), cpu,
|
||||||
(uint64_t)sec, nsec);
|
(uint64_t)ts.tv_sec, ts.tv_nsec);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -320,15 +320,8 @@ struct note_common_s
|
|||||||
uint8_t nc_type; /* See enum note_type_e */
|
uint8_t nc_type; /* See enum note_type_e */
|
||||||
uint8_t nc_priority; /* Thread/task priority */
|
uint8_t nc_priority; /* Thread/task priority */
|
||||||
uint8_t nc_cpu; /* CPU thread/task running on */
|
uint8_t nc_cpu; /* CPU thread/task running on */
|
||||||
pid_t nc_pid; /* ID of the thread/task */
|
pid_t nc_pid; /* ID of the thread/task */
|
||||||
|
clock_t nc_systime; /* Time when note was buffered */
|
||||||
/* Time when note was buffered (sec) */
|
|
||||||
|
|
||||||
time_t nc_systime_sec;
|
|
||||||
|
|
||||||
/* Time when note was buffered (nsec) */
|
|
||||||
|
|
||||||
long nc_systime_nsec;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* This is the specific form of the NOTE_START note */
|
/* This is the specific form of the NOTE_START note */
|
||||||
|
|||||||
Reference in New Issue
Block a user