scheduler-tools / rt-app

rt-app emulates typical mobile and real-time systems use cases and gives runtime information
GNU General Public License v2.0
125 stars 102 forks source link

Print in the log file the core used #106

Closed TKingu closed 4 years ago

TKingu commented 4 years ago

Hi, I've tried to modify your code in order to print, in the log file, the core in which threads run at every loop. In "run" function I inserted this : ldata->cpu = atoi(tdata->curr_cpu_data->cpuset_str); and this in "thread_body": curr_timing->cpu = ldata.cpu; I also modified data structures, to insert "cpu" field.

I thought the current core information was in the "curr_cpu_data" variable, but printing it I got a different core from the ftrace trace file.

I'd like to ask you if the information about the core in which threads run at every loop are stored somewhere in yout code.

Many thanks for the help.

TKingu commented 4 years ago

Hi, I've found a way to log it by using a getcpu system call. Thanks.