aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pstore/ftrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/pstore/ftrace.c')
-rw-r--r--fs/pstore/ftrace.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/fs/pstore/ftrace.c b/fs/pstore/ftrace.c
new file mode 100644
index 000000000000..a130d484b7d3
--- /dev/null
+++ b/fs/pstore/ftrace.c
@@ -0,0 +1,35 @@
1/*
2 * Copyright 2012 Google, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#include <linux/kernel.h>
15#include <linux/compiler.h>
16#include <linux/irqflags.h>
17#include <linux/percpu.h>
18#include <linux/smp.h>
19#include <linux/atomic.h>
20#include <asm/barrier.h>
21#include "internal.h"
22
23void notrace pstore_ftrace_call(unsigned long ip, unsigned long parent_ip)
24{
25 struct pstore_ftrace_record rec = {};
26
27 if (unlikely(oops_in_progress))
28 return;
29
30 rec.ip = ip;
31 rec.parent_ip = parent_ip;
32 pstore_ftrace_encode_cpu(&rec, raw_smp_processor_id());
33 psinfo->write_buf(PSTORE_TYPE_FTRACE, 0, NULL, 0, (void *)&rec,
34 sizeof(rec), psinfo);
35}