Linux Audio

Check our new training course

Loading...
v5.4
 1// SPDX-License-Identifier: GPL-2.0
 2/*
 3 * Performance event callchain support - SuperH architecture code
 4 *
 5 * Copyright (C) 2009  Paul Mundt
 6 */
 7#include <linux/kernel.h>
 8#include <linux/sched.h>
 9#include <linux/perf_event.h>
10#include <linux/percpu.h>
11#include <asm/unwinder.h>
12#include <asm/ptrace.h>
13
14static int callchain_stack(void *data, char *name)
15{
16	return 0;
17}
18
19static void callchain_address(void *data, unsigned long addr, int reliable)
20{
21	struct perf_callchain_entry_ctx *entry = data;
22
23	if (reliable)
24		perf_callchain_store(entry, addr);
25}
26
27static const struct stacktrace_ops callchain_ops = {
28	.stack		= callchain_stack,
29	.address	= callchain_address,
30};
31
32void
33perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
34{
35	perf_callchain_store(entry, regs->pc);
36
37	unwind_stack(NULL, regs, NULL, &callchain_ops, entry);
38}
v6.9.4
 1// SPDX-License-Identifier: GPL-2.0
 2/*
 3 * Performance event callchain support - SuperH architecture code
 4 *
 5 * Copyright (C) 2009  Paul Mundt
 6 */
 7#include <linux/kernel.h>
 8#include <linux/sched.h>
 9#include <linux/perf_event.h>
10#include <linux/percpu.h>
11#include <asm/unwinder.h>
12#include <asm/ptrace.h>
13
 
 
 
 
 
14static void callchain_address(void *data, unsigned long addr, int reliable)
15{
16	struct perf_callchain_entry_ctx *entry = data;
17
18	if (reliable)
19		perf_callchain_store(entry, addr);
20}
21
22static const struct stacktrace_ops callchain_ops = {
 
23	.address	= callchain_address,
24};
25
26void
27perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
28{
29	perf_callchain_store(entry, regs->pc);
30
31	unwind_stack(NULL, regs, NULL, &callchain_ops, entry);
32}