Skip to content

Commit e8c44d3

Browse files
author
Daniel Bristot de Oliveira
committed
rtla/timerlat: Do not stop user-space if a cpu is offline
If no CPU list is passed, timerlat in user-space will dispatch one thread per sysconf(_SC_NPROCESSORS_CONF). However, not all CPU might be available, for instance, if HT is disabled. Currently, rtla timerlat is stopping the session if an user-space thread cannot set affinity to a CPU, or if a running user-space thread is killed. However, this is too restrictive. So, reduce the error to a debug message, and rtla timerlat run as long as there is at least one user-space thread alive. Link: https://lore.kernel.org/lkml/59cf2c882900ab7de91c6ee33b382ac7fa6b4ed0.1694781909.git.bristot@kernel.org Fixes: cdca4f4 ("rtla/timerlat_top: Add timerlat user-space support") Signed-off-by: Daniel Bristot de Oliveira <[email protected]>
1 parent 301deca commit e8c44d3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/tracing/rtla/src/timerlat_u.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static int timerlat_u_main(int cpu, struct timerlat_u_params *params)
4545

4646
retval = sched_setaffinity(gettid(), sizeof(set), &set);
4747
if (retval == -1) {
48-
err_msg("Error setting user thread affinity\n");
48+
debug_msg("Error setting user thread affinity %d, is the CPU online?\n", cpu);
4949
exit(1);
5050
}
5151

@@ -193,7 +193,9 @@ void *timerlat_u_dispatcher(void *data)
193193
procs_count--;
194194
}
195195
}
196-
break;
196+
197+
if (!procs_count)
198+
break;
197199
}
198200

199201
sleep(1);

0 commit comments

Comments
 (0)