<div dir="ltr"><div><div><div>HI All,<br><br></div>             I am new to this group.
 I am working on Freescale P2020 platform running linux 2.6.21.   I am 
looking for debug mechanism/utility, when a multi threaded application 
running on linux , appears to be hung ( running in a tight loop,deadlock)  while not
 able to access the board through serial/SSH/Telnet.<br><br></div>   I 
was looking at Magic sysrq option in linux to generate the stack, 
register dump when the application is hung. I am able to dump the call 
trace in normal working conditions. But i can't use  echo  t > 
/proc/sysrq-trigger and debug when the application hung. <br><br></div> I
 am using below piece of code(drivers/serial/8250.c) on P2020RDB to 
debug the application where in , in hung situation, when i press 'y'  
followed by 't'  on serial console it should go to sysrq handler, and 
dump the call trace, but it is not happening.(simply board hung)<br><div><br>{<br>           if(sysrq_enable_flag) <br>                  handle_sysrq(ch, up->port.info->tty);<br>        <br>        sysrq_enable_flag = 0;<br>
            <br>        if(ch == 'y')<br>            sysrq_enable_flag = 1;<br>}<br><br></div><div>It would be helpful if you provide any hint on the issue, or any other way to debug the application in hang situations.<br>
<br></div>Thanks,<br>Sai<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 16, 2013 at 9:24 PM, Anshuman Khandual <span dir="ltr"><<a href="mailto:khandual@linux.vnet.ibm.com" target="_blank">khandual@linux.vnet.ibm.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">                Branch History Rolling Buffer (BHRB) is a new PMU feaure in IBM<br>
POWER8 processor which records the branch instructions inside the execution<br>
pipeline. This patchset enables the basic functionality of the feature through<br>
generic perf branch stack sampling framework.<br>
<br>
Sample output<br>
-------------<br>
$./perf record -b top<br>
$./perf report<br>
<br>
Overhead  Command  Source Shared Object                           Source Symbol  Target Shared Object                        Target Symbol<br>
# ........  .......  ....................  ......................................  ....................  ...................................<br>
#<br>
<br>
     7.82%      top  <a href="http://libc-2.11.2.so" target="_blank">libc-2.11.2.so</a>        [k] _IO_vfscanf                         <a href="http://libc-2.11.2.so" target="_blank">libc-2.11.2.so</a>        [k] _IO_vfscanf<br>

     6.17%      top  <a href="http://libc-2.11.2.so" target="_blank">libc-2.11.2.so</a>        [k] _IO_vfscanf                         [unknown]             [k] 00000000<br>
     2.37%      top  [unknown]             [k] 0xf7aafb30                          [unknown]             [k] 00000000<br>
     1.80%      top  [unknown]             [k] 0x0fe07978                          <a href="http://libc-2.11.2.so" target="_blank">libc-2.11.2.so</a>        [k] _IO_vfscanf<br>
     1.60%      top  <a href="http://libc-2.11.2.so" target="_blank">libc-2.11.2.so</a>        [k] _IO_vfscanf                         [kernel.kallsyms]     [k] .do_task_stat<br>
     1.20%      top  [kernel.kallsyms]     [k] .do_task_stat                       [kernel.kallsyms]     [k] .do_task_stat<br>
     1.02%      top  <a href="http://libc-2.11.2.so" target="_blank">libc-2.11.2.so</a>        [k] vfprintf                            <a href="http://libc-2.11.2.so" target="_blank">libc-2.11.2.so</a>        [k] vfprintf<br>

     0.92%      top  top                   [k] _init                               [unknown]             [k] 0x0fe037f4<br>
<br>
Changes in V2<br>
--------------<br>
- Added copyright messages to the newly created files<br>
- Modified couple of commit messages<br>
<br>
Anshuman Khandual (5):<br>
  powerpc, perf: Add new BHRB related instructions on POWER8<br>
  powerpc, perf: Add basic assembly code to read BHRB entries on POWER8<br>
  powerpc, perf: Add new BHRB related generic functions, data and flags<br>
  powerpc, perf: Define BHRB generic functions, data and flags for POWER8<br>
  powerpc, perf: Enable branch stack sampling framework support with BHRB<br>
<br>
 arch/powerpc/include/asm/perf_event_server.h |  6 ++<br>
 arch/powerpc/include/asm/ppc-opcode.h        |  7 ++<br>
 arch/powerpc/perf/Makefile                   |  2 +-<br>
 arch/powerpc/perf/bhrb.S                     | 44 +++++++++++++<br>
 arch/powerpc/perf/core-book3s.c              | 96 +++++++++++++++++++++++++++-<br>
 arch/powerpc/perf/perf_event_bhrb.c          | 85 ++++++++++++++++++++++++<br>
 arch/powerpc/perf/power8-pmu.c               | 57 ++++++++++++++++-<br>
 7 files changed, 292 insertions(+), 5 deletions(-)<br>
 create mode 100644 arch/powerpc/perf/bhrb.S<br>
 create mode 100644 arch/powerpc/perf/perf_event_bhrb.c<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.11.7<br>
<br>
_______________________________________________<br>
Linuxppc-dev mailing list<br>
<a href="mailto:Linuxppc-dev@lists.ozlabs.org">Linuxppc-dev@lists.ozlabs.org</a><br>
<a href="https://lists.ozlabs.org/listinfo/linuxppc-dev" target="_blank">https://lists.ozlabs.org/listinfo/linuxppc-dev</a><br>
</font></span></blockquote></div><br></div></div>