Skip to content

Commit

Permalink
Merge tag 'perf-core-for-mingo-20160715' of git://git.kernel.org/pub/…
Browse files Browse the repository at this point in the history
…scm/linux/kernel/git/acme/linux into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

User visible changes:

 - Allow reading from a backward ring buffer (one setup via sys_perf_event_open()
   with perf_event_attr.write_backward = 1) (Wang Nan)

Infrastructure changes:

 - Fix the build on Android NDK r12b (initially just for ARM), that is now port
   of my perf-build container collection and will get tested prior to sending
   patches upstream (Arnaldo Carvalho de Melo)

 - Add correct header for IPv6 definitions

 - Fix bitsperlong.h fallout (Arnaldo Carvalho de Melo, Peter Zijlstra)

 - Use base 0 (auto) in filename__read_ull(), so that we can handle hex values too (Jiri Olsa)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Jul 16, 2016
2 parents b29c657 + b49364f commit 09211e2
Show file tree
Hide file tree
Showing 22 changed files with 441 additions and 152 deletions.
23 changes: 2 additions & 21 deletions tools/include/asm-generic/bitsperlong.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,12 @@

#include <uapi/asm-generic/bitsperlong.h>

/*
* In the kernel, where this file comes from, we can rely on CONFIG_64BIT,
* here we have to make amends with what the various compilers provides us
* to figure out if we're on a 64-bit machine...
*/
#ifdef __SIZEOF_LONG__
# if __SIZEOF_LONG__ == 8
# define CONFIG_64BIT
# endif
#define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
#else
# ifdef __WORDSIZE
# if __WORDSIZE == 64
# define CONFIG_64BIT
# endif
# else
# error Failed to determine BITS_PER_LONG value
# endif
#define BITS_PER_LONG __WORDSIZE
#endif

#ifdef CONFIG_64BIT
#define BITS_PER_LONG 64
#else
#define BITS_PER_LONG 32
#endif /* CONFIG_64BIT */

#if BITS_PER_LONG != __BITS_PER_LONG
#error Inconsistent word size. Check asm/bitsperlong.h
#endif
Expand Down
11 changes: 11 additions & 0 deletions tools/include/linux/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
# define __always_inline inline __attribute__((always_inline))
#endif

#ifdef __ANDROID__
/*
* FIXME: Big hammer to get rid of tons of:
* "warning: always_inline function might not be inlinable"
*
* At least on android-ndk-r12/platforms/android-24/arch-arm
*/
#undef __always_inline
#define __always_inline inline
#endif

#define __user

#ifndef __attribute_const__
Expand Down
1 change: 1 addition & 0 deletions tools/lib/api/fd/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct fdarray {
struct pollfd *entries;
union {
int idx;
void *ptr;
} *priv;
};

Expand Down
7 changes: 6 additions & 1 deletion tools/lib/api/fs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ int filename__read_int(const char *filename, int *value)
return err;
}

/*
* Parses @value out of @filename with strtoull.
* By using 0 for base, the strtoull detects the
* base automatically (see man strtoull).
*/
int filename__read_ull(const char *filename, unsigned long long *value)
{
char line[64];
Expand All @@ -292,7 +297,7 @@ int filename__read_ull(const char *filename, unsigned long long *value)
return -1;

if (read(fd, line, sizeof(line)) > 0) {
*value = strtoull(line, NULL, 10);
*value = strtoull(line, NULL, 0);
if (*value != ULLONG_MAX)
err = 0;
}
Expand Down
3 changes: 2 additions & 1 deletion tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Frederic Weisbecker gave his permission to relicense the code to
* the Lesser General Public License.
*/
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand All @@ -33,7 +34,7 @@
#include <limits.h>
#include <linux/string.h>

#include <netinet/ip6.h>
#include <netinet/in.h>
#include "event-parse.h"
#include "event-utils.h"

Expand Down
2 changes: 1 addition & 1 deletion tools/objtool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ OBJTOOL_IN := $(OBJTOOL)-in.o

all: $(OBJTOOL)

INCLUDES := -I$(srctree)/tools/include
INCLUDES := -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi
CFLAGS += -Wall -Werror $(EXTRA_WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES)
LDFLAGS += -lelf $(LIBSUBCMD)

Expand Down
2 changes: 1 addition & 1 deletion tools/objtool/builtin-check.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ static int add_func_switch_tables(struct objtool_file *file,
struct symbol *func)
{
struct instruction *insn, *prev_jump;
struct rela *text_rela, *rodata_rela, *prev_rela;
struct rela *text_rela, *rodata_rela, *prev_rela = NULL;
int ret;

prev_jump = NULL;
Expand Down
22 changes: 22 additions & 0 deletions tools/perf/Documentation/perf-record.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,28 @@ options.
'perf record --dry-run -e' can act as a BPF script compiler if llvm.dump-obj
in config file is set to true.

--tail-synthesize::
Instead of collecting non-sample events (for example, fork, comm, mmap) at
the beginning of record, collect them during finalizing an output file.
The collected non-sample events reflects the status of the system when
record is finished.

--overwrite::
Makes all events use an overwritable ring buffer. An overwritable ring
buffer works like a flight recorder: when it gets full, the kernel will
overwrite the oldest records, that thus will never make it to the
perf.data file.

When '--overwrite' and '--switch-output' are used perf records and drops
events until it receives a signal, meaning that something unusual was
detected that warrants taking a snapshot of the most current events,
those fitting in the ring buffer at that moment.

'overwrite' attribute can also be set or canceled for an event using
config terms. For example: 'cycles/overwrite/' and 'instructions/no-overwrite/'.

Implies --tail-synthesize.

SEE ALSO
--------
linkperf:perf-stat[1], linkperf:perf-list[1]
Loading

0 comments on commit 09211e2

Please sign in to comment.