MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / cmd_cpu_bind

Function cmd_cpu_bind

components/lwp/lwp_pid.c:2293–2307  ·  view source on GitHub ↗

* @brief Command handler for CPU binding operation * * @param[in] argc Number of command arguments * @param[in] argv Array of command argument strings * * @note Requires exactly 2 arguments: pid (process ID) and cpu (CPU core number) */

Source from the content-addressed store, hash-verified

2291 * @note Requires exactly 2 arguments: pid (process ID) and cpu (CPU core number)
2292 */
2293static void cmd_cpu_bind(int argc, char** argv)
2294{
2295 int pid;
2296 int cpu;
2297
2298 if (argc < 3)
2299 {
2300 rt_kprintf("Useage: cpu_bind pid cpu\n");
2301 return;
2302 }
2303
2304 pid = atoi(argv[1]);
2305 cpu = atoi(argv[2]);
2306 lwp_setaffinity((pid_t)pid, cpu);
2307}
2308MSH_CMD_EXPORT_ALIAS(cmd_cpu_bind, cpu_bind, set a process bind to a cpu);
2309#endif

Callers

nothing calls this directly

Calls 2

rt_kprintfFunction · 0.85
lwp_setaffinityFunction · 0.85

Tested by

no test coverage detected