static ssize_t task_switch_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { int val; if (kstrtoint(buf, 10, &val)) return -EINVAL; if (rdr_task_switch_state == val) return (ssize_t)count; if (val > 1) return -EINVAL; if (val == 1) { (void)task_switch_hook_add( (rdr_funcptr_2)dump_task_switch_hook); } else { (void)task_switch_hook_del( (rdr_funcptr_2)dump_task_switch_hook); } rdr_task_switch_state = val; return (ssize_t)count; }
u32 cpu_utilization_end(u8 *pTaskName, double *CPUusage) { /*remove task and interrupt switch hook*/ if ( ERROR == task_switch_hook_del( (FUNC_VOID)cpu_task_swt_hook ) ) { return (u32)-1; } return BSP_OK; }