Pushkar Joshi | abbb266 | 2012-09-07 14:22:58 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #undef TRACE_SYSTEM |
| 14 | #define TRACE_SYSTEM exception |
| 15 | |
| 16 | #if !defined(_TRACE_EXCEPTION_H) || defined(TRACE_HEADER_MULTI_READ) |
| 17 | #define _TRACE_EXCEPTION_H |
| 18 | |
| 19 | #include <linux/tracepoint.h> |
| 20 | |
| 21 | struct task_struct; |
| 22 | |
| 23 | TRACE_EVENT(user_fault, |
| 24 | |
| 25 | TP_PROTO(struct task_struct *tsk, unsigned long addr, unsigned int fsr), |
| 26 | |
| 27 | TP_ARGS(tsk, addr, fsr), |
| 28 | |
| 29 | TP_STRUCT__entry( |
| 30 | __string(task_name, tsk->comm) |
| 31 | __field(unsigned long, addr) |
| 32 | __field(unsigned int, fsr) |
| 33 | ), |
| 34 | |
| 35 | TP_fast_assign( |
| 36 | __assign_str(task_name, tsk->comm) |
| 37 | __entry->addr = addr; |
| 38 | __entry->fsr = fsr; |
| 39 | ), |
| 40 | |
| 41 | TP_printk("task_name:%s addr:%lu, fsr:%u", __get_str(task_name),\ |
| 42 | __entry->addr, __entry->fsr) |
| 43 | ); |
| 44 | |
| 45 | struct pt_regs; |
| 46 | |
| 47 | TRACE_EVENT(undef_instr, |
| 48 | |
| 49 | TP_PROTO(struct pt_regs *regs, void *prog_cnt), |
| 50 | |
| 51 | TP_ARGS(regs, prog_cnt), |
| 52 | |
| 53 | TP_STRUCT__entry( |
| 54 | __field(void *, prog_cnt) |
| 55 | __field(struct pt_regs *, regs) |
| 56 | ), |
| 57 | |
| 58 | TP_fast_assign( |
| 59 | __entry->regs = regs; |
| 60 | __entry->prog_cnt = prog_cnt; |
| 61 | ), |
| 62 | |
| 63 | TP_printk("pc:%p", __entry->prog_cnt) |
| 64 | ); |
| 65 | |
| 66 | #endif |
| 67 | |
| 68 | #include <trace/define_trace.h> |