Re: [Powertop] segfault on Sheevaplug (ARM Kirkwood)

Rui DaCosta <ruidc at yahoo.com> Tue, 22 May 2012 15:08:14 -0700
Newsgroups dev.linux.lists.powertop
Message-ID <[email protected]>
running:
find / -name unistd.h | xargs /bin/grep __NR_perf_event_open

resulted in output of:

/usr/include/asm/unistd.h:#define __NR_perf_event_open          (__NR_SYSCALL_BASE+364)
/usr/include/asm-generic/unistd.h:#define __NR_perf_event_open 241
/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
/usr/src/linux-3.1.10-11-ARCH/include/asm-generic/unistd.h:#define __NR_perf_event_open 241
/usr/src/linux-3.1.10-11-ARCH/include/asm-generic/unistd.h:__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
/usr/src/linux-3.1.10-11-ARCH/arch/arm/include/asm/unistd.h:#define __NR_perf_event_open                (__NR_SYSCALL_BASE+364)


HTH

Rui



________________________________
 From: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
To: Rui DaCosta <ruidc(a)yahoo.com> 
Cc: Arjan van de Ven <arjan(a)linux.intel.com>; Chris Ferron <chris.e.ferron(a)linux.intel.com>; "powertop(a)lists.01.org" <powertop(a)lists.01.org> 
Sent: Tuesday, 22 May 2012, 23:23
Subject: Re: [Powertop] segfault on Sheevaplug (ARM Kirkwood)
 
On (05/22/12 12:35), Rui DaCosta wrote:
> 
>    thanks, same result:
>    PowerTOP v2.0 needs the kernel to support the 'perf' subsystem
>    as well as support for trace points in the kernel:
> 
>    CONFIG_PERF_EVENTS=y
>    CONFIG_PERF_COUNTERS=y
>    CONFIG_TRACEPOINTS=y
>    CONFIG_TRACING=y
>
>

Hm...
Could you please tell the number of '__NR_perf_event_open' syscall in your
unistd.h?


    -ss


>    Regards,
>    Rui
> 
>    ──────────────────────────────────────────────────────────────────────────
> 
>    From: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
>    To: Rui DaCosta <ruidc(a)yahoo.com>
>    Cc: Arjan van de Ven <arjan(a)linux.intel.com>; Chris Ferron
>    <chris.e.ferron(a)linux.intel.com>; "powertop(a)lists.01.org"
>    <powertop(a)lists.01.org>
>    Sent: Monday, 21 May 2012, 0:17
>    Subject: Re: [Powertop] segfault on Sheevaplug (ARM Kirkwood)
>    On (05/20/12 12:32), Rui DaCosta wrote:
>    >
>    >    it was pointed out to me that  CONFIG_PERF_COUNTERS has been
>    superseded by
>    >    PERF_EVENTS since 2.6.32  - see bottom section of
>    >    [1]http://cateee.net/lkddb/web-lkddb/PERF_COUNTERS.html
>    >    so is  CONFIG_PERF_COUNTERS really required?
>    >
> 
>    Could you please try the following patch?
> 
>    ---
> 
>    src/perf/perf.cpp |    3 +++
>    1 file changed, 3 insertions(+)
> 
>    diff --git a/src/perf/perf.cpp b/src/perf/perf.cpp
>    index ce9ae6a..09ca390 100644
>    --- a/src/perf/perf.cpp
>    +++ b/src/perf/perf.cpp
>    @@ -48,6 +48,9 @@
>    #ifdef __alpha__
>    #include <asm-generic/unistd.h>
>    #endif
>    +#ifdef __arm__
>    +#include <asm-generic/unistd.h>
>    +#endif
> 
>    #include "perf.h"
>    #include "../lib.h"
> 
> References
> 
>    Visible links
>    1. http://cateee.net/lkddb/web-lkddb/PERF_COUNTERS.html
attachment.html (text/html, 5.5 KB)
<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>running:</span></div><div><span>find / -name unistd.h | xargs /bin/grep __NR_perf_event_open</span></div><div><span><br></span></div><div><span>resulted in output of:</span></div><div><span><br>/usr/include/asm/unistd.h:#define __NR_perf_event_open          (__NR_SYSCALL_BASE+364)<br>/usr/include/asm-generic/unistd.h:#define __NR_perf_event_open 241<br>/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_perf_event_open, sys_perf_event_open)<br>/usr/src/linux-3.1.10-11-ARCH/include/asm-generic/unistd.h:#define __NR_perf_event_open 241<br>/usr/src/linux-3.1.10-11-ARCH/include/asm-generic/unistd.h:__SYSCALL(__NR_perf_event_open, sys_perf_event_open)<br>/usr/src/linux-3.1.10-11-ARCH/arch/arm/include/asm/unistd.h:#define __NR_perf_event_open               
 (__NR_SYSCALL_BASE+364)<br></span></div><div><span>HTH<br></span></div><div><span>Rui<br></span></div><div><br></div>  <div style="font-size: 12pt; font-family: &quot;times new roman&quot;, &quot;new york&quot;, &quot;times&quot;, serif"> <div style="font-size: 12pt; font-family: &quot;times new roman&quot;, &quot;new york&quot;, &quot;times&quot;, serif"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Sergey Senozhatsky &lt;[email protected]&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Rui DaCosta &lt;[email protected]&gt; <br><b><span style="font-weight: bold;">Cc:</span></b> Arjan van de Ven &lt;[email protected]&gt;; Chris Ferron &lt;[email protected]&gt;; "[email protected]" &lt;[email protected]&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, 22 May 2012, 23:23<br> <b><span style="font-weight:
 bold;">Subject:</span></b> Re: [Powertop] segfault on Sheevaplug (ARM Kirkwood)<br> </font> </div> <br>On (05/22/12 12:35), Rui DaCosta wrote:<br>&gt; <br>&gt;&nbsp; &nbsp; thanks, same result:<br>&gt;&nbsp; &nbsp; PowerTOP v2.0 needs the kernel to support the 'perf' subsystem<br>&gt;&nbsp; &nbsp; as well as support for trace points in the kernel:<br>&gt; <br>&gt;&nbsp; &nbsp; CONFIG_PERF_EVENTS=y<br>&gt;&nbsp; &nbsp; CONFIG_PERF_COUNTERS=y<br>&gt;&nbsp; &nbsp; CONFIG_TRACEPOINTS=y<br>&gt;&nbsp; &nbsp; CONFIG_TRACING=y<br>&gt;<br>&gt;<br><br>Hm...<br>Could you please tell the number of '__NR_perf_event_open' syscall in your<br>unistd.h?<br><br><br>&nbsp;&nbsp;&nbsp; -ss<br><br><br>&gt;&nbsp; &nbsp; Regards,<br>&gt;&nbsp; &nbsp; Rui<br>&gt; <br>&gt;&nbsp; &nbsp;
 ──────────────────────────────────────────────────────────────────────────<br>&gt; <br>&gt;&nbsp; &nbsp; From: Sergey Senozhatsky &lt;<a ymailto="mailto:[email protected]" href="mailto:[email protected]">[email protected]</a>&gt;<br>&gt;&nbsp; &nbsp; To: Rui DaCosta &lt;<a ymailto="mailto:[email protected]" href="mailto:[email protected]">[email protected]</a>&gt;<br>&gt;&nbsp; &nbsp; Cc: Arjan van de Ven &lt;<a ymailto="mailto:[email protected]" href="mailto:[email protected]">[email protected]</a>&gt;; Chris Ferron<br>&gt;&nbsp; &nbsp; &lt;<a ymailto="mailto:[email protected]" href="mailto:[email protected]">[email protected]</a>&gt;; "<a ymailto="mailto:[email protected]"
 href="mailto:[email protected]">[email protected]</a>"<br>&gt;&nbsp; &nbsp; &lt;<a ymailto="mailto:[email protected]" href="mailto:[email protected]">[email protected]</a>&gt;<br>&gt;&nbsp; &nbsp; Sent: Monday, 21 May 2012, 0:17<br>&gt;&nbsp; &nbsp; Subject: Re: [Powertop] segfault on Sheevaplug (ARM Kirkwood)<br>&gt;&nbsp; &nbsp; On (05/20/12 12:32), Rui DaCosta wrote:<br>&gt;&nbsp; &nbsp; &gt;<br>&gt;&nbsp; &nbsp; &gt;&nbsp; &nbsp; it was pointed out to me that&nbsp; CONFIG_PERF_COUNTERS has been<br>&gt;&nbsp; &nbsp; superseded by<br>&gt;&nbsp; &nbsp; &gt;&nbsp; &nbsp; PERF_EVENTS since 2.6.32 &nbsp;- see bottom section of<br>&gt;&nbsp; &nbsp; &gt;&nbsp; &nbsp; [1]<a href="http://cateee.net/lkddb/web-lkddb/PERF_COUNTERS.html" target="_blank">http://cateee.net/lkddb/web-lkddb/PERF_COUNTERS.html</a><br>&gt;&nbsp; &nbsp; &gt;&nbsp; &nbsp; so is&nbsp; CONFIG_PERF_COUNTERS really required?<br>&gt;&nbsp; &nbsp; &gt;<br>&gt;
 <br>&gt;&nbsp; &nbsp; Could you please try the following patch?<br>&gt; <br>&gt;&nbsp; &nbsp; ---<br>&gt; <br>&gt;&nbsp; &nbsp; src/perf/perf.cpp |&nbsp; &nbsp; 3 +++<br>&gt;&nbsp; &nbsp; 1 file changed, 3 insertions(+)<br>&gt; <br>&gt;&nbsp; &nbsp; diff --git a/src/perf/perf.cpp b/src/perf/perf.cpp<br>&gt;&nbsp; &nbsp; index ce9ae6a..09ca390 100644<br>&gt;&nbsp; &nbsp; --- a/src/perf/perf.cpp<br>&gt;&nbsp; &nbsp; +++ b/src/perf/perf.cpp<br>&gt;&nbsp; &nbsp; @@ -48,6 +48,9 @@<br>&gt;&nbsp; &nbsp; #ifdef __alpha__<br>&gt;&nbsp; &nbsp; #include &lt;asm-generic/unistd.h&gt;<br>&gt;&nbsp; &nbsp; #endif<br>&gt;&nbsp; &nbsp; +#ifdef __arm__<br>&gt;&nbsp; &nbsp; +#include &lt;asm-generic/unistd.h&gt;<br>&gt;&nbsp; &nbsp; +#endif<br>&gt; <br>&gt;&nbsp; &nbsp; #include "perf.h"<br>&gt;&nbsp; &nbsp; #include "../lib.h"<br>&gt; <br>&gt; References<br>&gt; <br>&gt;&nbsp; &nbsp; Visible links<br>&gt;&nbsp; &nbsp; 1. <a
 href="http://cateee.net/lkddb/web-lkddb/PERF_COUNTERS.html" target="_blank">http://cateee.net/lkddb/web-lkddb/PERF_COUNTERS.html</a><br><br><br> </div> </div>  </div></body></html>