Skip to content

Commit

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

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

User visible changes:

- Mark events as (x86 only) in help output for 'perf kvm stat live" (Alexander Yarygin)

- Provide a better explanation when mmap fails in 'trace' (Arnaldo Carvalho de Melo)

- Add --buildid-dir option to set cache directory, i.e. use:

      $ perf --buildid-dir /path/to/dir tool --tool-options

  (Jiri Olsa)

- Fix memcpy/memset 'perf bench' output (Rabin Vicent)

- Fix 'perf test' attr tests size values to cope with machine state on
  interrupt ABI changes (Jiri Olsa)

- Fixup callchain type parameter handling error message (Kan Liang)

Infrastructure changes and cleanups:

- calloc/xcalloc: Fix argument order (Arjun Sreedharan)

- Move filename__read_int from tools/perf/ to tools/lib, add sysctl__read_int
  there and use it in place of ad-hoc copies (Arnaldo Carvalho de Melo)

- Use single strcmp call instead of two (Jiri Olsa)

- Remove extra debugdir variables in 'perf buildid-cache' (Jiri Olsa)

- Fix -a segfault related to kcore handling in 'perf buildid-cache' (Jiri Olsa)

- Move cpumode resolve code to add_callchain_ip (Kan Liang)

- Merge memset into memcpy 'perf bench' (Rabin Vincent)

- Change print format from %lu to %PRIu64 in the hists browser (Tom Huynh)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Dec 12, 2014
2 parents 3459f0d + e09b18d commit 41e950c
Show file tree
Hide file tree
Showing 25 changed files with 350 additions and 501 deletions.
4 changes: 2 additions & 2 deletions scripts/kconfig/mconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ static void set_subtitle(void)
list_for_each_entry(sp, &trail, entries) {
if (sp->text) {
if (pos) {
pos->next = xcalloc(sizeof(*pos), 1);
pos->next = xcalloc(1, sizeof(*pos));
pos = pos->next;
} else {
subtitles = pos = xcalloc(sizeof(*pos), 1);
subtitles = pos = xcalloc(1, sizeof(*pos));
}
pos->text = sp->text;
}
Expand Down
34 changes: 34 additions & 0 deletions tools/lib/api/fs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#include <stdlib.h>
#include <string.h>
#include <sys/vfs.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

#include "debugfs.h"
#include "fs.h"
Expand Down Expand Up @@ -163,3 +167,33 @@ const char *name##__mountpoint(void) \

FS__MOUNTPOINT(sysfs, FS__SYSFS);
FS__MOUNTPOINT(procfs, FS__PROCFS);

int filename__read_int(const char *filename, int *value)
{
char line[64];
int fd = open(filename, O_RDONLY), err = -1;

if (fd < 0)
return -1;

if (read(fd, line, sizeof(line)) > 0) {
*value = atoi(line);
err = 0;
}

close(fd);
return err;
}

int sysctl__read_int(const char *sysctl, int *value)
{
char path[PATH_MAX];
const char *procfs = procfs__mountpoint();

if (!procfs)
return -1;

snprintf(path, sizeof(path), "%s/sys/%s", procfs, sysctl);

return filename__read_int(path, value);
}
3 changes: 3 additions & 0 deletions tools/lib/api/fs/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@

const char *sysfs__mountpoint(void);
const char *procfs__mountpoint(void);

int filename__read_int(const char *filename, int *value);
int sysctl__read_int(const char *sysctl, int *value);
#endif /* __API_FS__ */
4 changes: 4 additions & 0 deletions tools/perf/Documentation/perf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ OPTIONS
--debug verbose # sets verbose = 1
--debug verbose=2 # sets verbose = 2

--buildid-dir::
Setup buildid cache directory. It has higher priority than
buildid.dir config file option.

DESCRIPTION
-----------
Performance counters for Linux are a new kernel-based subsystem
Expand Down
1 change: 0 additions & 1 deletion tools/perf/Makefile.perf
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy-x86-64-asm.o
BUILTIN_OBJS += $(OUTPUT)bench/mem-memset-x86-64-asm.o
endif
BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o
BUILTIN_OBJS += $(OUTPUT)bench/mem-memset.o
BUILTIN_OBJS += $(OUTPUT)bench/futex-hash.o
BUILTIN_OBJS += $(OUTPUT)bench/futex-wake.o
BUILTIN_OBJS += $(OUTPUT)bench/futex-requeue.o
Expand Down
Loading

0 comments on commit 41e950c

Please sign in to comment.