All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 0/2] perf/urgent fixes
@ 2011-01-22  1:16 Arnaldo Carvalho de Melo
  2011-01-22  1:16 ` [PATCH 1/2] perf symbols: Fix annotation of thumb code Arnaldo Carvalho de Melo
  2011-01-22  1:16 ` [PATCH 2/2] perf test: Use cpu_map->[cpu] when setting affinity Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-01-22  1:16 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Dave Martin,
	Dr. David Alan Gilbert, Han Pingtian, Ingo Molnar

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Hi Ingo,

        Please consider pulling from:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/urgent

Regards,

- Arnaldo

Dr. David Alan Gilbert (1):
  perf symbols: Fix annotation of thumb code

Han Pingtian (1):
  perf test: Use cpu_map->[cpu] when setting affinity

 tools/perf/builtin-test.c |   13 +++++++++----
 tools/perf/util/symbol.c  |    7 +++++++
 2 files changed, 16 insertions(+), 4 deletions(-)

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Dave Martin <dave.martin@linaro.org>
Cc: Dr. David Alan Gilbert <david.gilbert@linaro.org>
Cc: Han Pingtian <phan@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] perf symbols: Fix annotation of thumb code
  2011-01-22  1:16 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2011-01-22  1:16 ` Arnaldo Carvalho de Melo
  2011-01-22  1:16 ` [PATCH 2/2] perf test: Use cpu_map->[cpu] when setting affinity Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-01-22  1:16 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Dr. David Alan Gilbert, Ingo Molnar, Dave Martin,
	Arnaldo Carvalho de Melo

From: Dr. David Alan Gilbert <david.gilbert@linaro.org>

In ARM's Thumb mode the bottom bit of the symbol address is set to mark
the function as Thumb; the instructions are in reality 2 or 4 byte on 2
byte alignments, and when the +1 address is used in annotate it causes
objdump to disassemble invalid instructions.

The patch removes that bottom bit during symbol loading.

Many thinks to Dave Martin for comments on an initial version of the
patch.

(For reference this corresponds to this bug
https://bugs.launchpad.net/linux-linaro/+bug/677547 )

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Dave Martin <dave.martin@linaro.org>
LKML-Reference: <20110121163922.GA31398@davesworkthinkpad>
Signed-off-by: Dr. David Alan Gilbert <david.gilbert@linaro.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 15ccfba..e32478e 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1161,6 +1161,13 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
 
 		section_name = elf_sec__name(&shdr, secstrs);
 
+		/* On ARM, symbols for thumb functions have 1 added to
+		 * the symbol address as a flag - remove it */
+		if ((ehdr.e_machine == EM_ARM) &&
+		    (map->type == MAP__FUNCTION) &&
+		    (sym.st_value & 1))
+			--sym.st_value;
+
 		if (self->kernel != DSO_TYPE_USER || kmodule) {
 			char dso_name[PATH_MAX];
 
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] perf test: Use cpu_map->[cpu] when setting affinity
  2011-01-22  1:16 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
  2011-01-22  1:16 ` [PATCH 1/2] perf symbols: Fix annotation of thumb code Arnaldo Carvalho de Melo
@ 2011-01-22  1:16 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-01-22  1:16 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Han Pingtian, Arnaldo Carvalho de Melo

From: Han Pingtian <phan@redhat.com>

When some of CPUs are offline:

 # cat /sys/devices/system/cpu/online
 0,6-31

perf test will fail on #3 testcase:

   3: detect open syscall event on all cpus:
   --- start ---
   perf_evsel__read_on_cpu: expected to intercept 111 calls on cpu 0, got 681
   perf_evsel__read_on_cpu: expected to intercept 112 calls on cpu 1, got 117
   perf_evsel__read_on_cpu: expected to intercept 113 calls on cpu 2, got 118
   perf_evsel__read_on_cpu: expected to intercept 114 calls on cpu 3, got 119
   perf_evsel__read_on_cpu: expected to intercept 115 calls on cpu 4, got 120
   perf_evsel__read_on_cpu: expected to intercept 116 calls on cpu 5, got 121
   perf_evsel__read_on_cpu: expected to intercept 117 calls on cpu 6, got 122
   perf_evsel__read_on_cpu: expected to intercept 118 calls on cpu 7, got 123
   perf_evsel__read_on_cpu: expected to intercept 119 calls on cpu 8, got 124
   perf_evsel__read_on_cpu: expected to intercept 120 calls on cpu 9, got 125
   perf_evsel__read_on_cpu: expected to intercept 121 calls on cpu 10, got 126
   ....

This patch try to use 'cpus->map[cpu]' when setting cpu affinity, and
will check the return code of sched_setaffinity()

LKML-Reference: <20110120114707.GA11781@hpt.nay.redhat.com>
Signed-off-by: Han Pingtian <phan@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-test.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index ed56961..02958d6 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -380,13 +380,18 @@ static int test__open_syscall_event_on_all_cpus(void)
 	for (cpu = 0; cpu < cpus->nr; ++cpu) {
 		unsigned int ncalls = nr_open_calls + cpu;
 
-		CPU_SET(cpu, cpu_set);
-		sched_setaffinity(0, cpu_set_size, cpu_set);
+		CPU_SET_S(cpus->map[cpu], cpu_set_size, cpu_set);
+		if (sched_setaffinity(0, cpu_set_size, cpu_set) < 0) {
+			pr_debug("sched_setaffinity() failed on CPU %d: %s ",
+				 cpus->map[cpu],
+				 strerror(errno));
+			goto out_close_fd;
+		}
 		for (i = 0; i < ncalls; ++i) {
 			fd = open("/etc/passwd", O_RDONLY);
 			close(fd);
 		}
-		CPU_CLR(cpu, cpu_set);
+		CPU_CLR_S(cpus->map[cpu], cpu_set_size, cpu_set);
 	}
 
 	/*
@@ -410,7 +415,7 @@ static int test__open_syscall_event_on_all_cpus(void)
 		expected = nr_open_calls + cpu;
 		if (evsel->counts->cpu[cpu].val != expected) {
 			pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %Ld\n",
-				 expected, cpu, evsel->counts->cpu[cpu].val);
+				 expected, cpus->map[cpu], evsel->counts->cpu[cpu].val);
 			goto out_close_fd;
 		}
 	}
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-22  1:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-22  1:16 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
2011-01-22  1:16 ` [PATCH 1/2] perf symbols: Fix annotation of thumb code Arnaldo Carvalho de Melo
2011-01-22  1:16 ` [PATCH 2/2] perf test: Use cpu_map->[cpu] when setting affinity Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.