* Backtrace of every the threads @ 2016-02-10 9:05 Ricardo Ribalda Delgado 2016-02-10 9:20 ` Anupam Kapoor 0 siblings, 1 reply; 9+ messages in thread From: Ricardo Ribalda Delgado @ 2016-02-10 9:05 UTC (permalink / raw) To: kernelnewbies Hello I have been debugging a process that makes a syscall which never returned. The problem was the interaction between than process and other kernel threads, due to an error on the way the locks were designed (my bad). Luckily, the error is gone now :). but I was wondering if there is a way to show the backtrace of ALL the threads in the system, which could have been a wonderful tool to debug this issue. Things that I tried and NOT worked: 1) perf top: It is fast and easy if the tasks are in active loops, but if they are sleeping, waiting for an event, holding a lock.... they will not appear. 2) ftrace works, but there are MILLIONS of lines to navigate :S Unless there is a good way to navigate the data it is a "last resource" tool. 3) gdb vmlinux /proc/kcore; info threads I had big hopes on this... but only one thread was showed. Are the Linux awareness gdb extensions ready? 4) sysrq, print backtrace It only shows the active threads, not the "waiting" ones What I want? A magic command that shows the backtrace of ALL the threads (kernel and userland). Something like a ps with steroids. Does this exist? Where would be the best place to start developing something like this: perf people, unix-utils, systemd :S , alone in a dark basement? Thanks! -- Ricardo Ribalda ^ permalink raw reply [flat|nested] 9+ messages in thread
* Backtrace of every the threads 2016-02-10 9:05 Backtrace of every the threads Ricardo Ribalda Delgado @ 2016-02-10 9:20 ` Anupam Kapoor 2016-02-10 9:36 ` Ricardo Ribalda Delgado 0 siblings, 1 reply; 9+ messages in thread From: Anupam Kapoor @ 2016-02-10 9:20 UTC (permalink / raw) To: kernelnewbies >>>>> [2016-02-10T14:35:33+0530]: "Ricardo Ribalda Delgado" (ricardo-delgado): ,----[ ricardo-delgado ] | Luckily, the error is gone now :). but I was wondering if there is a | way to show the backtrace of ALL the threads in the system, which | could have been a wonderful tool to debug this issue. `---- from the gdb info page: In a multi-threaded program, gdb by default shows the backtrace only for the current thread. To display the backtrace for several or all of the threads, use the command thread apply (see thread apply). For example, if you type thread apply all backtrace, gdb will display the backtrace for all the threads; this is handy when you debug a core dump of a multi-threaded program. hope that's what you are looking for ? -- kind regards anupam ^ permalink raw reply [flat|nested] 9+ messages in thread
* Backtrace of every the threads 2016-02-10 9:20 ` Anupam Kapoor @ 2016-02-10 9:36 ` Ricardo Ribalda Delgado 2016-02-10 10:32 ` Anupam Kapoor 0 siblings, 1 reply; 9+ messages in thread From: Ricardo Ribalda Delgado @ 2016-02-10 9:36 UTC (permalink / raw) To: kernelnewbies Hi Anupam On Wed, Feb 10, 2016 at 10:20 AM, Anupam Kapoor <anupam.kapoor@gmail.com> wrote: > > > In a multi-threaded program, gdb by default shows the backtrace only for > the current thread. To display the backtrace for several or all of the > threads, use the command thread apply (see thread apply). For example, > if you type thread apply all backtrace, gdb will display the backtrace > for all the threads; this is handy when you debug a core dump of a > multi-threaded program. > > hope that's what you are looking for ? Unfortunately not :( But thanks for trying :) Core was generated by `BOOT_IMAGE=/boot/bzImage root=PARTUUID=35F607FE-605D-457B-AE13-5D1099C5F266 roo'. #0 0x0000000000000000 in irq_stack_union () (gdb) (gdb) (gdb) info threads Id Target Id Frame * 1 process 1 0x0000000000000000 in irq_stack_union () (gdb) thread apply all backtrace Thread 1 (process 1): #0 0x0000000000000000 in irq_stack_union () #1 0x0000000000000000 in ?? () (gdb) > > -- > > kind regards > anupam -- Ricardo Ribalda ^ permalink raw reply [flat|nested] 9+ messages in thread
* Backtrace of every the threads 2016-02-10 9:36 ` Ricardo Ribalda Delgado @ 2016-02-10 10:32 ` Anupam Kapoor 2016-02-10 10:56 ` Ricardo Ribalda Delgado 0 siblings, 1 reply; 9+ messages in thread From: Anupam Kapoor @ 2016-02-10 10:32 UTC (permalink / raw) To: kernelnewbies >>>>> [2016-02-10T15:06:30+0530]: "Ricardo Ribalda Delgado" (ricardo-delgado): ,----[ ricardo-delgado ] | Unfortunately not :( But thanks for trying :) `---- seems to work just fine on a trivial program here: < aside: hopefully, i will not be judged too harshly for c++ :) > ,---- | anupam at fatcat cpu-stuff % gdb obj/affine-thread-to-cpu | GNU gdb (GDB) 7.10.1 | Copyright (C) 2015 Free Software Foundation, Inc. | License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | This is free software: you are free to change and redistribute it. | There is NO WARRANTY, to the extent permitted by law. Type "show copying" | and "show warranty" for details. | This GDB was configured as "x86_64-unknown-linux-gnu". | Type "show configuration" for configuration details. | For bug reporting instructions, please see: | <http://www.gnu.org/software/gdb/bugs/>. | Find the GDB manual and other documentation resources online at: | <http://www.gnu.org/software/gdb/documentation/>. | For help, type "help". | Type "apropos word" to search for commands related to "word"... | Reading symbols from obj/affine-thread-to-cpu...done. | (gdb) core core.11717 | warning: core file may not match specified executable file. | [New LWP 11717] | [New LWP 11718] | [New LWP 11720] | [New LWP 11721] | [New LWP 11719] | warning: Could not load shared library symbols for linux-vdso.so.1. | Do you need "set solib-search-path" or "set sysroot"? | [Thread debugging using libthread_db enabled] | Using host libthread_db library "/usr/lib/libthread_db.so.1". | Core was generated by `./obj/affine-thread-to-cpu'. | Program terminated with signal SIGSEGV, Segmentation fault. | #0 0x00007f4a34f9170d in pthread_join () from /usr/lib/libpthread.so.0 | [Current thread is 1 (Thread 0x7f4a3536f740 (LWP 11717))] | (gdb) thread apply all | Please specify a command following the thread ID list | (gdb) thread apply all bt | | Thread 5 (Thread 0x7f4a33b4d700 (LWP 11719)): | #0 0x00007f4a34f9965d in nanosleep () from /usr/lib/libpthread.so.0 | #1 0x0000000000401534 in std::this_thread::sleep_for<long, std::ratio<1l, 1000l> > (__rtime=...) at /usr/include/c++/5.3.0/thread:292 | #2 <lambda()>::operator() (__closure=0x24d8de8) at affine-thread-to-cpu.cpp:27 | #3 std::_Bind_simple<main(int, char**)::<lambda()>()>::_M_invoke<> (this=0x24d8de8) at /usr/include/c++/5.3.0/functional:1531 | #4 std::_Bind_simple<main(int, char**)::<lambda()>()>::operator() (this=0x24d8de8) at /usr/include/c++/5.3.0/functional:1520 | #5 std::thread::_Impl<std::_Bind_simple<main(int, char**)::<lambda()>()> >::_M_run(void) (this=0x24d8dd0) at /usr/include/c++/5.3.0/thread:115 | #6 0x00007f4a34cbff40 in std::(anonymous namespace)::execute_native_thread_routine (__p=<optimized out>) | at /build/gcc/src/gcc-5.3.0/libstdc++-v3/src/c++11/thread.cc:84 | #7 0x00007f4a34f904a4 in start_thread () from /usr/lib/libpthread.so.0 | #8 0x00007f4a3443813d in clone () from /usr/lib/libc.so.6 | | Thread 4 (Thread 0x7f4a32b4b700 (LWP 11721)): | #0 0x00007f4a34f9965d in nanosleep () from /usr/lib/libpthread.so.0 | #1 0x0000000000401534 in std::this_thread::sleep_for<long, std::ratio<1l, 1000l> > (__rtime=...) at /usr/include/c++/5.3.0/thread:292 | #2 <lambda()>::operator() (__closure=0x24d90c8) at affine-thread-to-cpu.cpp:27 | #3 std::_Bind_simple<main(int, char**)::<lambda()>()>::_M_invoke<> (this=0x24d90c8) at /usr/include/c++/5.3.0/functional:1531 | #4 std::_Bind_simple<main(int, char**)::<lambda()>()>::operator() (this=0x24d90c8) at /usr/include/c++/5.3.0/functional:1520 | #5 std::thread::_Impl<std::_Bind_simple<main(int, char**)::<lambda()>()> >::_M_run(void) (this=0x24d90b0) at /usr/include/c++/5.3.0/thread:115 | #6 0x00007f4a34cbff40 in std::(anonymous namespace)::execute_native_thread_routine (__p=<optimized out>) | at /build/gcc/src/gcc-5.3.0/libstdc++-v3/src/c++11/thread.cc:84 | #7 0x00007f4a34f904a4 in start_thread () from /usr/lib/libpthread.so.0 | #8 0x00007f4a3443813d in clone () from /usr/lib/libc.so.6 | | Thread 3 (Thread 0x7f4a3334c700 (LWP 11720)): | #0 0x00007f4a34f9965d in nanosleep () from /usr/lib/libpthread.so.0 | #1 0x0000000000401534 in std::this_thread::sleep_for<long, std::ratio<1l, 1000l> > (__rtime=...) at /usr/include/c++/5.3.0/thread:292 | #2 <lambda()>::operator() (__closure=0x24d8f58) at affine-thread-to-cpu.cpp:27 | #3 std::_Bind_simple<main(int, char**)::<lambda()>()>::_M_invoke<> (this=0x24d8f58) at /usr/include/c++/5.3.0/functional:1531 | #4 std::_Bind_simple<main(int, char**)::<lambda()>()>::operator() (this=0x24d8f58) at /usr/include/c++/5.3.0/functional:1520 | #5 std::thread::_Impl<std::_Bind_simple<main(int, char**)::<lambda()>()> >::_M_run(void) (this=0x24d8f40) at /usr/include/c++/5.3.0/thread:115 | #6 0x00007f4a34cbff40 in std::(anonymous namespace)::execute_native_thread_routine (__p=<optimized out>) | at /build/gcc/src/gcc-5.3.0/libstdc++-v3/src/c++11/thread.cc:84 | #7 0x00007f4a34f904a4 in start_thread () from /usr/lib/libpthread.so.0 | #8 0x00007f4a3443813d in clone () from /usr/lib/libc.so.6 | | Thread 2 (Thread 0x7f4a3434e700 (LWP 11718)): | #0 0x00007f4a34f9965d in nanosleep () from /usr/lib/libpthread.so.0 | #1 0x0000000000401534 in std::this_thread::sleep_for<long, std::ratio<1l, 1000l> > (__rtime=...) at /usr/include/c++/5.3.0/thread:292 | #2 <lambda()>::operator() (__closure=0x24d8c78) at affine-thread-to-cpu.cpp:27 | #3 std::_Bind_simple<main(int, char**)::<lambda()>()>::_M_invoke<> (this=0x24d8c78) at /usr/include/c++/5.3.0/functional:1531 | #4 std::_Bind_simple<main(int, char**)::<lambda()>()>::operator() (this=0x24d8c78) at /usr/include/c++/5.3.0/functional:1520 | #5 std::thread::_Impl<std::_Bind_simple<main(int, char**)::<lambda()>()> >::_M_run(void) (this=0x24d8c60) at /usr/include/c++/5.3.0/thread:115 | #6 0x00007f4a34cbff40 in std::(anonymous namespace)::execute_native_thread_routine (__p=<optimized out>) | at /build/gcc/src/gcc-5.3.0/libstdc++-v3/src/c++11/thread.cc:84 | #7 0x00007f4a34f904a4 in start_thread () from /usr/lib/libpthread.so.0 | #8 0x00007f4a3443813d in clone () from /usr/lib/libc.so.6 | | Thread 1 (Thread 0x7f4a3536f740 (LWP 11717)): | #0 0x00007f4a34f9170d in pthread_join () from /usr/lib/libpthread.so.0 | #1 0x00007f4a34cbfe57 in __gthread_join (__value_ptr=0x0, __threadid=<optimized out>) | at /build/gcc/src/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu/bits/gthr-default.h:668 | #2 std::thread::join (this=this at entry=0x24d8c20) at /build/gcc/src/gcc-5.3.0/libstdc++-v3/src/c++11/thread.cc:107 | #3 0x0000000000401248 in main (argc=<optimized out>, argv=<optimized out>) at affine-thread-to-cpu.cpp:45 | (gdb) | `---- -- kind regards anupam ^ permalink raw reply [flat|nested] 9+ messages in thread
* Backtrace of every the threads 2016-02-10 10:32 ` Anupam Kapoor @ 2016-02-10 10:56 ` Ricardo Ribalda Delgado 2016-02-10 10:59 ` Anupam Kapoor 2016-02-10 13:37 ` Valdis.Kletnieks at vt.edu 0 siblings, 2 replies; 9+ messages in thread From: Ricardo Ribalda Delgado @ 2016-02-10 10:56 UTC (permalink / raw) To: kernelnewbies I did not explain myself well. By thread I mean kernel thread, and user thread. What i want to get is a back trace of ALL the programs running in user and kernel space. Your example is a single program, and the trace ends in userspace. Sorry for the missunderstunding. On Wed, Feb 10, 2016 at 11:32 AM, Anupam Kapoor <anupam.kapoor@gmail.com> wrote: > >>>>>> [2016-02-10T15:06:30+0530]: "Ricardo Ribalda Delgado" (ricardo-delgado): > ,----[ ricardo-delgado ] > | Unfortunately not :( But thanks for trying :) > `---- > seems to work just fine on a trivial program here: > < aside: hopefully, i will not be judged too harshly for c++ :) > > > ,---- > | anupam at fatcat cpu-stuff % gdb obj/affine-thread-to-cpu > | GNU gdb (GDB) 7.10.1 > | Copyright (C) 2015 Free Software Foundation, Inc. > | License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> > | This is free software: you are free to change and redistribute it. > | There is NO WARRANTY, to the extent permitted by law. Type "show copying" > | and "show warranty" for details. > | This GDB was configured as "x86_64-unknown-linux-gnu". > | Type "show configuration" for configuration details. > | For bug reporting instructions, please see: > | <http://www.gnu.org/software/gdb/bugs/>. > | Find the GDB manual and other documentation resources online at: > | <http://www.gnu.org/software/gdb/documentation/>. > | For help, type "help". > | Type "apropos word" to search for commands related to "word"... > | Reading symbols from obj/affine-thread-to-cpu...done. > | (gdb) core core.11717 > | warning: core file may not match specified executable file. > | [New LWP 11717] > | [New LWP 11718] > | [New LWP 11720] > | [New LWP 11721] > | [New LWP 11719] > | warning: Could not load shared library symbols for linux-vdso.so.1. > | Do you need "set solib-search-path" or "set sysroot"? > | [Thread debugging using libthread_db enabled] > | Using host libthread_db library "/usr/lib/libthread_db.so.1". > | Core was generated by `./obj/affine-thread-to-cpu'. > | Program terminated with signal SIGSEGV, Segmentation fault. > | #0 0x00007f4a34f9170d in pthread_join () from /usr/lib/libpthread.so.0 > | [Current thread is 1 (Thread 0x7f4a3536f740 (LWP 11717))] > | (gdb) thread apply all > | Please specify a command following the thread ID list > | (gdb) thread apply all bt > | > | Thread 5 (Thread 0x7f4a33b4d700 (LWP 11719)): > | #0 0x00007f4a34f9965d in nanosleep () from /usr/lib/libpthread.so.0 > | #1 0x0000000000401534 in std::this_thread::sleep_for<long, std::ratio<1l, 1000l> > (__rtime=...) at /usr/include/c++/5.3.0/thread:292 > | #2 <lambda()>::operator() (__closure=0x24d8de8) at affine-thread-to-cpu.cpp:27 > | #3 std::_Bind_simple<main(int, char**)::<lambda()>()>::_M_invoke<> (this=0x24d8de8) at /usr/include/c++/5.3.0/functional:1531 > | #4 std::_Bind_simple<main(int, char**)::<lambda()>()>::operator() (this=0x24d8de8) at /usr/include/c++/5.3.0/functional:1520 > | #5 std::thread::_Impl<std::_Bind_simple<main(int, char**)::<lambda()>()> >::_M_run(void) (this=0x24d8dd0) at /usr/include/c++/5.3.0/thread:115 > | #6 0x00007f4a34cbff40 in std::(anonymous namespace)::execute_native_thread_routine (__p=<optimized out>) > | at /build/gcc/src/gcc-5.3.0/libstdc++-v3/src/c++11/thread.cc:84 > | #7 0x00007f4a34f904a4 in start_thread () from /usr/lib/libpthread.so.0 > | #8 0x00007f4a3443813d in clone () from /usr/lib/libc.so.6 > | > | Thread 4 (Thread 0x7f4a32b4b700 (LWP 11721)): > | #0 0x00007f4a34f9965d in nanosleep () from /usr/lib/libpthread.so.0 > | #1 0x0000000000401534 in std::this_thread::sleep_for<long, std::ratio<1l, 1000l> > (__rtime=...) at /usr/include/c++/5.3.0/thread:292 > | #2 <lambda()>::operator() (__closure=0x24d90c8) at affine-thread-to-cpu.cpp:27 > | #3 std::_Bind_simple<main(int, char**)::<lambda()>()>::_M_invoke<> (this=0x24d90c8) at /usr/include/c++/5.3.0/functional:1531 > | #4 std::_Bind_simple<main(int, char**)::<lambda()>()>::operator() (this=0x24d90c8) at /usr/include/c++/5.3.0/functional:1520 > | #5 std::thread::_Impl<std::_Bind_simple<main(int, char**)::<lambda()>()> >::_M_run(void) (this=0x24d90b0) at /usr/include/c++/5.3.0/thread:115 > | #6 0x00007f4a34cbff40 in std::(anonymous namespace)::execute_native_thread_routine (__p=<optimized out>) > | at /build/gcc/src/gcc-5.3.0/libstdc++-v3/src/c++11/thread.cc:84 > | #7 0x00007f4a34f904a4 in start_thread () from /usr/lib/libpthread.so.0 > | #8 0x00007f4a3443813d in clone () from /usr/lib/libc.so.6 > | > | Thread 3 (Thread 0x7f4a3334c700 (LWP 11720)): > | #0 0x00007f4a34f9965d in nanosleep () from /usr/lib/libpthread.so.0 > | #1 0x0000000000401534 in std::this_thread::sleep_for<long, std::ratio<1l, 1000l> > (__rtime=...) at /usr/include/c++/5.3.0/thread:292 > | #2 <lambda()>::operator() (__closure=0x24d8f58) at affine-thread-to-cpu.cpp:27 > | #3 std::_Bind_simple<main(int, char**)::<lambda()>()>::_M_invoke<> (this=0x24d8f58) at /usr/include/c++/5.3.0/functional:1531 > | #4 std::_Bind_simple<main(int, char**)::<lambda()>()>::operator() (this=0x24d8f58) at /usr/include/c++/5.3.0/functional:1520 > | #5 std::thread::_Impl<std::_Bind_simple<main(int, char**)::<lambda()>()> >::_M_run(void) (this=0x24d8f40) at /usr/include/c++/5.3.0/thread:115 > | #6 0x00007f4a34cbff40 in std::(anonymous namespace)::execute_native_thread_routine (__p=<optimized out>) > | at /build/gcc/src/gcc-5.3.0/libstdc++-v3/src/c++11/thread.cc:84 > | #7 0x00007f4a34f904a4 in start_thread () from /usr/lib/libpthread.so.0 > | #8 0x00007f4a3443813d in clone () from /usr/lib/libc.so.6 > | > | Thread 2 (Thread 0x7f4a3434e700 (LWP 11718)): > | #0 0x00007f4a34f9965d in nanosleep () from /usr/lib/libpthread.so.0 > | #1 0x0000000000401534 in std::this_thread::sleep_for<long, std::ratio<1l, 1000l> > (__rtime=...) at /usr/include/c++/5.3.0/thread:292 > | #2 <lambda()>::operator() (__closure=0x24d8c78) at affine-thread-to-cpu.cpp:27 > | #3 std::_Bind_simple<main(int, char**)::<lambda()>()>::_M_invoke<> (this=0x24d8c78) at /usr/include/c++/5.3.0/functional:1531 > | #4 std::_Bind_simple<main(int, char**)::<lambda()>()>::operator() (this=0x24d8c78) at /usr/include/c++/5.3.0/functional:1520 > | #5 std::thread::_Impl<std::_Bind_simple<main(int, char**)::<lambda()>()> >::_M_run(void) (this=0x24d8c60) at /usr/include/c++/5.3.0/thread:115 > | #6 0x00007f4a34cbff40 in std::(anonymous namespace)::execute_native_thread_routine (__p=<optimized out>) > | at /build/gcc/src/gcc-5.3.0/libstdc++-v3/src/c++11/thread.cc:84 > | #7 0x00007f4a34f904a4 in start_thread () from /usr/lib/libpthread.so.0 > | #8 0x00007f4a3443813d in clone () from /usr/lib/libc.so.6 > | > | Thread 1 (Thread 0x7f4a3536f740 (LWP 11717)): > | #0 0x00007f4a34f9170d in pthread_join () from /usr/lib/libpthread.so.0 > | #1 0x00007f4a34cbfe57 in __gthread_join (__value_ptr=0x0, __threadid=<optimized out>) > | at /build/gcc/src/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu/bits/gthr-default.h:668 > | #2 std::thread::join (this=this at entry=0x24d8c20) at /build/gcc/src/gcc-5.3.0/libstdc++-v3/src/c++11/thread.cc:107 > | #3 0x0000000000401248 in main (argc=<optimized out>, argv=<optimized out>) at affine-thread-to-cpu.cpp:45 > | (gdb) > | > `---- > > -- > > kind regards > anupam -- Ricardo Ribalda ^ permalink raw reply [flat|nested] 9+ messages in thread
* Backtrace of every the threads 2016-02-10 10:56 ` Ricardo Ribalda Delgado @ 2016-02-10 10:59 ` Anupam Kapoor 2016-02-10 13:37 ` Valdis.Kletnieks at vt.edu 1 sibling, 0 replies; 9+ messages in thread From: Anupam Kapoor @ 2016-02-10 10:59 UTC (permalink / raw) To: kernelnewbies >>>>> [2016-02-10T16:26:40+0530]: "Ricardo Ribalda Delgado" (ricardo-delgado): ,----[ ricardo-delgado ] | By thread I mean kernel thread, and user thread. | | What i want to get is a back trace of ALL the programs running in user | and kernel space. `---- d.u.d.e :) <backs away slowly> -- kind regards anupam ^ permalink raw reply [flat|nested] 9+ messages in thread
* Backtrace of every the threads 2016-02-10 10:56 ` Ricardo Ribalda Delgado 2016-02-10 10:59 ` Anupam Kapoor @ 2016-02-10 13:37 ` Valdis.Kletnieks at vt.edu 2016-02-11 13:56 ` Ricardo Ribalda Delgado 1 sibling, 1 reply; 9+ messages in thread From: Valdis.Kletnieks at vt.edu @ 2016-02-10 13:37 UTC (permalink / raw) To: kernelnewbies On Wed, 10 Feb 2016 11:56:40 +0100, Ricardo Ribalda Delgado said: > I did not explain myself well. > > By thread I mean kernel thread, and user thread. > > What i want to get is a back trace of ALL the programs running in user > and kernel space. See what happens when you do 'echo t > /proc/sysrq-trigger'. Note that you probably *don't* actually want a trace of *all* tasks (hint - what happens on a large system that has 2,000 cores on it)? What problem are you trying to solve by getting a trace of everything? (Hint - what meaning does a userspace stack traceback have if you're looking at the corresponding kernel stack trace?) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 848 bytes Desc: not available Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160210/5b0ee9ef/attachment.bin ^ permalink raw reply [flat|nested] 9+ messages in thread
* Backtrace of every the threads 2016-02-10 13:37 ` Valdis.Kletnieks at vt.edu @ 2016-02-11 13:56 ` Ricardo Ribalda Delgado 2016-02-11 18:05 ` Valdis.Kletnieks at vt.edu 0 siblings, 1 reply; 9+ messages in thread From: Ricardo Ribalda Delgado @ 2016-02-11 13:56 UTC (permalink / raw) To: kernelnewbies Hi Valdis On Wed, Feb 10, 2016 at 2:37 PM, <Valdis.Kletnieks@vt.edu> wrote: > > See what happens when you do 'echo t > /proc/sysrq-trigger'. This is exactly what I was needing :) I owe you a beer. > > Note that you probably *don't* actually want a trace of *all* tasks (hint - > what happens on a large system that has 2,000 cores on it)? This is a embedded system with "only" 70 process. I agree that on another system this is not the way to debug it. > > What problem are you trying to solve by getting a trace of everything? (Hint - > what meaning does a userspace stack traceback have if you're looking at > the corresponding kernel stack trace?) I was doing: cat /dev/video0 And the open() syscall sometimes was stalling. I wanted to know at what place open() syscall was waiting... The error was due to a wrong locking methodology (in my code) Thanks again! -- Ricardo Ribalda ^ permalink raw reply [flat|nested] 9+ messages in thread
* Backtrace of every the threads 2016-02-11 13:56 ` Ricardo Ribalda Delgado @ 2016-02-11 18:05 ` Valdis.Kletnieks at vt.edu 0 siblings, 0 replies; 9+ messages in thread From: Valdis.Kletnieks at vt.edu @ 2016-02-11 18:05 UTC (permalink / raw) To: kernelnewbies On Thu, 11 Feb 2016 14:56:32 +0100, Ricardo Ribalda Delgado said: > > What problem are you trying to solve by getting a trace of everything? (Hint - > > what meaning does a userspace stack traceback have if you're looking at > > the corresponding kernel stack trace?) > > I was doing: > > cat /dev/video0 > > And the open() syscall sometimes was stalling. > > I wanted to know at what place open() syscall was waiting... You can find *that* out by doing a 'cat /proc/NNNN/stack' for NNNN == process id. No need to find *all* the stack traces for that. :) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 848 bytes Desc: not available Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160211/9247d273/attachment.bin ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-02-11 18:05 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-02-10 9:05 Backtrace of every the threads Ricardo Ribalda Delgado 2016-02-10 9:20 ` Anupam Kapoor 2016-02-10 9:36 ` Ricardo Ribalda Delgado 2016-02-10 10:32 ` Anupam Kapoor 2016-02-10 10:56 ` Ricardo Ribalda Delgado 2016-02-10 10:59 ` Anupam Kapoor 2016-02-10 13:37 ` Valdis.Kletnieks at vt.edu 2016-02-11 13:56 ` Ricardo Ribalda Delgado 2016-02-11 18:05 ` Valdis.Kletnieks at vt.edu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).