1. 02 8月, 2016 1 次提交
    • N
      perf tools: Fix build failure on perl script context · b581c01f
      Namhyung Kim 提交于
      On my Archlinux machine, perf faild to build like below:
      
          CC       scripts/perl/Perf-Trace-Util/Context.o
        In file included from /usr/lib/perl5/core/perl/CORE/perl.h:3905:0,
                         from Context.xs:23:
        /usr/lib/perl5/core/perl/CORE/inline.h: In function :
        /usr/lib/perl5/core/perl/CORE/cop.h:612:13: warning: declaration of 'av'
                                        shadows a previous local [-Werror-shadow]
                   AV *av =3D GvAV(PL_defgv);
                       ^
        /usr/lib/perl5/core/perl/CORE/inline.h:526:5: note: in expansion of
                                        macro 'CX_POP_SAVEARRAY'
               CX_POP_SAVEARRAY(cx);
               ^~~~~~~~~~~~~~~~
        In file included from /usr/lib/perl5/core/perl/CORE/perl.h:5853:0,
                         from Context.xs:23:
        /usr/lib/perl5/core/perl/CORE/inline.h:518:9: note:
                                        shadowed declaration is here
               AV *av;
                   ^~
      
      What I did to fix is adding '-Wno-shadow' as the error message said it's
      the cause of the failure.  Since it's from the perl (not perf) code
      base, we don't have the control so I just wanted to ignore the warning
      when compiling perl scripting code.
      
      Committer note:
      
      This also fixes the build on Fedora Rawhide.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20160802024317.31725-1-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b581c01f
  2. 12 2月, 2015 1 次提交
  3. 21 1月, 2015 1 次提交
    • W
      perf scripting perl: Force to use stdbool · 75e0b5f0
      Wang Nan 提交于
      When building perf for arm64 I hit a warning (and be treated as an
      error) like below:
      
       aarch64-oe-linux-gcc -o .../scripts/perl/Perf-Trace-Util/Context.o -c -Wbad-function-cast \
               ... scripts/perl/Perf-Trace-Util/Context.c
      
       In file included from .../usr/lib64/perl/5.14.3/CORE/perl.h:2464:0,
                        from Context.xs:23:
       /.../usr/lib64/perl/5.14.3/CORE/handy.h:108:0: error: "bool" redefined [-Werror]
        #  define bool char
        ^
       In file included from /.../usr/src/kernel/tools/include/linux/types.h:4:0,
                        from /.../usr/src/kernel/arch/arm64/include/uapi/asm/sigcontext.h:19,
      		  from /.../usr/include/bits/sigcontext.h:27,
      		  from /.../usr/include/signal.h:340,
      		  from /.../usr/include/sys/param.h:28,
      		  from /.../usr/lib64/perl/5.14.3/CORE/perl.h:678,
      		  from Context.xs:23:
        /.../usr/lib/aarch64-oe-linux/gcc/aarch64-oe-linux/4.9.2/include/stdbool.h:33:0: note: this is the location of the previous definition
          #define bool _Bool
      
      Looks like the failure is caused by arm64 uapi/asm/sigcontext.h, which
      includes linux/types.h while other archs not.
      
      Current perl consider this problem:
      
      http://perl5.git.perl.org/perl.git/commit/bd31be4baa3ee68abdb92c0db3200efe0fad903b
      
      However there are users which use old version of perl.
      
      This patch includes stdbool.h before Context.xs and define HAS_BOOL to
      prevent perl'e headers define its own 'bool'. Code is learn from perl's
      git tree.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Link: http://lkml.kernel.org/r/1421671397-4659-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      75e0b5f0
  4. 11 7月, 2013 1 次提交
  5. 25 12月, 2010 1 次提交
  6. 14 4月, 2010 1 次提交
    • T
      perf trace/scripting: Add rwtop and sctop scripts · 47902f36
      Tom Zanussi 提交于
      A couple of scripts, one in Python and the other in Perl, that
      demonstrate 'live mode' tracing.  For each, the output of the
      perf event stream is fed continuously to the script, which
      continuously aggregates the data and reports the current results
      every 3 seconds, or at the optionally specified interval.  After
      the current results are displayed, the aggregations are cleared
      and the cycle begins anew.
      
      To run the scripts, simply pipe the output of the 'perf trace
      record' step as input to the corresponding 'perf trace report'
      step, using '-' as the filename to -o and -i:
      
       $ perf trace record sctop -o - | perf trace report sctop -i -
      
      Also adds clear_term() utility functions to the Util.pm and
      Util.py utility modules, for use by any script to clear the
      screen.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: k-keiichi@bx.jp.nec.com
      Cc: acme@ghostprotocols.net
      LKML-Reference: <1270184365-8281-10-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      47902f36
  7. 24 2月, 2010 2 次提交
  8. 30 11月, 2009 2 次提交
  9. 28 11月, 2009 2 次提交
    • T
      perf trace: Add interface to access perf data from Perl handlers · d1b93772
      Tom Zanussi 提交于
      The Perl scripting support for perf trace allows most of a trace
      event's data to be accessed directly as handler arguments, but
      not all of it e.g. the less common fields aren't passed in.  To
      give scripts access to the other fields and/or any other data or
      metadata in the main perf executable that might be useful, a way
      to access the C data in perf from Perl is needed; this patch
      uses the Perl XS facility to do it for the common_xxx event
      fields not passed to handler functions.
      
      Context.pm exports three functions to Perl scripts that access
      fields for the current event by calling back into perf:
      common_pc(), common_flags() and common_lock_depth().  Support
      for common_flags() field values was added to Core.pm and a
      script used to sanity check these and other basic scripting
      features, check-perf-trace.pl, was also added.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: anton@samba.org
      Cc: hch@infradead.org
      LKML-Reference: <1259133352-23685-6-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d1b93772
    • T
      perf trace: Add perf trace scripting support modules for Perl · bcefe12e
      Tom Zanussi 提交于
      Add Perf-Trace-Util Perl module and some scripts that use it.
      Core.pm contains Perl code to define and access flag and
      symbolic fields. Util.pm contains general-purpose utility
      functions.
      
      Also adds some makefile bits to install them in
      libexec/perf-core/scripts/perl (or wherever perfexec_instdir
      points).
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      Cc: anton@samba.org
      Cc: hch@infradead.org
      LKML-Reference: <1259133352-23685-5-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      bcefe12e