aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/oprofile/nmi_int.c5
-rw-r--r--arch/x86/oprofile/op_counter.h1
-rw-r--r--tools/perf/Makefile8
-rw-r--r--tools/perf/util/event.c2
-rw-r--r--tools/perf/util/setup.py7
-rw-r--r--tools/perf/util/symbol.c5
6 files changed, 24 insertions, 4 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 8dace181c88e..cf9750004a08 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -49,6 +49,10 @@ u64 op_x86_get_ctrl(struct op_x86_model_spec const *model,
49 val |= counter_config->user ? ARCH_PERFMON_EVENTSEL_USR : 0; 49 val |= counter_config->user ? ARCH_PERFMON_EVENTSEL_USR : 0;
50 val |= counter_config->kernel ? ARCH_PERFMON_EVENTSEL_OS : 0; 50 val |= counter_config->kernel ? ARCH_PERFMON_EVENTSEL_OS : 0;
51 val |= (counter_config->unit_mask & 0xFF) << 8; 51 val |= (counter_config->unit_mask & 0xFF) << 8;
52 counter_config->extra &= (ARCH_PERFMON_EVENTSEL_INV |
53 ARCH_PERFMON_EVENTSEL_EDGE |
54 ARCH_PERFMON_EVENTSEL_CMASK);
55 val |= counter_config->extra;
52 event &= model->event_mask ? model->event_mask : 0xFF; 56 event &= model->event_mask ? model->event_mask : 0xFF;
53 val |= event & 0xFF; 57 val |= event & 0xFF;
54 val |= (event & 0x0F00) << 24; 58 val |= (event & 0x0F00) << 24;
@@ -440,6 +444,7 @@ static int nmi_create_files(struct super_block *sb, struct dentry *root)
440 oprofilefs_create_ulong(sb, dir, "unit_mask", &counter_config[i].unit_mask); 444 oprofilefs_create_ulong(sb, dir, "unit_mask", &counter_config[i].unit_mask);
441 oprofilefs_create_ulong(sb, dir, "kernel", &counter_config[i].kernel); 445 oprofilefs_create_ulong(sb, dir, "kernel", &counter_config[i].kernel);
442 oprofilefs_create_ulong(sb, dir, "user", &counter_config[i].user); 446 oprofilefs_create_ulong(sb, dir, "user", &counter_config[i].user);
447 oprofilefs_create_ulong(sb, dir, "extra", &counter_config[i].extra);
443 } 448 }
444 449
445 return 0; 450 return 0;
diff --git a/arch/x86/oprofile/op_counter.h b/arch/x86/oprofile/op_counter.h
index e28398df0df2..0b7b7b179cbe 100644
--- a/arch/x86/oprofile/op_counter.h
+++ b/arch/x86/oprofile/op_counter.h
@@ -22,6 +22,7 @@ struct op_counter_config {
22 unsigned long kernel; 22 unsigned long kernel;
23 unsigned long user; 23 unsigned long user;
24 unsigned long unit_mask; 24 unsigned long unit_mask;
25 unsigned long extra;
25}; 26};
26 27
27extern struct op_counter_config counter_config[]; 28extern struct op_counter_config counter_config[];
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 158c30e8210c..207dee5c5b16 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -165,8 +165,12 @@ grep-libs = $(filter -l%,$(1))
165strip-libs = $(filter-out -l%,$(1)) 165strip-libs = $(filter-out -l%,$(1))
166 166
167$(OUTPUT)python/perf.so: $(PYRF_OBJS) 167$(OUTPUT)python/perf.so: $(PYRF_OBJS)
168 $(QUIET_GEN)python util/setup.py --quiet build_ext --build-lib='$(OUTPUT)python' \ 168 $(QUIET_GEN)( \
169 --build-temp='$(OUTPUT)python/temp' 169 export CFLAGS="$(BASIC_CFLAGS)"; \
170 python util/setup.py --quiet build_ext --build-lib='$(OUTPUT)python' \
171 --build-temp='$(OUTPUT)python/temp' \
172 )
173
170# 174#
171# No Perl scripts right now: 175# No Perl scripts right now:
172# 176#
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 2b15c362ef56..1023f67633a4 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -710,7 +710,7 @@ try_again:
710 * in the whole kernel symbol list. 710 * in the whole kernel symbol list.
711 */ 711 */
712 if ((long long)al->addr < 0 && 712 if ((long long)al->addr < 0 &&
713 cpumode == PERF_RECORD_MISC_KERNEL && 713 cpumode == PERF_RECORD_MISC_USER &&
714 machine && mg != &machine->kmaps) { 714 machine && mg != &machine->kmaps) {
715 mg = &machine->kmaps; 715 mg = &machine->kmaps;
716 goto try_again; 716 goto try_again;
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index e24ffadb20b2..bbc982f5dd8b 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -1,13 +1,18 @@
1#!/usr/bin/python2 1#!/usr/bin/python2
2 2
3from distutils.core import setup, Extension 3from distutils.core import setup, Extension
4from os import getenv
5
6cflags = ['-fno-strict-aliasing', '-Wno-write-strings']
7cflags += getenv('CFLAGS', '').split()
4 8
5perf = Extension('perf', 9perf = Extension('perf',
6 sources = ['util/python.c', 'util/ctype.c', 'util/evlist.c', 10 sources = ['util/python.c', 'util/ctype.c', 'util/evlist.c',
7 'util/evsel.c', 'util/cpumap.c', 'util/thread_map.c', 11 'util/evsel.c', 'util/cpumap.c', 'util/thread_map.c',
8 'util/util.c', 'util/xyarray.c', 'util/cgroup.c'], 12 'util/util.c', 'util/xyarray.c', 'util/cgroup.c'],
9 include_dirs = ['util/include'], 13 include_dirs = ['util/include'],
10 extra_compile_args = ['-fno-strict-aliasing', '-Wno-write-strings']) 14 extra_compile_args = cflags,
15 )
11 16
12setup(name='perf', 17setup(name='perf',
13 version='0.1', 18 version='0.1',
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 17df793c8924..f06c10f092ba 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1196,6 +1196,8 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
1196 if (curr_dso == NULL) 1196 if (curr_dso == NULL)
1197 goto out_elf_end; 1197 goto out_elf_end;
1198 curr_dso->kernel = self->kernel; 1198 curr_dso->kernel = self->kernel;
1199 curr_dso->long_name = self->long_name;
1200 curr_dso->long_name_len = self->long_name_len;
1199 curr_map = map__new2(start, curr_dso, 1201 curr_map = map__new2(start, curr_dso,
1200 map->type); 1202 map->type);
1201 if (curr_map == NULL) { 1203 if (curr_map == NULL) {
@@ -1842,6 +1844,7 @@ int dso__load_vmlinux(struct dso *self, struct map *map,
1842 if (fd < 0) 1844 if (fd < 0)
1843 return -1; 1845 return -1;
1844 1846
1847 dso__set_long_name(self, (char *)vmlinux);
1845 dso__set_loaded(self, map->type); 1848 dso__set_loaded(self, map->type);
1846 err = dso__load_sym(self, map, symfs_vmlinux, fd, filter, 0, 0); 1849 err = dso__load_sym(self, map, symfs_vmlinux, fd, filter, 0, 0);
1847 close(fd); 1850 close(fd);
@@ -2403,6 +2406,8 @@ int symbol__init(void)
2403 if (symbol_conf.initialized) 2406 if (symbol_conf.initialized)
2404 return 0; 2407 return 0;
2405 2408
2409 symbol_conf.priv_size = ALIGN(symbol_conf.priv_size, sizeof(u64));
2410
2406 elf_version(EV_CURRENT); 2411 elf_version(EV_CURRENT);
2407 if (symbol_conf.sort_by_name) 2412 if (symbol_conf.sort_by_name)
2408 symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) - 2413 symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) -