mirror of
https://github.com/apache/nuttx.git
synced 2026-10-04 12:48:09 +00:00
sched: gprof SMP support
In the case of SMP, use smp_call to get other CPU data Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
parent
eb8449cb0c
commit
1b42a7bf84
1 changed files with 17 additions and 2 deletions
|
|
@ -59,9 +59,9 @@ static struct profinfo_s g_prof;
|
|||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static void profil_timer_handler(wdparm_t arg)
|
||||
static int profil_timer_handler_cpu(FAR void *arg)
|
||||
{
|
||||
FAR struct profinfo_s *prof = (FAR struct profinfo_s *)(uintptr_t)arg;
|
||||
FAR struct profinfo_s *prof = (FAR struct profinfo_s *)arg;
|
||||
uintptr_t pc = up_getusrpc(NULL);
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
@ -78,6 +78,21 @@ static void profil_timer_handler(wdparm_t arg)
|
|||
}
|
||||
|
||||
spin_unlock_irqrestore(&prof->lock, flags);
|
||||
return OK;
|
||||
}
|
||||
|
||||
static void profil_timer_handler(wdparm_t arg)
|
||||
{
|
||||
FAR struct profinfo_s *prof = (FAR struct profinfo_s *)(uintptr_t)arg;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
cpu_set_t cpus = (1 << CONFIG_SMP_NCPUS) - 1;
|
||||
CPU_CLR(this_cpu(), &cpus);
|
||||
nxsched_smp_call(cpus, profil_timer_handler_cpu,
|
||||
(FAR void *)arg, false);
|
||||
#endif
|
||||
|
||||
profil_timer_handler_cpu(prof);
|
||||
wd_start(&prof->timer, PROFTICK, profil_timer_handler, arg);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue