|
proxygen
|
Classes | |
| class | Deadlock |
| class | DiGraph |
| class | MutexType |
Functions | |
| def | strongly_connected_components (G) |
| def | simple_cycles (G) |
| def | find_cycle (graph) |
| def | get_stacktrace (thread_id) |
| def | is_thread_blocked_with_frame (thread_id, top_line, expected_top_line, expected_frame) |
| def | print_cycle (graph, lwp_to_thread_id, cycle) |
| def | get_thread_info () |
| def | get_pthread_mutex_t_owner_and_address (lwp_to_thread_id, thread_lwp) |
| def | get_pthread_rwlock_t_owner_and_address (lwp_to_thread_id, thread_lwp) |
| def | load () |
| def | info () |
| def deadlock.find_cycle | ( | graph | ) |
Looks for a cycle in the graph. If found, returns the first cycle.
If nodes a1, a2, ..., an are in a cycle, then this returns:
[(a1,a2), (a2,a3), ... (an-1,an), (an, a1)]
Otherwise returns an empty list.
Definition at line 213 of file deadlock.py.
References bm.list, and simple_cycles().
Referenced by deadlock.Deadlock.invoke().
| def deadlock.get_pthread_mutex_t_owner_and_address | ( | lwp_to_thread_id, | |
| thread_lwp | |||
| ) |
Finds the thread holding the mutex that this thread is blocked on. Returns a pair of (lwp of thread owning mutex, mutex address), or (None, None) if not found.
Definition at line 342 of file deadlock.py.
References folly::gen.dereference.
| def deadlock.get_pthread_rwlock_t_owner_and_address | ( | lwp_to_thread_id, | |
| thread_lwp | |||
| ) |
If the thread is waiting on a write-locked pthread_rwlock_t, this will
return the pair of:
(lwp of thread that is write-owning the mutex, mutex address)
or (None, None) if not found, or if the mutex is read-locked.
Definition at line 366 of file deadlock.py.
References folly::gen.dereference.
| def deadlock.get_stacktrace | ( | thread_id | ) |
Returns the stack trace for the thread id as a list of strings.
Definition at line 234 of file deadlock.py.
References is_thread_blocked_with_frame(), and folly::gen.split().
Referenced by is_thread_blocked_with_frame().
| def deadlock.get_thread_info | ( | ) |
Returns a pair of: - map of LWP -> thread ID - map of blocked threads LWP -> potential mutex type
Definition at line 313 of file deadlock.py.
References group, and folly::gen.split().
Referenced by deadlock.Deadlock.invoke().
| def deadlock.info | ( | ) |
Definition at line 447 of file deadlock.py.
References load().
Referenced by folly::NestedCommandLineApp.addCommand(), fizz::KeyDerivationImpl< Hash >.blankHash(), folly::EventBaseManager.clearEventBase(), folly::IOBuf.cloneOneAsValue(), fizz::server::AeadTokenCipher< AeadType, HkdfType >.createAead(), folly::IOBuf.decrementRefcount(), folly::AsyncServerSocket.dispatchError(), folly::AsyncServerSocket.dispatchSocket(), folly::NestedCommandLineApp.displayHelp(), folly::NestedCommandLineApp.doRun(), dummy(), duration_to_ts(), folly::IOBuf.freeExtBuffer(), folly::exception_tracer.getCurrentExceptions(), folly::EventBaseManager.getEventBase(), folly::EventBaseManager.getExistingEventBase(), wangle::FilePoller.getFileModData(), folly::IOBuf.IOBuf(), folly.logLevelToString(), folly::IOBuf.markExternallySharedOne(), folly::AsyncServerSocket.nextCallback(), folly::exception_tracer.operator<<(), folly::IOBuf.packFlagsAndSharedInfo(), folly::fibers::StackCache.protectedPages(), folly::Subprocess.readChildErrorPipe(), folly::AsyncServerSocket.removeAcceptCallback(), folly::IOBuf.reserveSlow(), folly::EventBaseManager.setEventBase(), folly::IOBuf.setSharedInfo(), folly.stringToLogLevel(), TEST(), TEST_F(), and fizz::test.TEST_P().
| def deadlock.is_thread_blocked_with_frame | ( | thread_id, | |
| top_line, | |||
| expected_top_line, | |||
| expected_frame | |||
| ) |
Returns True if we found expected_top_line in top_line, and we found the expected_frame in the thread's stack trace.
Definition at line 246 of file deadlock.py.
References folly::gen.any(), and get_stacktrace().
Referenced by deadlock.MutexType.get_mutex_type(), and get_stacktrace().
| def deadlock.load | ( | ) |
Definition at line 441 of file deadlock.py.
Referenced by folly::SharedMutexImpl< true >.applyDeferredReaders(), folly::AtomicHashMap< int64_t, int64_t >.begin(), folly::Bits< T, Traits >.count(), folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >.erase(), non_atomic< T >.exchange(), folly::PicoSpinLock< uintptr_t >.getData(), info(), folly::Bits< T, Traits >.innerGet(), folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >.insertInternal(), folly::MicroSpinLock.lock(), non_atomic< T >.operator T(), non_atomic< T >.operator+=(), runMultiBitTest64(), runMultiBitTest8(), runSignedMultiBitTest8(), runSimpleTest64(), runSimpleTest8(), folly::Bits< T, Traits >.test(), folly::detail::ConcurrentHashMapSegment< KeyType, ValueType, ShardBits, HashFn, KeyEqual, Allocator, Atom, Mutex >::Buckets.unlink_and_reclaim_nodes(), folly::MicroSpinLock.unlock(), and folly::detail::ThreadCachedInts< Tag >::Integer.~Integer().
| def deadlock.print_cycle | ( | graph, | |
| lwp_to_thread_id, | |||
| cycle | |||
| ) |
Prints the threads and mutexes involved in the deadlock.
Definition at line 300 of file deadlock.py.
Referenced by deadlock.Deadlock.invoke().
| def deadlock.simple_cycles | ( | G | ) |
Adapted from networkx: http://networkx.github.io/ Parameters ---------- G : DiGraph Returns ------- cycle_generator: generator A generator that produces elementary cycles of the graph. Each cycle is represented by a list of nodes along the cycle.
Definition at line 143 of file deadlock.py.
References add, bm.list, and strongly_connected_components().
Referenced by find_cycle().
| def deadlock.strongly_connected_components | ( | G | ) |
Adapted from networkx: http://networkx.github.io/
Parameters
----------
G : DiGraph
Returns
-------
comp : generator of sets
A generator of sets of nodes, one for each strongly connected
component of G.
Definition at line 88 of file deadlock.py.
References min.
Referenced by simple_cycles().