diff options
author | Peter Zijlstra <peterz@infradead.org> | 2023-09-17 13:22:17 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2023-11-15 10:15:33 +0100 |
commit | e4ab322fbaaaf84b23d6cb0e3317a7f68baf36dc (patch) | |
tree | 313aa91080f84450341fdab61d504a41e9b52d97 /tools/perf/scripts/python/task-analyzer.py | |
parent | b85ea95d086471afb4ad062012a4d73cd328fa86 (diff) |
cleanup: Add conditional guard support
Adds:
- DEFINE_GUARD_COND() / DEFINE_LOCK_GUARD_1_COND() to extend existing
guards with conditional lock primitives, eg. mutex_trylock(),
mutex_lock_interruptible().
nb. both primitives allow NULL 'locks', which cause the lock to
fail (obviously).
- extends scoped_guard() to not take the body when the the
conditional guard 'fails'. eg.
scoped_guard (mutex_intr, &task->signal_cred_guard_mutex) {
...
}
will only execute the body when the mutex is held.
- provides scoped_cond_guard(name, fail, args...); which extends
scoped_guard() to do fail when the lock-acquire fails.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20231102110706.460851167%40infradead.org
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions