In Linux, in a multi-core processor, ps, top and similar tools can show the CPU logical core id running a specific process. If the process runs for a certain amount of time, it's easy to identify it in the process list.
I have instead a stand-alone program which prints "hello world" and the number of logical core detected from CPU assembly (RDPID instruction):
$ ./hello_world
hello world
1
$
It immediately ends. I would like to compare this number with the one provided by ps, top or similar. So, how to obtain the same information (the CPU logical core id) in this case? How to get the process information while this process is still executing?