-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux…
…/kernel/git/acme/linux into perf/core Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: User visible changes: - Make Ctrl-C stop processing on TUI, allowing interrupting the load of big perf.data files (Namhyung Kim) - Fix 'perf annotate' -i option, which is currently ignored (Martin Liška) - Add ARM64 perf_regs_load to support libunwind and enable testing (Wang Nan) Infrastructure changes: - Fix thread ref-counting in db-export (Adrian Hunter) - Fix compiler warning about may be accessing uninitialized (Arnaldo Carvalho de Melo) - No need to have two lists for user and kernel DSOs, unify them (Arnaldo Carvalho de Melo) - Function namespace consistency fixups (Arnaldo Carvalho de Melo) - Do not fail on missing Build file, fixing the build on MIPS (Jiri Olsa) - Fix up syscall tests, making those tests pass on ARM64 (Riku Voipio) - Fix 'function unused' warning in 'perf probe' (Wang Nan) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
- Loading branch information
Showing
34 changed files
with
277 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ ex-y += ex.o | |
ex-y += a.o | ||
ex-y += b.o | ||
ex-y += empty/ | ||
ex-y += empty2/ | ||
|
||
libex-y += c.o | ||
libex-y += d.o | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This directory is left intentionally without Build file | ||
to test proper nesting into Build-less directories. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
libperf-y += util/ | ||
libperf-$(CONFIG_DWARF_UNWIND) += tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
libperf-y += regs_load.o | ||
libperf-y += dwarf-unwind.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#include <string.h> | ||
#include "perf_regs.h" | ||
#include "thread.h" | ||
#include "map.h" | ||
#include "event.h" | ||
#include "debug.h" | ||
#include "tests/tests.h" | ||
|
||
#define STACK_SIZE 8192 | ||
|
||
static int sample_ustack(struct perf_sample *sample, | ||
struct thread *thread, u64 *regs) | ||
{ | ||
struct stack_dump *stack = &sample->user_stack; | ||
struct map *map; | ||
unsigned long sp; | ||
u64 stack_size, *buf; | ||
|
||
buf = malloc(STACK_SIZE); | ||
if (!buf) { | ||
pr_debug("failed to allocate sample uregs data\n"); | ||
return -1; | ||
} | ||
|
||
sp = (unsigned long) regs[PERF_REG_ARM64_SP]; | ||
|
||
map = map_groups__find(thread->mg, MAP__VARIABLE, (u64) sp); | ||
if (!map) { | ||
pr_debug("failed to get stack map\n"); | ||
free(buf); | ||
return -1; | ||
} | ||
|
||
stack_size = map->end - sp; | ||
stack_size = stack_size > STACK_SIZE ? STACK_SIZE : stack_size; | ||
|
||
memcpy(buf, (void *) sp, stack_size); | ||
stack->data = (char *) buf; | ||
stack->size = stack_size; | ||
return 0; | ||
} | ||
|
||
int test__arch_unwind_sample(struct perf_sample *sample, | ||
struct thread *thread) | ||
{ | ||
struct regs_dump *regs = &sample->user_regs; | ||
u64 *buf; | ||
|
||
buf = calloc(1, sizeof(u64) * PERF_REGS_MAX); | ||
if (!buf) { | ||
pr_debug("failed to allocate sample uregs data\n"); | ||
return -1; | ||
} | ||
|
||
perf_regs_load(buf); | ||
regs->abi = PERF_SAMPLE_REGS_ABI; | ||
regs->regs = buf; | ||
regs->mask = PERF_REGS_MASK; | ||
|
||
return sample_ustack(sample, thread, buf); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <linux/linkage.h> | ||
|
||
.text | ||
.type perf_regs_load,%function | ||
#define STR_REG(r) str x##r, [x0, 8 * r] | ||
#define LDR_REG(r) ldr x##r, [x0, 8 * r] | ||
#define SP (8 * 31) | ||
#define PC (8 * 32) | ||
ENTRY(perf_regs_load) | ||
STR_REG(0) | ||
STR_REG(1) | ||
STR_REG(2) | ||
STR_REG(3) | ||
STR_REG(4) | ||
STR_REG(5) | ||
STR_REG(6) | ||
STR_REG(7) | ||
STR_REG(8) | ||
STR_REG(9) | ||
STR_REG(10) | ||
STR_REG(11) | ||
STR_REG(12) | ||
STR_REG(13) | ||
STR_REG(14) | ||
STR_REG(15) | ||
STR_REG(16) | ||
STR_REG(17) | ||
STR_REG(18) | ||
STR_REG(19) | ||
STR_REG(20) | ||
STR_REG(21) | ||
STR_REG(22) | ||
STR_REG(23) | ||
STR_REG(24) | ||
STR_REG(25) | ||
STR_REG(26) | ||
STR_REG(27) | ||
STR_REG(28) | ||
STR_REG(29) | ||
STR_REG(30) | ||
mov x1, sp | ||
str x1, [x0, #SP] | ||
str x30, [x0, #PC] | ||
LDR_REG(1) | ||
ret | ||
ENDPROC(perf_regs_load) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.