Skip to content

Commit

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

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

User visible changes:

  - Add 'socket' sort entry, to sort by the processor socket in
    'perf top' and 'perf report'. (Kan Liang)

  - Introduce --socket-filter to 'perf report', for filtering by processor
    socket. (Kan Liang)

  - Add new "Zoom into Processor Socket" operation in the perf hists browser,
    used in 'perf top' and 'perf report'. (Kan Liang)

  - Fix the 'CPU' hist browser column width calculation. (Arnaldo Carvalho de Melo)

Infrastructure changes:

  - 'perf test' fixes for the object code reading entry. (Jan Stancek)

  - Add processor socket and cpu topology 'perf test' entries. (Kan Liang)

  - Introduce more sysfs__read_TYPE() helpers. (Arnaldo Carvalho de Melo)

  - Group cpu information reading functions in tools/lib/api/cpu.[ch],
    starting with cpu__get_max_freq() from a patchkit by Kan Liang.
    (Arnaldo Carvalho de Melo)

  - Retrieve the MSR PMU type from a perf.data file header and store it
    in struct perf_env. (Kan Liang)

  - Add tools/include into CTAGS file list. (Jiri Olsa)

  - Add iterator function for perf tests. (Matt Fleming)

  - Switch to tracing_patch interface. (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 Sep 15, 2015
2 parents 8f3e568 + 92d424a commit 9059b28
Show file tree
Hide file tree
Showing 54 changed files with 700 additions and 555 deletions.
1 change: 1 addition & 0 deletions tools/lib/api/Build
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
libapi-y += fd/
libapi-y += fs/
libapi-y += cpu.o
18 changes: 18 additions & 0 deletions tools/lib/api/cpu.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>

#include "cpu.h"
#include "fs/fs.h"

int cpu__get_max_freq(unsigned long long *freq)
{
char entry[PATH_MAX];
int cpu;

if (sysfs__read_int("devices/system/cpu/online", &cpu) < 0)
return -1;

snprintf(entry, sizeof(entry),
"devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", cpu);

return sysfs__read_ull(entry, freq);
}
6 changes: 6 additions & 0 deletions tools/lib/api/cpu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef __API_CPU__
#define __API_CPU__

int cpu__get_max_freq(unsigned long long *freq);

#endif /* __API_CPU__ */
3 changes: 0 additions & 3 deletions tools/lib/api/fs/Build
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
libapi-y += fs.o
libapi-y += tracing_path.o
libapi-y += debugfs.o
libapi-y += findfs.o
libapi-y += tracefs.o
77 changes: 0 additions & 77 deletions tools/lib/api/fs/debugfs.c

This file was deleted.

23 changes: 0 additions & 23 deletions tools/lib/api/fs/debugfs.h

This file was deleted.

63 changes: 0 additions & 63 deletions tools/lib/api/fs/findfs.c

This file was deleted.

23 changes: 0 additions & 23 deletions tools/lib/api/fs/findfs.h

This file was deleted.

46 changes: 45 additions & 1 deletion tools/lib/api/fs/fs.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -11,7 +12,6 @@
#include <unistd.h>
#include <sys/mount.h>

#include "debugfs.h"
#include "fs.h"

#define _STR(x) #x
Expand Down Expand Up @@ -282,6 +282,50 @@ int filename__read_int(const char *filename, int *value)
return err;
}

int filename__read_ull(const char *filename, unsigned long long *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 = strtoull(line, NULL, 10);
if (*value != ULLONG_MAX)
err = 0;
}

close(fd);
return err;
}

int sysfs__read_ull(const char *entry, unsigned long long *value)
{
char path[PATH_MAX];
const char *sysfs = sysfs__mountpoint();

if (!sysfs)
return -1;

snprintf(path, sizeof(path), "%s/%s", sysfs, entry);

return filename__read_ull(path, value);
}

int sysfs__read_int(const char *entry, int *value)
{
char path[PATH_MAX];
const char *sysfs = sysfs__mountpoint();

if (!sysfs)
return -1;

snprintf(path, sizeof(path), "%s/%s", sysfs, entry);

return filename__read_int(path, value);
}

int sysctl__read_int(const char *sysctl, int *value)
{
char path[PATH_MAX];
Expand Down
4 changes: 4 additions & 0 deletions tools/lib/api/fs/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ FS(tracefs)


int filename__read_int(const char *filename, int *value);
int filename__read_ull(const char *filename, unsigned long long *value);

int sysctl__read_int(const char *sysctl, int *value);
int sysfs__read_int(const char *entry, int *value);
int sysfs__read_ull(const char *entry, unsigned long long *value);
#endif /* __API_FS__ */
78 changes: 0 additions & 78 deletions tools/lib/api/fs/tracefs.c

This file was deleted.

Loading

0 comments on commit 9059b28

Please sign in to comment.