07 Nov, 2014

1 commit

  • Set a bit and return its old value. Stolen from kernel sources, will be
    used in next patches.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1414363445-22370-1-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

28 Feb, 2014

1 commit

  • When compiling perf tool code with gcc 4.4.7 I'm getting
    following error:

    CC util/session.o
    cc1: warnings being treated as errors
    util/session.c: In function ‘perf_session_deliver_event’:
    tools/perf/util/include/linux/bitops.h:109: error: dereferencing pointer ‘p’ does break strict-aliasing rules
    tools/perf/util/include/linux/bitops.h:101: error: dereferencing pointer ‘p’ does break strict-aliasing rules
    util/session.c:697: note: initialized from here
    tools/perf/util/include/linux/bitops.h:101: note: initialized from here
    make[1]: *** [util/session.o] Error 1
    make: *** [util/session.o] Error 2

    The aliased types here are u64 and unsigned long pointers, which is safe
    for the find_first_bit processing.

    This error shows up for me only for gcc 4.4 on 32bit x86, even for
    -Wstrict-aliasing=3, while newer gcc are quiet and scream here for
    -Wstrict-aliasing={2,1}. Looks like newer gcc changed the rules for
    strict alias warnings.

    The gcc documentation offers workaround for valid aliasing by using
    __may_alias__ attribute:

    http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Type-Attributes.html

    Using this workaround for the find_first_bit function.

    Signed-off-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1393434867-20271-1-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

25 Jan, 2013

1 commit

  • On POWER, the 'perf format parsing' test always fails.

    Looks like it is because memset() is being passed number of longs rather
    than number of bytes. It is interesting that the test always passes on
    my x86 box.

    With this patch, the test passes on POWER and continues to pass on x86.

    Signed-off-by: Sukadev Bhattiprolu
    Acked-by: Jiri Olsa
    Cc: Anton Blanchard
    Cc: Jiri Olsa
    Cc: Paul Mackerras
    Cc: linuxppc-dev@ozlabs.org
    Link: http://lkml.kernel.org/r/20130117172814.GA18882@us.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Sukadev Bhattiprolu
     

11 Sep, 2012

1 commit

  • __WORDSIZE is GLibC-specific and is not defined on all systems or glibc
    versions (e.g. Android's bionic does not define it).

    In file included from util/include/linux/bitmap.h:5:0,
    from util/header.h:10,
    from util/session.h:6,
    from util/build-id.h:4,
    from util/annotate.c:11:
    util/include/linux/bitops.h: In function 'set_bit':
    util/include/linux/bitops.h:25:12: error:
    '__WORDSIZE' undeclared (first use in this function)
    util/include/linux/bitops.h:25:12: note:
    each undeclared identifier is reported only once for each function it appears in
    util/include/linux/bitops.h:23:51: error:
    parameter 'addr' set but not used [-Werror=unused-but-set-parameter]
    util/include/linux/bitops.h: In function 'clear_bit':
    util/include/linux/bitops.h:30:12: error:
    '__WORDSIZE' undeclared (first use in this function)
    util/include/linux/bitops.h:28:53: error:
    parameter 'addr' set but not used [-Werror=unused-but-set-parameter]
    In file included from util/header.h:10:0,
    from util/session.h:6,
    from util/build-id.h:4,
    from util/annotate.c:11:
    util/include/linux/bitmap.h: In function 'bitmap_zero':
    util/include/linux/bitmap.h:22:6: error:
    '__WORDSIZE' undeclared (first use in this function)

    Defining __WORDSIZE in perf's headers if it is not already defined.

    Suggested-by: Peter Zijlstra
    Suggested-by: Pekka Enberg
    Signed-off-by: Irina Tirdea
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Irina Tirdea
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1347315303-29906-4-git-send-email-irina.tirdea@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Irina Tirdea
     

11 Jun, 2012

1 commit

  • Based on Jiri's latest attempt:
    https://lkml.org/lkml/2012/5/16/61

    Basically, adds_features should be byte swapped assuming unsigned
    longs are either 8-bytes (u64) or 4-bytes (u32).

    Fixes 32-bit ppc dumping 64-bit x86 feature data:
    ========
    captured on: Sun May 20 19:23:23 2012
    hostname : nxos-vdc-dev3
    os release : 3.4.0-rc7+
    perf version : 3.4.rc4.137.g978da3
    arch : x86_64
    nrcpus online : 16
    nrcpus avail : 16
    cpudesc : Intel(R) Xeon(R) CPU E5540 @ 2.53GHz
    cpuid : GenuineIntel,6,26,5
    total memory : 24680324 kB
    ...

    Verified 64-bit x86 can still dump feature data for 32-bit ppc.

    Signed-off-by: David Ahern
    Reviewed-by: Jiri Olsa
    Cc: Corey Ashford
    Cc: Frederic Weisbecker
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/4FBBB539.5010805@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

24 Mar, 2012

1 commit

  • This renames for_each_set_bit_cont() to for_each_set_bit_from() because
    it is analogous to list_for_each_entry_from() in list.h rather than
    list_for_each_entry_continue().

    This doesn't remove for_each_set_bit_cont() for now.

    Signed-off-by: Akinobu Mita
    Cc: Robert Richter
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

24 Dec, 2011

1 commit


23 Jan, 2011

1 commit

  • We need the definiton for __always_inline in bitops.h to fix the build
    on distros where it isn't available or compiler.h doesn't get included
    indirectly.

    One of the fixes needed to build perf on RHEL4 systems, for instance.

    Cc: Eric Dumazet
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

27 Nov, 2010

1 commit

  • Collecting build-ids for long running sessions may take a long time
    because it needs to traverse the whole just collected perf.data stream
    of events, marking the DSOs that had hits and then looking for the
    .note.gnu.build-id ELF section.

    For things like the 'trace' tool that records and right away consumes
    the data on systems where its unlikely that the DSOs being monitored
    will change while 'trace' runs, it is desirable to remove build id
    collection, so add a -B/--no-buildid option to perf record to allow such
    use case.

    Longer term we'll avoid all this if we, at DSO load time, in the kernel,
    take advantage of this slow code path to collect the build-id and stash
    it somewhere, so that we can insert it in the PERF_RECORD_MMAP event.

    Reported-by: Thomas Gleixner
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

02 May, 2010

1 commit

  • We need to refactor code to be explicitely shared by the kernel and at
    least the tools/ userspace programs, so, till we do that, copy the bare
    minimum bitmap/bitops code needed by tools/perf.

    Reported-by: "H. Peter Anvin"
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

24 Nov, 2009

1 commit

  • Currently, perf fails to compile on powerpc with this error:

    CC util/header.o
    In file included from util/../perf.h:17,
    from util/header.c:9:
    util/../../../arch/powerpc/include/asm/unistd.h:360:27: error:
    linux/linkage.h: No such file or directory make: ***
    [util/header.o] Error 1

    The reason is that we still have a #define __KERNEL__ in effect
    at the point where gets included, which means we
    get extra stuff that we don't need or want.

    This fixes the problem by undefining __KERNEL__ once we have
    included the file for which we need __KERNEL__ defined.

    Signed-off-by: Paul Mackerras
    Cc: Frederic Weisbecker
    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Paul Mackerras
     

19 Oct, 2009

1 commit